-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
Extend language API to allow sourceRange in Go to Definition #10037
Comments
This is the link detector / renderer in the editor. The tsserver returns the right result for the definition request. @alexandrudima assuming this is you. Please move back if I am mistaken. |
I think it is a limitation of |
Yes, I am getting the target location and so the link is being created around the word you hover over. We have the same issue in selfhost when hovering over imports too. |
@bpasero You could maybe not use the word but the token? Then it would be the whole string token instead of the string in there? |
@jrieken is there API for me to get this info? I can give it a try 👍 |
Yeah - I believe you use |
I cannot use tokens because some languages return a lot more in a single token compared to what you can click on. For example for a TS thing like I think the lack of token info here was the original reason why we went with words. |
I think this would go well only if the GoToDefinition result would include a |
No language service I know off provides that information. I still believe that tokens are the way to go but 'yes' it does depend on how good/bad those are. If we extend the API to allow for a source range we still need to handle the missing case. |
As of today using tokens is worse than using words :) |
Upstream change from TS to support this: microsoft/TypeScript#19175 |
**Problem** See microsoft#10037 **Proposal** Add a new `SymbolDefinition` class to the VSCode API. This bundles up a location and the span of the defining symbol
Steps to Reproduce:
ctrl + hover - highlighting upto dot character
in the below issue the ctl + hover should highlight gateway.destination.component but it is highlighting only the component alone.
The text was updated successfully, but these errors were encountered: