Unnamed repository; edit this file 'description' to name the repository.
languages.toml: update tree-sitter-rust to latest (#14548)
may 4 months ago
parent 282345c · commit c664b84
-rw-r--r--languages.toml2
-rw-r--r--runtime/queries/rust/highlights.scm11
2 files changed, 3 insertions, 10 deletions
diff --git a/languages.toml b/languages.toml
index 411bc07a..eff6a2b4 100644
--- a/languages.toml
+++ b/languages.toml
@@ -344,7 +344,7 @@ args = { attachCommands = [ "platform select remote-gdb-server", "platform conne
[[grammar]]
name = "rust"
-source = { git = "https://github.com/tree-sitter/tree-sitter-rust", rev = "1f63b33efee17e833e0ea29266dd3d713e27e321" }
+source = { git = "https://github.com/tree-sitter/tree-sitter-rust", rev = "261b20226c04ef601adbdf185a800512a5f66291" }
[[language]]
name = "sway"
diff --git a/runtime/queries/rust/highlights.scm b/runtime/queries/rust/highlights.scm
index 3a4448ba..cc8380cb 100644
--- a/runtime/queries/rust/highlights.scm
+++ b/runtime/queries/rust/highlights.scm
@@ -79,11 +79,7 @@
; Types
; -------
-(type_parameters
- (type_identifier) @type.parameter)
-(constrained_type_parameter
- left: (type_identifier) @type.parameter)
-(optional_type_parameter
+(type_parameter
name: (type_identifier) @type.parameter)
((type_arguments (type_identifier) @constant)
(#match? @constant "^[A-Z_]+$"))
@@ -116,6 +112,7 @@
; Comments
; -------
+(shebang) @comment
(line_comment) @comment.line
(block_comment) @comment.block
@@ -243,10 +240,6 @@
(type_cast_expression "as" @keyword.operator)
-((generic_type
- type: (type_identifier) @keyword)
- (#eq? @keyword "use"))
-
[
(crate)
(super)