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

Oversight in multi-file LocationLink #160522

Closed
RedCMD opened this issue Sep 9, 2022 · 1 comment
Closed

Oversight in multi-file LocationLink #160522

RedCMD opened this issue Sep 9, 2022 · 1 comment
Assignees
Labels
*dev-question VS Code Extension Development Question

Comments

@RedCMD
Copy link
Contributor

RedCMD commented Sep 9, 2022

LocationLink specifies: originSelectionRange?, targetUri, targetRange and targetSelectionRange?

The issue is that targetRange and originSelectionRange could be in different files
But LocationLink only allows one instance of a uri

For example if the definition of a function is in one file and a reference is in another (ctrl+clicking the ref to jump to the def)
I can only specify the ranges for one file (the definition file)
This leaves vscode to default to the language's wordPattern for originSelectionRange
which gives a bad ctrl+click underline range

(changing the wordPattern is not an option as it is not context aware, and it messes with other features)

Definition in same file: (correct behaviour)
image

Definition in different file: (wrong behaviour)
image

I would suggest allowing a location alteration for originSelectionRange and/or targetSelectionRange & targetRange
image

@jrieken
Copy link
Member

jrieken commented Sep 13, 2022

The issue is that targetRange and originSelectionRange could be in different files

The originSelectionRange is always relative to the model and position for which the current request is made. E.g go to def is invoked for file A at position X and originSelectionRange must contain X and is (by its definition) in file A

@jrieken jrieken closed this as completed Sep 13, 2022
@jrieken jrieken added the *dev-question VS Code Extension Development Question label Sep 13, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*dev-question VS Code Extension Development Question
Projects
None yet
Development

No branches or pull requests

4 participants