Skip to content

Commit 46acbec

Browse files
Fix rust highlight query parser compatibility
1 parent d05ad0b commit 46acbec

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

extensions/rust/highlights.scm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
; Assume all-caps names are constants
1010
((identifier) @constant
11-
(#match? @constant "^[A-Z][A-Z\\d_]+$'"))
11+
(#match? @constant "^[A-Z][A-Z\\d_]+$"))
1212

1313
; Assume uppercase names are enum constructors
1414
((identifier) @constructor
@@ -70,8 +70,10 @@
7070
(line_comment) @comment
7171
(block_comment) @comment
7272

73-
(line_comment (doc_comment)) @comment.documentation
74-
(block_comment (doc_comment)) @comment.documentation
73+
((line_comment) @comment.documentation
74+
(#match? @comment.documentation "^///|^//!"))
75+
((block_comment) @comment.documentation
76+
(#match? @comment.documentation "^/\\*\\*|^/\\*!"))
7577

7678
"(" @punctuation.bracket
7779
")" @punctuation.bracket

0 commit comments

Comments
 (0)