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

onDefinition handler is not called when onHover handler is #1383

Open
LordOfDragons opened this issue Dec 14, 2023 · 5 comments
Open

onDefinition handler is not called when onHover handler is #1383

LordOfDragons opened this issue Dec 14, 2023 · 5 comments
Labels
info-needed Issue requires more information from poster

Comments

@LordOfDragons
Copy link

I'm writing a language server. I've got so far setting up symbols, context (range) determination and hovering working. The definition provider is basically also working but there is a strange problem breaking things.

First the relevant code:

And here the screenshot images referenced below:
vscode_lang_server_onDefinition

Image (1) is the test code the language server is applied to.
Image (2) is onHover called for the toInt() function.
Image (3) is onHover called for the ++ operator.
Image (4) is onDefinition called for the toInt() function.
Image (5) is onDefinition not called for the ++ operator.

The bug is thus image (5). For toInt() function both onHover and onDefinition are called but for the ++ operator only onHover is called and onDefinition is never called. The range is correct since onHover is called for ++. Why does the VSCode Node based language server not call onDefinition for some ranges onHover is called for and not others? Is a different logic used for calling onHover and onDefinition?

@dbaeumer
Copy link
Member

@jrieken although LSP I think this is the default behavior in VS Code. I assume we only call on Definition only on word and not on ++ operator. Is this correct?

@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label Dec 15, 2023
@jrieken
Copy link
Member

jrieken commented Dec 15, 2023

Yes

@LordOfDragons
Copy link
Author

Hm... that's kinda annoying since overloading operators is a common practise in various languages.

@LordOfDragons
Copy link
Author

@jrieken Any plans on changing this in the future?

@dbaeumer
Copy link
Member

dbaeumer commented Jan 8, 2024

@LordOfDragons all I can recommend is to open an issue against VS Code since there is little I can do in the library to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants