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

Debug quarkus project command doesn't appear on Quarkus projects after going from lightweight mode to standard mode #299

Closed
xorye opened this issue Aug 4, 2020 · 2 comments · Fixed by #300
Assignees
Labels
bug Something isn't working
Milestone

Comments

@xorye
Copy link
Contributor

xorye commented Aug 4, 2020

When the Java language server starts in lightweight mode, the project label info command (which is called when vscode-quarkus first starts) fails. Therefore the debug current quarkus project command (and add extensions command) will not appear in the command palette.

When the Java language server is switched to standard mode we still do not have those commands because the project labels command isn't triggered. The user would have to trigger it by adding or removing a workspace file:

const listener: Disposable = workspace.onDidChangeWorkspaceFolders(async () => {

@angelozerr
Copy link
Contributor

@xorye have you some idea how to fix this issue?

@xorye
Copy link
Contributor Author

xorye commented Aug 6, 2020

Currently, the microprofile/java/workspaceLabels is called when vscode-quarkus first starts. Vscode-quarkus caches the result. Depending on the result (whether or not there are quarkus projects in the current workspace), vscode-quarkus will either display or hide the "Add quarkus extensions" and "Debug current quarkus project" commands from the command palette. If the Java LS is in lightweight mode, vscode-quarkus does not get a result for microprofile/java/workspaceLabels.

One solution would be to always show the "Add quarkus extensions" and "Debug current quarkus project" commands in the command palette if the Java language server is in lightweight mode. If the user calls one of these commands while in lightweight mode, I don't think vscode-quarkus should do anything to stop it since adding quarkus extensions and calling the debug command don't need to depend on the Java language server.

To do this, vscode-quarkus needs to know when the Java language server is in lightweight mode and when its in standard mode.

Lightweight mode -> always show "Add quarkus extensions" and "Debug current quarkus project" commands
Standard mode -> keep the current functionality (shows/hide the "Add quarkus extensions" and "Debug current quarkus project" commands depending on the result from microprofile/java/workspaceLabels)

The feature that shows/hides the "Add quarkus extensions" and "Debug current quarkus project" commands is just an enhancement that depends on the Java language server. Since its an enhancement, I think we can live without it in lightweight mode.

@fbricon fbricon added this to the 1.7.0 milestone Aug 11, 2020
datho7561 added a commit to datho7561/vscode-quarkus that referenced this issue Aug 20, 2020
Add extensions and Debug are always visible in the command palette.
If either Add extensions or Debug is selected
while the Java server is in LightWeight mode,
the user is prompted with a dialog that allows them
to switch to Standard mode.
The actions are performed after the switch is made.

This solution was adopted from:
microsoft/vscode-java-debug@20cd68c

Fixes redhat-developer#299

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/vscode-quarkus that referenced this issue Sep 17, 2020
Fixes redhat-developer#299

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/vscode-quarkus that referenced this issue Sep 17, 2020
Debug and add extension are always visible in lightweight mode
if the extension is active. Using them prompts to enable standard mode.
After switching to standard mode:
 * If the project is not a Quarkus project, then an error appears
 * If the project is a Quarkus project, the command is run normally.

If vscode-java switches to standard mode through some other means,
or it is started in standard mode, then the debug and add extension
commands are shown/hidden depending on if the project is a Quarkus
project.

Fixes redhat-developer#299

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/vscode-quarkus that referenced this issue Sep 17, 2020
Debug and add extension are always visible in lightweight mode
if the extension is active. Using them prompts to enable standard mode.
After switching to standard mode:
 * If the project is not a Quarkus project, then an error appears
 * If the project is a Quarkus project, the command is run normally.

If vscode-java switches to standard mode through some other means,
or it is started in standard mode, then the debug and add extension
commands are shown/hidden depending on if the project is a Quarkus
project.

Fixes redhat-developer#299

Signed-off-by: David Thompson <davthomp@redhat.com>
angelozerr pushed a commit that referenced this issue Sep 18, 2020
Debug and add extension are always visible in lightweight mode
if the extension is active. Using them prompts to enable standard mode.
After switching to standard mode:
 * If the project is not a Quarkus project, then an error appears
 * If the project is a Quarkus project, the command is run normally.

If vscode-java switches to standard mode through some other means,
or it is started in standard mode, then the debug and add extension
commands are shown/hidden depending on if the project is a Quarkus
project.

Fixes #299

Signed-off-by: David Thompson <davthomp@redhat.com>
@angelozerr angelozerr added the bug Something isn't working label Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants