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

Update tree-sitter to 0.22.1 #379

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

eed3si9n
Copy link
Collaborator

@eed3si9n eed3si9n commented Mar 10, 2024

Fixes #384

See the tree-sitter release notes for details

tree-sitter now uses last-wins rules for highlighting. This PR updates the highlight queries around to match the older highlighting semantics. Except operator, which I've now let it take precedence over function.call.

@eed3si9n eed3si9n force-pushed the wip/tree-sitter-bump branch 3 times, most recently from 8fd353c to 6464591 Compare March 11, 2024 00:04
@eed3si9n eed3si9n marked this pull request as draft March 11, 2024 00:05
@eed3si9n eed3si9n force-pushed the wip/tree-sitter-bump branch 6 times, most recently from 54c3fde to c018e38 Compare March 11, 2024 14:23
Cargo.toml Outdated
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actual file I changed.

},
"devDependencies": {
"tree-sitter-cli": "0.20.7",
"prettier": "3.0.0-alpha.6"
"tree-sitter-cli": "0.22.1",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think I changed this, and the rest of the change was made automatically.

@@ -6,7 +6,7 @@
//! ```
//! let code = "";
//! let mut parser = tree_sitter::Parser::new();
//! parser.set_language(tree_sitter_scala::language()).expect("Error loading scala grammar");
//! parser.set_language(&tree_sitter_scala::language()).expect("Error loading scala grammar");
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Minor Rust update.

Comment on lines +3 to +7
(field_expression field: (identifier) @property)
(field_expression value: (identifier) @type
(#match? @type "^[A-Z]"))

(type_identifier) @type
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These are now moved up front to deprioritize the match.

@eed3si9n eed3si9n marked this pull request as ready for review March 11, 2024 14:29
tree-sitter now uses last-wins rules for highlighting.
This moves the rules around to match the older highlighting.
Except operator, which I've now let it take precedence over `function.call`.
@eed3si9n eed3si9n marked this pull request as draft March 12, 2024 06:48
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.

Update to tree-sitter 0.22.x?
1 participant