Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save Custom Goals #72

Closed
JustAnotherSoftwareDeveloper opened this issue Jul 10, 2018 · 9 comments
Closed

Save Custom Goals #72

JustAnotherSoftwareDeveloper opened this issue Jul 10, 2018 · 9 comments
Assignees
Labels
completed feature-request New feature or request
Milestone

Comments

@JustAnotherSoftwareDeveloper

My default workflow is to run "clean install". To do this I have to do the following things

  1. Open the command prompt and navigate to "Maven: Run Goal"

  2. Select Project

  3. Either a) Select the custom goal from history OR b) select custom goal and write it again

It would benefit me to have a way to save off custom goals in a way that they are treated as "first class citizens" IE accessed in a way similar or identical to the standard goals ("install, deploy") are

@Eskibear
Copy link
Member

Eskibear commented Jul 11, 2018

Exactly, I have similar default workflow "clean package", and that's why we register the command maven.history, it allows me to fast re-run the workflow.

For entries in the context menu as shown below, they are defined in package.json here.
image
For the moment, I don't think VS Code has such APIs to dynamically add new commands.
Ref: microsoft/vscode#1422

For the items in QuickPick box shown below, currently we directly leverage those pre-defined command I mentioned above. Code is here
image
For this part, technically it's doable. E.g. read from part of settings and append new items to the list, then execute as custom goals.

But I'm wondering that is Maven: history not good enough for your scenario? By command palette -> Maven: history -> select the clean install one, you don't even have to select the project in an extra step. Please kindly share your experience about it.

@Eskibear Eskibear self-assigned this Jul 11, 2018
@JustAnotherSoftwareDeveloper
Copy link
Author

Let's be clear: What you've done already is awesome. I can more or less use this for my every day workflow. However, there are reasons that the maven history command alone is not enough for me.

I work on a variety of different maven projects in different workspaces. Each time I open a new project, I have to re-enter the list of custom commands I use for the new project.

If possible, it would nice to have a section in the settings section defining a list of goal names and their commands. At which point those could appear as options in the context menu for whenever you activate "custom goals", even if you haven't ran that goal on the particular maven project you're referencing. I believe that solution would be compatible with the current vscode api.

@Eskibear
Copy link
Member

Each time I open a new project, I have to re-enter the list of custom commands I use for the new project.

This feature request makes sense in your scenario. We'll take this into consideration.

At which point those could appear as options in the context menu for whenever you activate "custom goals"

Do you mean: right click a project -> click custom goals... -> then your pre-defined commands are listed in the dropdown list?
If that's what you mean, here I'd like to introduce 2 different VSCode APIs, let's call them InputBox and QuickPickBox. For InputBox (what it shows to you now after you click custom goals...), it accepts what you enter as a string. For QuickPickBox, the input area is only used to filter items listed in the dropdown menu. If we use QuickPickBox here as you suggested, listing your predefined commands, then it's impossible to directly enter a string as a command to execute. It looks like the following.

[ Input Area (used to filter items) ]
- clean package (predefined command 1)
- spring-boot:run -Dbalabala=balabala (predefined command 1)

@JustAnotherSoftwareDeveloper
Copy link
Author

I'm sorry, let me be more clear. After running Ctrl+Shift+P to bring up the command pallet, there is a maven: custom goals option. If, when that command is selected there, there are options for user-defined goals, that would work. I believe that's possible with the current api, but feel free to correct me if I'm wrong.

@Eskibear
Copy link
Member

I remember we've refactored a lot and removed command palette entry for a lot of commands (such as maven: install ) in order to decrease noise. Following is what I have now.
image

@JustAnotherSoftwareDeveloper Let's first figure out what's the version of the extension you are using?

@JustAnotherSoftwareDeveloper
Copy link
Author

I'll have to check when I get into work on monday. It's most likely that I'm on the right version, and simply misremembered the command pallet name. Either way, I'll review my workstation Monday so I can provide a more concise suggestion.

@Eskibear
Copy link
Member

And back to the place to put pre-defined commands, for the latest version of the extension, following place is somehow feasible.
Maven: Execute commands -> select a project -> HERE we can append the pre-defined commands to the dropdown list.

@JustAnotherSoftwareDeveloper
Copy link
Author

While I initially suggested a dropdown option, I'm not tied to it. If there was a "Maven: Execute User Defined Command" (or something with the same functionality but a better name) that listed commands defined in the settings, that would be more than enough to fit my use case.

I guess it comes down to the difficulty of implementation and what would provide the best User Experience.

@Eskibear Eskibear added this to the 0.11.0 milestone Jul 26, 2018
@Eskibear Eskibear added the feature-request New feature or request label Jul 26, 2018
@Eskibear Eskibear mentioned this issue Sep 3, 2018
5 tasks
@Eskibear Eskibear modified the milestones: 0.11.0, backlog Sep 13, 2018
@Eskibear Eskibear modified the milestones: backlog, 0.15.0 Mar 4, 2019
@Eskibear
Copy link
Member

Eskibear commented Mar 8, 2019

@JustAnotherSoftwareDeveloper Now in v0.15.0, you are able to set "favorite" command via config entry "maven.terminal.favorites".

@Eskibear Eskibear closed this as completed Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants