Skip to content

Commit

Permalink
[language-go] Update tree-sitter-go parser to latest…
Browse files Browse the repository at this point in the history
…and include some highlighting fixes from #869.
  • Loading branch information
savetheclocktower committed Jan 18, 2024
1 parent 0030671 commit 677fbb1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/language-go/grammars/modern-tree-sitter-go.cson
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ comments:
start: '// '

treeSitter:
parserSource: 'github:tree-sitter/tree-sitter-go#ff86c7f1734873c8c4874ca4dd95603695686d7a'
grammar: 'tree-sitter-go/tree-sitter-go.wasm'
highlightsQuery: 'tree-sitter-go/highlights.scm'
foldsQuery: 'tree-sitter-go/folds.scm'
Expand Down
12 changes: 8 additions & 4 deletions packages/language-go/grammars/tree-sitter-go/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@

[
"struct"
"interface"
"map"
] @storage.type._TYPE_.go

(struct_type
Expand All @@ -55,13 +57,14 @@
(field_identifier) @entity.other.attribute-name.go)))

(keyed_element
(field_identifier) @entity.other.attribute-name.go
.
":" @punctuation.separator.key-value.go)
. (literal_element) @entity.other.attribute-name.go)

(keyed_element ":" @punctuation.separator.key-value.go)

[
"break"
"case"
"chan"
"continue"
"default"
"defer"
Expand Down Expand Up @@ -252,7 +255,8 @@

";" @punctuation.terminator.go
"," @punctuation.separator.comma.go
":" @punctuation.separator.colon.go
(":" @punctuation.separator.colon.go
(#set! capture.shy))

(parameter_list
"(" @punctuation.definition.parameters.begin.bracket.round.go
Expand Down
Binary file modified packages/language-go/grammars/tree-sitter-go/tree-sitter-go.wasm
Binary file not shown.

0 comments on commit 677fbb1

Please sign in to comment.