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 go locals query for var_spec identifiers #6763

Merged
merged 1 commit into from
Apr 16, 2023

Conversation

mtoohey31
Copy link
Contributor

This pull request makes a tiny fix to the var_spec locals query for Go. The existing query makes use of the "name" field, but when there are multiple variables in the same declaration, only the first gets captured. It's fine for us to not specify the field, because if a type or a value is provided, any identifier nodes within them either have a different name such as type_identifier, or they're nested within a further sub-expression. Below are some screenshots showing the change, and the edge cases that I considered, which seem to be handled correctly with the updated query:

  • before (b is not recognized as a local):
    2023-04-15T00:56:57,614124292-04:00
  • after (b is recognized as a local):
    2023-04-15T00:57:08,485659065-04:00
  • after, with a type identifier (c is not recognized as local):
    2023-04-15T00:57:19,085946770-04:00
  • after, with assigned value identifiers (c is not recognized as local):
    2023-04-15T00:57:34,326121245-04:00

@the-mikedavis the-mikedavis added the A-language-support Area: Support for programming/text languages label Apr 16, 2023
@pascalkuthe pascalkuthe merged commit 99a8b61 into helix-editor:master Apr 16, 2023
@mtoohey31 mtoohey31 deleted the fix/go-var-spec-locals branch April 16, 2023 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants