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

Code snippet should be working before LS done resolving Maven dependencies #684

Closed
akaroml opened this issue Oct 22, 2018 · 6 comments · Fixed by #2240
Closed

Code snippet should be working before LS done resolving Maven dependencies #684

akaroml opened this issue Oct 22, 2018 · 6 comments · Fixed by #2240
Assignees

Comments

@akaroml
Copy link
Contributor

akaroml commented Oct 22, 2018

Maven dependencies take lots of time to resolve.
image

At that moment, LS is not responding to user key strokes. But some of the features like code snippet can acutally work. The idea is to enable some language servers before the project is completely loaded. Code snippet can be a good start because it require less project context. For example, the public_method does not require project context but only the surrounding class.

@yaohaizh
Copy link
Collaborator

@akaroml For vscode java, there are two types of code snipeets: Client snippet such as main and server snippet. For client snippet, it will always work no matter the language server is ready or not. public_method should be client snippet and should be ready before LS ready.

@jdneo
Copy link
Collaborator

jdneo commented Nov 17, 2021

As for now the client snippet will always work and the server snippet will update to the list once server is ready. This issue can be closed. @testforstephen @rgrunber

@rgrunber
Copy link
Member

rgrunber commented Nov 22, 2021

The client side snippets don't always work for me. For a Maven project (eg. spring-petclinic), the snippets resolve initially, but as soon as the project import begins (standard LS as show in the screenshot), the completion no longer responds until after the build is completed, which can take a bit of time. Seems like this is still an issue.

@jdneo
Copy link
Collaborator

jdneo commented Nov 23, 2021

Yes I can also repro it. Put a breakpoint at

return snippetItems;
. It actually returns the snippets but for some unknown reason, VS Code does not display them. Let me investigate what's happening.

@rgrunber
Copy link
Member

rgrunber commented Dec 7, 2021

I'm not sure if something has changed since trying out this PR, but the behaviour is a bit different for me now. This is without the PR attached.

  • When I load spring-petclinic (no existing workspace for it), I see only the snippets immediately. There's a brief period where I only see dictionary/spelling suggestions but I suspect as soon as the extension starts the snippets take over
  • After a certain point I also see completions like args : String [], main(String [] args) : void, PetClinicApplcation. I'm guessing this is when the syntax server starts
  • Some time later I see !MESSAGE Workspace initialized in ...ms in the logs and the standard language server's Started notification is received by the client
  • If I trigger completion here, there's a brief moment for which there is no response. After this, I begin seeing a duplicate completion items. I'm guessing the extra one is from the newly started standard language server
  • Beyond this point, once the standard server sends "ServiceReady" to the client (after the build jobs finishes), the syntax server shuts down, and I begin seeing only one set of completions

@jdneo
Copy link
Collaborator

jdneo commented Dec 8, 2021

@rgrunber The PR #2240 should solve the issue you mentioned here.

If I remember correctly, we only have Started as the end of initialization previously. ServiceReady is been added later. Previously the client side snippet will be deactivated when Started notification is received.

I begin seeing a duplicate completion items. I'm guessing the extra one is from the newly started standard language server
Previously, we just let the snippet provider return an empty array to make it deactivated. So all the completion items that provided by it are still visible in the list. Now in #2240, the provider will be disposed, and VS Code will remove them from the list so #2240 should fix this issue as well.

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

Successfully merging a pull request may close this issue.

5 participants