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

POC for avoiding waiting on vscode-microprofile #368

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

datho7561
Copy link
Contributor

@datho7561 datho7561 commented Jun 22, 2021

Work in progress.

Instead of directly depending on vscode-microprofile, send the user a notification with a button to install the extension. The user can reject the installation. If they reject the installation, they will be free to use:

  • qute syntax highlight
  • properties file syntax highlight
  • project generator

However, no new language features (completion/validation) will appear, and they will be prompted to install vscode-microprofile when attempting to run commands that require it.

Since vscode-quarkus doesn't list itself as depending on vscode-microprofile anymore, it can start the project generator without starting vscode-microprofile or even vscode-java. This allows for it to work in rootless mode.

Closes #323

Signed-off-by: David Thompson [email protected]

Work in progress.
Instead of directly depending on vscode-microprofile,
send the user a notification with a button to install the extension.
The user can reject the installation.
They will be free to use:
 * qute syntax highlight
 * properties file highlight
 * project generator
but no new language features will appear,
and they will be prompted to install vscode-microprofile when attempting
to run commands that require it.

Since vscode-quarkus doesn't wait on vscode-microprofile starting
anymore, it can start the project generator without starting
vscode-microprofile or even vscode-java. This allows for it to work in
rootless mode.

Closes redhat-developer#323

Signed-off-by: David Thompson <[email protected]>
@datho7561
Copy link
Contributor Author

If I also drop vscode-java and vscode-java-debug from the extensionDependencies, it takes even less time to reach the project generation from rootless mode.

This suggests to me that VS Code waits for the promise that activate() returns to resolve before starting extensions that depend on an extension. This is a reasonable behaviour, because we want to guarantee eg. that the language server is ready before we try to use it. Unfortunately, this means that we can't start these extensions in parallel. Maybe we could investigate exiting activate() as soon as possible in vscode-java, vscode-microprofile, etc. and export a separate API for detecting when the extension has completed its initialization. This method would allow us to start the language servers in parallel, while still being able to use the built-in extension dependency mechanism.

@datho7561
Copy link
Contributor Author

@fbricon Do you think that removing vscode-microprofile as a extension dependency and instead providing a notification to install it in order to support this use case is a good idea?

@fbricon
Copy link
Collaborator

fbricon commented Jun 23, 2021

@fbricon Do you think that removing vscode-microprofile as a extension dependency and instead providing a notification to install it in order to support this use case is a good idea?

Maybe, maybe not. We need to test it thoroughly.

@datho7561
Copy link
Contributor Author

datho7561 commented Aug 16, 2021

I'm leaving this PR as a draft. I think that checking the extension requirements at startup instead of using the built-in VSCode extensionDependencies mechanism is the correct approach. In order to complete the PR, the dependency on redhat.vscode-java and vscjava.vscode-java-debug should also be removed from the package.json and checked during runtime before doing anything that requires JDT-LS. This should prevent JDT-LS from starting until its needed, saving a lot of time and system resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate running Quarkus project generator without waiting for Java extension
2 participants