microsoft / vscode-maven

VSCode extension "Maven for Java"
https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-maven
Other
179 stars 88 forks source link

Favourite Alias is not visible after long command #1033

Open DanielOL1 opened 1 month ago

DanielOL1 commented 1 month ago

Describe the bug Overall: The alias functionality for favourites does not work, when using long maven execution commands: if the command is long, the defined alias does not appear in the UI.

Detail: I have several long, similar maven executions in a project. In the favourites list I cannot easily see which is which. It would be very useful to have a defined Alias for each, with a shorter, simplified descriptor, so that they could easily be distinguished from one another. However, the "alias" is pushed off screen, not visible in the UI, because of the length of the "command".

Suggestion: revert the changes in this commit (cdf6f7b) to the file: src/explorer/model/FavoriteCommand.ts Justification: In order for Alias to have a purpose it must be visible in the case of long execution commands. It is easier for a user to reduce the length of the alias, than it is to reduce the length of the command. If the user prefers to see the command first, then they can completely omit the alias since the other changes in this commit appear to have made the alias an option parameter.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'vscode > settings.json'
  2. Add any number of favourites objects with alias (string), command (string) and debug (boolean) as per the docs
  3. include a command which is long (eg. longer than 200 or 300 characters), such as by including file / directory paths in arguments.
  4. Save the settings file
  5. View the new favourites in the list of saved favourites, in the extension menu / maven explorer - the alias is not visible when the command is very long.

Expected behavior User can decide to define shorthand a shorthand alias to refer to their favourite execute, in order to simplify the favourites menu.

Environments (please complete the following information as much as possible): I do not believe environment is a factor

gavin-lb commented 2 weeks ago

This is quite annoying. Indeed, the obvious solution is simply to have the alias take precedence over the command when set, ie. it should be displayed as ${alias)} ${command} rather than ${command} ${alias}. Clearly the alias will be more meaningful than the command (that is the entire purpose of setting an alias), hence it should be displayed first.