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

fix: Link the full label / file name instead of individual components #382

Conversation

vogelsgesang
Copy link
Collaborator

So far, the go_to_definition provider did not provide a originSelectionRange. Hence, VS Code was falling back on its internal tokenization to decide which part of the text to provide the HyperLink for.

For the label "my/package:file.txt", we hence linked my, package, file and txt individually, all pointing to the same file.

With this change, we now instead always provide the link on the full label.

Copy link
Collaborator

@cameron-martin cameron-martin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well, thanks!

src/definition/bazel_goto_definition_provider.ts Outdated Show resolved Hide resolved
…t individually

So far, the `go_to_definition` provider did not provide a
`originSelectionRange`. Hence, VS Code was falling back on its internal
tokenization to decide which part of the text to provide the HyperLink
for.

For the label "my/package:file.txt", we hence linked `my`, `package`,
`file` and `txt` individually, all pointing to the same file.

With this change, we now instead always provide the link on the full
label.
@vogelsgesang vogelsgesang force-pushed the avogelsgesang-link-complete-label-name branch from 1e8c8b5 to 527f2d3 Compare April 16, 2024 21:45
@vogelsgesang vogelsgesang merged commit 2e207c9 into bazel-contrib:master Apr 16, 2024
4 checks passed
@vogelsgesang vogelsgesang deleted the avogelsgesang-link-complete-label-name branch April 24, 2024 00:23
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 this pull request may close these issues.

2 participants