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

Add label parser to the Bazel LSP #101

Closed

Conversation

cameron-martin
Copy link
Contributor

Instead of parsing labels ad-hoc in resolve_folder, this introduces a separate label parser. This allows re-using this when doing a "go to definition" for a label that is not in a load statement. See #100 for more context.

Instead of parsing labels ad-hoc in `resolve_folder`, this introduces a separate label parser. This allows re-using this when doing a "go to definition" for a label that is not in a load statement. See facebook#100 for more context.
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 20, 2023
@facebook-github-bot
Copy link
Contributor

@ndmitchell has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@ndmitchell merged this pull request in 5cc4c37.

facebook-github-bot pushed a commit to facebook/buck2 that referenced this pull request Jan 19, 2024
Summary:
Instead of parsing labels ad-hoc in `resolve_folder`, this introduces a separate label parser. This allows re-using this when doing a "go to definition" for a label that is not in a load statement. See facebook/starlark-rust#100 for more context.

X-link: facebook/starlark-rust#101

Reviewed By: stepancheg

Differential Revision: D52887102

Pulled By: ndmitchell

fbshipit-source-id: e08c07b3d88c24d14030568dcc3ecf33ae8c243c
facebook-github-bot pushed a commit to facebook/buck2 that referenced this pull request Jan 22, 2024
Summary:
When executing "go to definition" on a label, it would previously go to the correct file but not to the definition of that target. This was because we were searching for a function call where the name is the whole label. Now it parses the label, using the label parser introduced in facebook/starlark-rust#101, to extract the name and searches using that.

X-link: facebook/starlark-rust#100

Reviewed By: wendy728

Differential Revision: D52954185

Pulled By: ndmitchell

fbshipit-source-id: 937da257b7441d8abe313015ca1c8241c7967a10
facebook-github-bot pushed a commit that referenced this pull request Jan 22, 2024
Summary:
When executing "go to definition" on a label, it would previously go to the correct file but not to the definition of that target. This was because we were searching for a function call where the name is the whole label. Now it parses the label, using the label parser introduced in #101, to extract the name and searches using that.

Pull Request resolved: #100

Reviewed By: wendy728

Differential Revision: D52954185

Pulled By: ndmitchell

fbshipit-source-id: 937da257b7441d8abe313015ca1c8241c7967a10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants