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

TriggerKind is always TriggerCharacter if char is on completionTriggerChars list #794

Closed
zulus opened this issue Sep 11, 2023 · 8 comments · Fixed by #798
Closed

TriggerKind is always TriggerCharacter if char is on completionTriggerChars list #794

zulus opened this issue Sep 11, 2023 · 8 comments · Fixed by #798

Comments

@zulus
Copy link
Contributor

zulus commented Sep 11, 2023

During work eclipse-wildwebdeveloper/wildwebdeveloper#1316 I realized that LSP4E ignore way how code assist is invoked, and always mark completion computation as TriggerCharacter if character under cursor is inside completionTriggerChars

Also triggerCharacter is always pushed to server, which is also wrong. For TriggerKind.Invoked should be undefined

Bug has been introduced via 7c770c3

@mickaelistria
Copy link
Contributor

@ghentschke Can you please have a look?

@zulus
Copy link
Contributor Author

zulus commented Sep 11, 2023

First problem is complicated because by design IContentAssistProcessor haven't access to ContentAssistEvent, so don't know if it's "auto" or "on-demand". PDT have ugly workaround via separate ContentAssistant implementation.

To fix second problem, should be enough to drop LSPEclipseUtils.toCompletionParams#237 line.

@ghentschke
Copy link
Contributor

I'll check that and provide a PR.

@ghentschke
Copy link
Contributor

To fix second problem, should be enough to drop LSPEclipseUtils.toCompletionParams#237 line

I am not sure if a line drop is right in this situation. I think an empty String as positionCharacter would be better. What does undefined mean in the TriggerKind.Invoked context?

by design IContentAssistProcessor haven't access to ContentAssistEvent, so don't know if it's "auto" or "on-demand"

@zulus What is your expected behavior here? Does on-demand means CompletionTriggerKind.TriggerCharacter? What is the link between the CompletionTriggerKind and ContentAssistEvent?

ghentschke added a commit to ghentschke/lsp4e-bachmann-fixes that referenced this issue Sep 12, 2023
triggerCharacter won't be send via json rpc in case of
TriggerKind.Invoked: "context":{"triggerKind":1}

fixes eclipse-lsp4e#794
ghentschke added a commit to ghentschke/lsp4e-bachmann-fixes that referenced this issue Sep 12, 2023
triggerCharacter won't be send via json rpc in case of
TriggerKind.Invoked: "context":{"triggerKind":1}

fixes eclipse-lsp4e#794
@rubenporras
Copy link
Contributor

@zulus , @ghentschke , any chance you could have time to improve the eclipse platform so that LSP4E can reliably know if the content assist has been manually invoked or automatically triggered?

rubenporras pushed a commit that referenced this issue Sep 12, 2023
* Fix undefined triggerCharacter for TriggerKind.Invoked

triggerCharacter won't be send via json rpc in case of
TriggerKind.Invoked: "context":{"triggerKind":1}

fixes #794

* Use CompletionContext single argument constructor
@ghentschke
Copy link
Contributor

Also triggerCharacter is always pushed to server, which is also wrong. For TriggerKind.Invoked should be undefined

Fixed by #798

@ghentschke
Copy link
Contributor

and always mark completion computation as TriggerCharacter if character under cursor is inside completionTriggerChars

@zulus can you please open a new issue for this topic.

@zulus
Copy link
Contributor Author

zulus commented Sep 12, 2023

@zulus can you please open a new issue for this topic.

Done, see #799

@zulus What is your expected behavior here? Does on-demand means CompletionTriggerKind.TriggerCharacter? What is the link between the CompletionTriggerKind and ContentAssistEvent?

I've added extra info to #799

I'll check that and provide a PR.

Thx for second problem PR, VUE component inside WWD have now much better auto-completion

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.

4 participants