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(gazelle): Support parsing files that use Python3.12 PEP 695 (Type Parameter Syntax) by using dougthor42's fork of go-tree-sitter #2496

Merged
merged 6 commits into from
Dec 14, 2024

Conversation

dougthor42
Copy link
Collaborator

Replaces #2413.

Fixes #2396.

This updates the go-tree-sitter dependency to use my fork that includes BUILD.bazel files. Specifically, the BUILD.bazel files in the fork include references to top-level code like array.h which the original Gazelle-generated files for go-tree-sitter were not able to handle. I also include the test cases that @maffoo created in #2413 and verified that they (a) fail before the fix and (b) pass after the fix.

The fork is: https://github.com/dougthor42/go-tree-sitter

The branch that includes all changes is: https://github.com/dougthor42/go-tree-sitter/tree/for-rules-python-gazelle-plugin

A couple notes:

@fmeum
Copy link
Contributor

fmeum commented Dec 11, 2024

If you actually do maintain a fork with proper build files, we shouldn't need a BCR entry. Gazelle does preserve build files if they exist.

Nvm, thought this was in the BCR repo.

Copy link
Collaborator

@aignas aignas left a comment

Choose a reason for hiding this comment

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

Thanks for adding tests!

Whilst I would prefer it to be in BCR, I understand your desire to also cater for WORKSPACE users.

@aignas aignas enabled auto-merge December 12, 2024 00:24
@dougthor42
Copy link
Collaborator Author

Whilst I would prefer it to be in BCR, I understand your desire to also cater for WORKSPACE users.

I mean, I wouldn't say I desire to cater to WORKSPACE users, haha. If we just dropped WORKSPACE support altogether I'd be super happy but I know that wouldn't go over well with some people.

When we do drop WORKSPACE support, then the BCR-based option is indeed the better solution.

@aignas aignas added this pull request to the merge queue Dec 14, 2024
Merged via the queue into bazelbuild:main with commit 15cc0b3 Dec 14, 2024
3 of 4 checks passed
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.

Gazelle seems to not like PEP 695 – Type Parameter Syntax
4 participants