2024-01-06 15:05:50 +09:00
|
|
|
; Forked from tree-sitter-go
|
|
|
|
|
; Copyright (c) 2014 Max Brunsfeld (The MIT License)
|
|
|
|
|
;
|
2020-07-22 08:52:53 +00:00
|
|
|
; Identifiers
|
|
|
|
|
(type_identifier) @type
|
2024-01-06 15:05:50 +09:00
|
|
|
|
|
|
|
|
(type_spec
|
|
|
|
|
name: (type_identifier) @type.definition)
|
|
|
|
|
|
2020-07-22 08:52:53 +00:00
|
|
|
(field_identifier) @property
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2020-07-22 08:52:53 +00:00
|
|
|
(identifier) @variable
|
2024-01-06 15:05:50 +09:00
|
|
|
|
feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.
Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.
Specifically:
* tree-sitter "standard capture names"
(https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72):
- `@parameter` -> `@variable.parameter`
- `@field` -> `@variable.member`
- `@namespace` -> `@module`
- `@float` -> `@number.float`
- `@symbol` -> `@string.special.symbol`
- `@string.regex` -> `@string.regexp`
- `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
- `@text.title` -> `@markup.heading`
- `@text.literal` -> `@markup.raw`
- `@text.reference` -> `@markup.link`
- `@text.uri` -> `@markup.link.url` (in markup links)
- `@string.special` -> `@markup.link.label` (non-url links)
- `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)
* Helix captures
(https://docs.helix-editor.com/master/themes.html#syntax-highlighting):
- `@method` -> `@function.method`
- `@method.call` -> `@function.method.call`
- `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
- `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
- `@text.uri` -> `@string.special.url` (outside markup)
- `@preproc` -> `@keyword.directive`
- `@define` -> `@keyword.directive`(`.define`?)
- `@storageclass` -> `@keyword.storage`
- `@conditional` -> `@keyword.conditional`
- `@debug` -> `@keyword.debug`
- `@exception` -> `@keyword.exception`
- `@include` -> `@keyword.import`
- `@repeat` -> `@keyword.repeat`
* cleanup
- remove some redundant `@conceal` (but still allow it for conceal-only patterns)
- remove obsolete `@error` (syntax linting is out of scope for this repo)
- sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
|
|
|
(package_identifier) @module
|
2020-07-22 08:52:53 +00:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(parameter_declaration
|
|
|
|
|
(identifier) @variable.parameter)
|
|
|
|
|
|
|
|
|
|
(variadic_parameter_declaration
|
|
|
|
|
(identifier) @variable.parameter)
|
2020-07-22 08:52:53 +00:00
|
|
|
|
2022-12-04 06:52:46 +01:00
|
|
|
(label_name) @label
|
|
|
|
|
|
2021-04-07 12:16:01 +02:00
|
|
|
(const_spec
|
|
|
|
|
name: (identifier) @constant)
|
|
|
|
|
|
2020-05-31 23:32:08 +02:00
|
|
|
; Function calls
|
|
|
|
|
(call_expression
|
2022-07-25 13:51:57 -03:00
|
|
|
function: (identifier) @function.call)
|
2020-05-31 23:32:08 +02:00
|
|
|
|
|
|
|
|
(call_expression
|
2024-03-21 20:44:35 +09:00
|
|
|
function: (selector_expression
|
|
|
|
|
field: (field_identifier) @function.method.call))
|
2020-05-31 23:32:08 +02:00
|
|
|
|
|
|
|
|
; Function definitions
|
|
|
|
|
(function_declaration
|
|
|
|
|
name: (identifier) @function)
|
|
|
|
|
|
|
|
|
|
(method_declaration
|
feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.
Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.
Specifically:
* tree-sitter "standard capture names"
(https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72):
- `@parameter` -> `@variable.parameter`
- `@field` -> `@variable.member`
- `@namespace` -> `@module`
- `@float` -> `@number.float`
- `@symbol` -> `@string.special.symbol`
- `@string.regex` -> `@string.regexp`
- `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
- `@text.title` -> `@markup.heading`
- `@text.literal` -> `@markup.raw`
- `@text.reference` -> `@markup.link`
- `@text.uri` -> `@markup.link.url` (in markup links)
- `@string.special` -> `@markup.link.label` (non-url links)
- `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)
* Helix captures
(https://docs.helix-editor.com/master/themes.html#syntax-highlighting):
- `@method` -> `@function.method`
- `@method.call` -> `@function.method.call`
- `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
- `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
- `@text.uri` -> `@string.special.url` (outside markup)
- `@preproc` -> `@keyword.directive`
- `@define` -> `@keyword.directive`(`.define`?)
- `@storageclass` -> `@keyword.storage`
- `@conditional` -> `@keyword.conditional`
- `@debug` -> `@keyword.debug`
- `@exception` -> `@keyword.exception`
- `@include` -> `@keyword.import`
- `@repeat` -> `@keyword.repeat`
* cleanup
- remove some redundant `@conceal` (but still allow it for conceal-only patterns)
- remove obsolete `@error` (syntax linting is out of scope for this repo)
- sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
|
|
|
name: (field_identifier) @function.method)
|
2020-05-31 23:32:08 +02:00
|
|
|
|
2024-04-08 12:30:54 -04:00
|
|
|
(method_elem
|
feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.
Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.
Specifically:
* tree-sitter "standard capture names"
(https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72):
- `@parameter` -> `@variable.parameter`
- `@field` -> `@variable.member`
- `@namespace` -> `@module`
- `@float` -> `@number.float`
- `@symbol` -> `@string.special.symbol`
- `@string.regex` -> `@string.regexp`
- `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
- `@text.title` -> `@markup.heading`
- `@text.literal` -> `@markup.raw`
- `@text.reference` -> `@markup.link`
- `@text.uri` -> `@markup.link.url` (in markup links)
- `@string.special` -> `@markup.link.label` (non-url links)
- `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)
* Helix captures
(https://docs.helix-editor.com/master/themes.html#syntax-highlighting):
- `@method` -> `@function.method`
- `@method.call` -> `@function.method.call`
- `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
- `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
- `@text.uri` -> `@string.special.url` (outside markup)
- `@preproc` -> `@keyword.directive`
- `@define` -> `@keyword.directive`(`.define`?)
- `@storageclass` -> `@keyword.storage`
- `@conditional` -> `@keyword.conditional`
- `@debug` -> `@keyword.debug`
- `@exception` -> `@keyword.exception`
- `@include` -> `@keyword.import`
- `@repeat` -> `@keyword.repeat`
* cleanup
- remove some redundant `@conceal` (but still allow it for conceal-only patterns)
- remove obsolete `@error` (syntax linting is out of scope for this repo)
- sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
|
|
|
name: (field_identifier) @function.method)
|
2022-07-09 14:35:10 +03:00
|
|
|
|
2023-05-01 00:20:51 -04:00
|
|
|
; Constructors
|
2024-01-06 15:05:50 +09:00
|
|
|
((call_expression
|
|
|
|
|
(identifier) @constructor)
|
2023-05-01 00:20:51 -04:00
|
|
|
(#lua-match? @constructor "^[nN]ew.+$"))
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
((call_expression
|
|
|
|
|
(identifier) @constructor)
|
2023-05-01 00:20:51 -04:00
|
|
|
(#lua-match? @constructor "^[mM]ake.+$"))
|
|
|
|
|
|
2020-05-31 23:32:08 +02:00
|
|
|
; Operators
|
2021-06-22 00:34:11 +02:00
|
|
|
[
|
|
|
|
|
"--"
|
|
|
|
|
"-"
|
|
|
|
|
"-="
|
|
|
|
|
":="
|
|
|
|
|
"!"
|
|
|
|
|
"!="
|
|
|
|
|
"..."
|
|
|
|
|
"*"
|
|
|
|
|
"*="
|
|
|
|
|
"/"
|
|
|
|
|
"/="
|
|
|
|
|
"&"
|
|
|
|
|
"&&"
|
|
|
|
|
"&="
|
2023-05-20 12:26:24 +03:30
|
|
|
"&^"
|
|
|
|
|
"&^="
|
2021-06-22 00:34:11 +02:00
|
|
|
"%"
|
|
|
|
|
"%="
|
|
|
|
|
"^"
|
|
|
|
|
"^="
|
|
|
|
|
"+"
|
|
|
|
|
"++"
|
|
|
|
|
"+="
|
|
|
|
|
"<-"
|
|
|
|
|
"<"
|
|
|
|
|
"<<"
|
|
|
|
|
"<<="
|
|
|
|
|
"<="
|
|
|
|
|
"="
|
|
|
|
|
"=="
|
|
|
|
|
">"
|
|
|
|
|
">="
|
|
|
|
|
">>"
|
|
|
|
|
">>="
|
|
|
|
|
"|"
|
|
|
|
|
"|="
|
|
|
|
|
"||"
|
2022-01-06 20:41:32 +01:00
|
|
|
"~"
|
2021-06-22 00:34:11 +02:00
|
|
|
] @operator
|
2020-05-31 23:32:08 +02:00
|
|
|
|
|
|
|
|
; Keywords
|
2021-06-22 00:34:11 +02:00
|
|
|
[
|
|
|
|
|
"break"
|
|
|
|
|
"const"
|
|
|
|
|
"continue"
|
|
|
|
|
"default"
|
|
|
|
|
"defer"
|
|
|
|
|
"goto"
|
|
|
|
|
"range"
|
|
|
|
|
"select"
|
|
|
|
|
"var"
|
|
|
|
|
"fallthrough"
|
|
|
|
|
] @keyword
|
|
|
|
|
|
2024-04-23 12:23:15 -07:00
|
|
|
[
|
|
|
|
|
"type"
|
|
|
|
|
"struct"
|
|
|
|
|
"interface"
|
|
|
|
|
] @keyword.type
|
|
|
|
|
|
2021-07-05 15:04:42 -05:00
|
|
|
"func" @keyword.function
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2021-07-04 20:24:25 +03:00
|
|
|
"return" @keyword.return
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-05-20 12:26:24 +03:30
|
|
|
"go" @keyword.coroutine
|
2021-07-04 19:55:59 +03:00
|
|
|
|
feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.
Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.
Specifically:
* tree-sitter "standard capture names"
(https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72):
- `@parameter` -> `@variable.parameter`
- `@field` -> `@variable.member`
- `@namespace` -> `@module`
- `@float` -> `@number.float`
- `@symbol` -> `@string.special.symbol`
- `@string.regex` -> `@string.regexp`
- `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
- `@text.title` -> `@markup.heading`
- `@text.literal` -> `@markup.raw`
- `@text.reference` -> `@markup.link`
- `@text.uri` -> `@markup.link.url` (in markup links)
- `@string.special` -> `@markup.link.label` (non-url links)
- `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)
* Helix captures
(https://docs.helix-editor.com/master/themes.html#syntax-highlighting):
- `@method` -> `@function.method`
- `@method.call` -> `@function.method.call`
- `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
- `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
- `@text.uri` -> `@string.special.url` (outside markup)
- `@preproc` -> `@keyword.directive`
- `@define` -> `@keyword.directive`(`.define`?)
- `@storageclass` -> `@keyword.storage`
- `@conditional` -> `@keyword.conditional`
- `@debug` -> `@keyword.debug`
- `@exception` -> `@keyword.exception`
- `@include` -> `@keyword.import`
- `@repeat` -> `@keyword.repeat`
* cleanup
- remove some redundant `@conceal` (but still allow it for conceal-only patterns)
- remove obsolete `@error` (syntax linting is out of scope for this repo)
- sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
|
|
|
"for" @keyword.repeat
|
2021-06-22 00:34:11 +02:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"import"
|
|
|
|
|
"package"
|
feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.
Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.
Specifically:
* tree-sitter "standard capture names"
(https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72):
- `@parameter` -> `@variable.parameter`
- `@field` -> `@variable.member`
- `@namespace` -> `@module`
- `@float` -> `@number.float`
- `@symbol` -> `@string.special.symbol`
- `@string.regex` -> `@string.regexp`
- `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
- `@text.title` -> `@markup.heading`
- `@text.literal` -> `@markup.raw`
- `@text.reference` -> `@markup.link`
- `@text.uri` -> `@markup.link.url` (in markup links)
- `@string.special` -> `@markup.link.label` (non-url links)
- `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)
* Helix captures
(https://docs.helix-editor.com/master/themes.html#syntax-highlighting):
- `@method` -> `@function.method`
- `@method.call` -> `@function.method.call`
- `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
- `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
- `@text.uri` -> `@string.special.url` (outside markup)
- `@preproc` -> `@keyword.directive`
- `@define` -> `@keyword.directive`(`.define`?)
- `@storageclass` -> `@keyword.storage`
- `@conditional` -> `@keyword.conditional`
- `@debug` -> `@keyword.debug`
- `@exception` -> `@keyword.exception`
- `@include` -> `@keyword.import`
- `@repeat` -> `@keyword.repeat`
* cleanup
- remove some redundant `@conceal` (but still allow it for conceal-only patterns)
- remove obsolete `@error` (syntax linting is out of scope for this repo)
- sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
|
|
|
] @keyword.import
|
2021-06-22 00:34:11 +02:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"else"
|
|
|
|
|
"case"
|
|
|
|
|
"switch"
|
|
|
|
|
"if"
|
2024-01-06 15:05:50 +09:00
|
|
|
] @keyword.conditional
|
2021-03-16 23:20:06 +09:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Builtin types
|
|
|
|
|
[
|
|
|
|
|
"chan"
|
|
|
|
|
"map"
|
|
|
|
|
] @type.builtin
|
2023-05-30 00:09:37 -04:00
|
|
|
|
2021-03-19 19:03:57 +09:00
|
|
|
((type_identifier) @type.builtin
|
2024-02-23 17:42:01 +09:00
|
|
|
(#any-of? @type.builtin
|
|
|
|
|
"any" "bool" "byte" "comparable" "complex128" "complex64" "error" "float32" "float64" "int"
|
|
|
|
|
"int16" "int32" "int64" "int8" "rune" "string" "uint" "uint16" "uint32" "uint64" "uint8"
|
|
|
|
|
"uintptr"))
|
2021-03-16 23:20:06 +09:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Builtin functions
|
2021-03-16 23:20:06 +09:00
|
|
|
((identifier) @function.builtin
|
2024-02-23 17:42:01 +09:00
|
|
|
(#any-of? @function.builtin
|
|
|
|
|
"append" "cap" "clear" "close" "complex" "copy" "delete" "imag" "len" "make" "max" "min" "new"
|
|
|
|
|
"panic" "print" "println" "real" "recover"))
|
2021-03-16 23:20:06 +09:00
|
|
|
|
2020-05-31 23:32:08 +02:00
|
|
|
; Delimiters
|
|
|
|
|
"." @punctuation.delimiter
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2020-05-31 23:32:08 +02:00
|
|
|
"," @punctuation.delimiter
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2020-05-31 23:32:08 +02:00
|
|
|
":" @punctuation.delimiter
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2020-05-31 23:32:08 +02:00
|
|
|
";" @punctuation.delimiter
|
|
|
|
|
|
|
|
|
|
"(" @punctuation.bracket
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2020-05-31 23:32:08 +02:00
|
|
|
")" @punctuation.bracket
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2020-05-31 23:32:08 +02:00
|
|
|
"{" @punctuation.bracket
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2020-05-31 23:32:08 +02:00
|
|
|
"}" @punctuation.bracket
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2020-05-31 23:32:08 +02:00
|
|
|
"[" @punctuation.bracket
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
"]" @punctuation.bracket
|
2020-05-31 23:32:08 +02:00
|
|
|
|
|
|
|
|
; Literals
|
|
|
|
|
(interpreted_string_literal) @string
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-08-07 15:20:09 +02:00
|
|
|
(raw_string_literal) @string
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2020-05-31 23:32:08 +02:00
|
|
|
(rune_literal) @string
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2020-09-07 18:14:54 +02:00
|
|
|
(escape_sequence) @string.escape
|
2020-05-31 23:32:08 +02:00
|
|
|
|
|
|
|
|
(int_literal) @number
|
2024-01-06 15:05:50 +09:00
|
|
|
|
feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.
Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.
Specifically:
* tree-sitter "standard capture names"
(https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72):
- `@parameter` -> `@variable.parameter`
- `@field` -> `@variable.member`
- `@namespace` -> `@module`
- `@float` -> `@number.float`
- `@symbol` -> `@string.special.symbol`
- `@string.regex` -> `@string.regexp`
- `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
- `@text.title` -> `@markup.heading`
- `@text.literal` -> `@markup.raw`
- `@text.reference` -> `@markup.link`
- `@text.uri` -> `@markup.link.url` (in markup links)
- `@string.special` -> `@markup.link.label` (non-url links)
- `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)
* Helix captures
(https://docs.helix-editor.com/master/themes.html#syntax-highlighting):
- `@method` -> `@function.method`
- `@method.call` -> `@function.method.call`
- `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
- `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
- `@text.uri` -> `@string.special.url` (outside markup)
- `@preproc` -> `@keyword.directive`
- `@define` -> `@keyword.directive`(`.define`?)
- `@storageclass` -> `@keyword.storage`
- `@conditional` -> `@keyword.conditional`
- `@debug` -> `@keyword.debug`
- `@exception` -> `@keyword.exception`
- `@include` -> `@keyword.import`
- `@repeat` -> `@keyword.repeat`
* cleanup
- remove some redundant `@conceal` (but still allow it for conceal-only patterns)
- remove obsolete `@error` (syntax linting is out of scope for this repo)
- sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
|
|
|
(float_literal) @number.float
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2020-05-31 23:32:08 +02:00
|
|
|
(imaginary_literal) @number
|
|
|
|
|
|
2023-03-02 08:06:35 -05:00
|
|
|
[
|
2024-01-06 15:05:50 +09:00
|
|
|
(true)
|
|
|
|
|
(false)
|
2023-03-02 08:06:35 -05:00
|
|
|
] @boolean
|
|
|
|
|
|
2023-05-20 12:26:24 +03:30
|
|
|
[
|
2024-01-06 15:05:50 +09:00
|
|
|
(nil)
|
|
|
|
|
(iota)
|
2023-05-20 12:26:24 +03:30
|
|
|
] @constant.builtin
|
2020-05-31 23:32:08 +02:00
|
|
|
|
2022-07-02 11:07:53 +02:00
|
|
|
(keyed_element
|
2024-01-06 15:05:50 +09:00
|
|
|
.
|
|
|
|
|
(literal_element
|
|
|
|
|
(identifier) @variable.member))
|
2022-07-02 11:07:53 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(field_declaration
|
|
|
|
|
name: (field_identifier) @variable.member)
|
2023-03-02 08:06:35 -05:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Comments
|
2022-09-26 10:19:02 +01:00
|
|
|
(comment) @comment @spell
|
2020-05-31 23:32:08 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Doc Comments
|
|
|
|
|
(source_file
|
|
|
|
|
.
|
|
|
|
|
(comment)+ @comment.documentation)
|
2023-03-02 08:06:35 -05:00
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
|
(comment)+ @comment.documentation
|
2024-01-06 15:05:50 +09:00
|
|
|
.
|
|
|
|
|
(const_declaration))
|
2023-03-02 08:06:35 -05:00
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
|
(comment)+ @comment.documentation
|
2024-01-06 15:05:50 +09:00
|
|
|
.
|
|
|
|
|
(function_declaration))
|
2023-03-02 08:06:35 -05:00
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
|
(comment)+ @comment.documentation
|
2024-01-06 15:05:50 +09:00
|
|
|
.
|
|
|
|
|
(type_declaration))
|
2023-03-02 08:06:35 -05:00
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
|
(comment)+ @comment.documentation
|
2024-01-06 15:05:50 +09:00
|
|
|
.
|
|
|
|
|
(var_declaration))
|
2023-03-02 08:06:35 -05:00
|
|
|
|
|
|
|
|
; Spell
|
2022-09-06 11:56:27 +01:00
|
|
|
((interpreted_string_literal) @spell
|
2023-03-02 08:06:35 -05:00
|
|
|
(#not-has-parent? @spell import_spec))
|
2024-12-14 19:51:37 -08:00
|
|
|
|
|
|
|
|
; Regex
|
|
|
|
|
(call_expression
|
|
|
|
|
(selector_expression) @_function
|
|
|
|
|
(#any-of? @_function
|
|
|
|
|
"regexp.Match" "regexp.MatchReader" "regexp.MatchString" "regexp.Compile" "regexp.CompilePOSIX"
|
|
|
|
|
"regexp.MustCompile" "regexp.MustCompilePOSIX")
|
|
|
|
|
(argument_list
|
|
|
|
|
.
|
|
|
|
|
[
|
|
|
|
|
(raw_string_literal
|
|
|
|
|
(raw_string_literal_content) @string.regexp)
|
|
|
|
|
(interpreted_string_literal
|
|
|
|
|
(interpreted_string_literal_content) @string.regexp)
|
|
|
|
|
]))
|