mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 11:20:07 -04:00
Add capture groups for remaining builtin highlight groups
Some builtin highlight groups (see `:h group-name`) do not yet have associated capture groups, so add them.
This commit is contained in:
parent
d0e4b412f9
commit
e2b2d2357b
4 changed files with 63 additions and 0 deletions
|
|
@ -91,8 +91,10 @@ effect on highlighting. We will work on improving highlighting in the near futur
|
||||||
|
|
||||||
```
|
```
|
||||||
@comment
|
@comment
|
||||||
|
@debug
|
||||||
@error for error `ERROR` nodes.
|
@error for error `ERROR` nodes.
|
||||||
@none to disable completely the highlight
|
@none to disable completely the highlight
|
||||||
|
@preproc
|
||||||
@punctuation.delimiter for `;` `.` `,`
|
@punctuation.delimiter for `;` `.` `,`
|
||||||
@punctuation.bracket for `()` or `{}`
|
@punctuation.bracket for `()` or `{}`
|
||||||
@punctuation.special for symbols with special meaning like `{}` in string interpolation.
|
@punctuation.special for symbols with special meaning like `{}` in string interpolation.
|
||||||
|
|
@ -109,6 +111,7 @@ effect on highlighting. We will work on improving highlighting in the near futur
|
||||||
@string.escape
|
@string.escape
|
||||||
@string.special
|
@string.special
|
||||||
@character
|
@character
|
||||||
|
@character.special
|
||||||
@number
|
@number
|
||||||
@boolean
|
@boolean
|
||||||
@float
|
@float
|
||||||
|
|
@ -142,9 +145,12 @@ effect on highlighting. We will work on improving highlighting in the near futur
|
||||||
@operator (for symbolic operators, e.g. `+`, `*`)
|
@operator (for symbolic operators, e.g. `+`, `*`)
|
||||||
@exception (e.g. `throw`, `catch`)
|
@exception (e.g. `throw`, `catch`)
|
||||||
@include keywords for including modules (e.g. import/from in Python)
|
@include keywords for including modules (e.g. import/from in Python)
|
||||||
|
@storageclass
|
||||||
|
|
||||||
@type
|
@type
|
||||||
@type.builtin
|
@type.builtin
|
||||||
|
@type.definition
|
||||||
|
@type.qualifier
|
||||||
@namespace for identifiers referring to namespaces
|
@namespace for identifiers referring to namespaces
|
||||||
@symbol for identifiers referring to symbols
|
@symbol for identifiers referring to symbols
|
||||||
@attribute for e.g. Python decorators
|
@attribute for e.g. Python decorators
|
||||||
|
|
@ -180,6 +186,8 @@ Mainly for markup languages.
|
||||||
@text.note
|
@text.note
|
||||||
@text.warning
|
@text.warning
|
||||||
@text.danger
|
@text.danger
|
||||||
|
|
||||||
|
@todo
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Tags
|
#### Tags
|
||||||
|
|
|
||||||
|
|
@ -490,6 +490,10 @@ Boolean literals: `True` and `False` in Python.
|
||||||
`TSCharacter`
|
`TSCharacter`
|
||||||
Character literals: `'a'` in C.
|
Character literals: `'a'` in C.
|
||||||
|
|
||||||
|
*hl-TSCharacterSpecial*
|
||||||
|
`TSCharacterSpecial`
|
||||||
|
Special characters.
|
||||||
|
|
||||||
*hl-TSComment*
|
*hl-TSComment*
|
||||||
`TSComment`
|
`TSComment`
|
||||||
Line comments and block comments.
|
Line comments and block comments.
|
||||||
|
|
@ -515,6 +519,14 @@ Constants defined by macros: `NULL` in C.
|
||||||
`TSConstructor`
|
`TSConstructor`
|
||||||
Constructor calls and definitions: `{}` in Lua, and Java constructors.
|
Constructor calls and definitions: `{}` in Lua, and Java constructors.
|
||||||
|
|
||||||
|
*hl-TSDebug*
|
||||||
|
`TSDebug`
|
||||||
|
Debugging statements.
|
||||||
|
|
||||||
|
*hl-TSDefine*
|
||||||
|
`TSDefine`
|
||||||
|
Preprocessor #define statements.
|
||||||
|
|
||||||
*hl-TSError*
|
*hl-TSError*
|
||||||
`TSError`
|
`TSError`
|
||||||
Syntax/parser errors. This might highlight large sections of code while the
|
Syntax/parser errors. This might highlight large sections of code while the
|
||||||
|
|
@ -602,6 +614,10 @@ Parameters of a function.
|
||||||
`TSParameterReference`
|
`TSParameterReference`
|
||||||
References to parameters of a function.
|
References to parameters of a function.
|
||||||
|
|
||||||
|
*hl-TSPreProc*
|
||||||
|
`TSPreProc`
|
||||||
|
Preprocessor #if, #else, #endif, etc.
|
||||||
|
|
||||||
*hl-TSProperty*
|
*hl-TSProperty*
|
||||||
`TSProperty`
|
`TSProperty`
|
||||||
Same as `TSField`.
|
Same as `TSField`.
|
||||||
|
|
@ -622,6 +638,11 @@ Special punctuation that doesn't fit into the previous categories.
|
||||||
`TSRepeat`
|
`TSRepeat`
|
||||||
Keywords related to loops: `for`, `while`, etc.
|
Keywords related to loops: `for`, `while`, etc.
|
||||||
|
|
||||||
|
*hl-StorageClass*
|
||||||
|
`TSStorageClass`
|
||||||
|
Keywords that affect how a variable is stored: `static`, `comptime`, `extern`,
|
||||||
|
etc.
|
||||||
|
|
||||||
*hl-TSString*
|
*hl-TSString*
|
||||||
`TSString`
|
`TSString`
|
||||||
String literals.
|
String literals.
|
||||||
|
|
@ -715,6 +736,10 @@ Text representation of a warning note.
|
||||||
`TSDanger`
|
`TSDanger`
|
||||||
Text representation of a danger note.
|
Text representation of a danger note.
|
||||||
|
|
||||||
|
*hl-TSTodo*
|
||||||
|
`TSTodo`
|
||||||
|
Anything that needs extra attention, such as keywords like TODO or FIXME.
|
||||||
|
|
||||||
*hl-TSType*
|
*hl-TSType*
|
||||||
`TSType`
|
`TSType`
|
||||||
Type (and class) definitions and annotations.
|
Type (and class) definitions and annotations.
|
||||||
|
|
@ -723,6 +748,14 @@ Type (and class) definitions and annotations.
|
||||||
`TSTypeBuiltin`
|
`TSTypeBuiltin`
|
||||||
Built-in types: `i32` in Rust.
|
Built-in types: `i32` in Rust.
|
||||||
|
|
||||||
|
*hl-TSTypeQualifier*
|
||||||
|
`TSTypeQualifier`
|
||||||
|
Qualifiers on types, e.g. `const` or `volatile` in C or `mut` in Rust.
|
||||||
|
|
||||||
|
*hl-TSTypeDefinition*
|
||||||
|
`TSTypeDefinition`
|
||||||
|
Type definitions, e.g. `typedef` in C.
|
||||||
|
|
||||||
*hl-TSVariable*
|
*hl-TSVariable*
|
||||||
`TSVariable`
|
`TSVariable`
|
||||||
Variable names that don't fit into other categories.
|
Variable names that don't fit into other categories.
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ hlmap["attribute"] = "TSAttribute"
|
||||||
hlmap["boolean"] = "TSBoolean"
|
hlmap["boolean"] = "TSBoolean"
|
||||||
|
|
||||||
hlmap["character"] = "TSCharacter"
|
hlmap["character"] = "TSCharacter"
|
||||||
|
hlmap["character.special"] = "TSCharacterSpecial"
|
||||||
|
|
||||||
hlmap["comment"] = "TSComment"
|
hlmap["comment"] = "TSComment"
|
||||||
|
|
||||||
|
|
@ -29,6 +30,9 @@ hlmap["constant.macro"] = "TSConstMacro"
|
||||||
|
|
||||||
hlmap["constructor"] = "TSConstructor"
|
hlmap["constructor"] = "TSConstructor"
|
||||||
|
|
||||||
|
hlmap["debug"] = "TSDebug"
|
||||||
|
hlmap["define"] = "TSDefine"
|
||||||
|
|
||||||
hlmap["error"] = "TSError"
|
hlmap["error"] = "TSError"
|
||||||
hlmap["exception"] = "TSException"
|
hlmap["exception"] = "TSException"
|
||||||
|
|
||||||
|
|
@ -61,6 +65,8 @@ hlmap["operator"] = "TSOperator"
|
||||||
hlmap["parameter"] = "TSParameter"
|
hlmap["parameter"] = "TSParameter"
|
||||||
hlmap["parameter.reference"] = "TSParameterReference"
|
hlmap["parameter.reference"] = "TSParameterReference"
|
||||||
|
|
||||||
|
hlmap["preproc"] = "TSPreProc"
|
||||||
|
|
||||||
hlmap["property"] = "TSProperty"
|
hlmap["property"] = "TSProperty"
|
||||||
|
|
||||||
hlmap["punctuation.delimiter"] = "TSPunctDelimiter"
|
hlmap["punctuation.delimiter"] = "TSPunctDelimiter"
|
||||||
|
|
@ -69,6 +75,8 @@ hlmap["punctuation.special"] = "TSPunctSpecial"
|
||||||
|
|
||||||
hlmap["repeat"] = "TSRepeat"
|
hlmap["repeat"] = "TSRepeat"
|
||||||
|
|
||||||
|
hlmap["storageclass"] = "TSStorageClass"
|
||||||
|
|
||||||
hlmap["string"] = "TSString"
|
hlmap["string"] = "TSString"
|
||||||
hlmap["string.regex"] = "TSStringRegex"
|
hlmap["string.regex"] = "TSStringRegex"
|
||||||
hlmap["string.escape"] = "TSStringEscape"
|
hlmap["string.escape"] = "TSStringEscape"
|
||||||
|
|
@ -97,8 +105,12 @@ hlmap["text.note"] = "TSNote"
|
||||||
hlmap["text.warning"] = "TSWarning"
|
hlmap["text.warning"] = "TSWarning"
|
||||||
hlmap["text.danger"] = "TSDanger"
|
hlmap["text.danger"] = "TSDanger"
|
||||||
|
|
||||||
|
hlmap["todo"] = "TSTodo"
|
||||||
|
|
||||||
hlmap["type"] = "TSType"
|
hlmap["type"] = "TSType"
|
||||||
hlmap["type.builtin"] = "TSTypeBuiltin"
|
hlmap["type.builtin"] = "TSTypeBuiltin"
|
||||||
|
hlmap["type.qualifier"] = "TSTypeQualifier"
|
||||||
|
hlmap["type.definition"] = "TSTypeDefinition"
|
||||||
|
|
||||||
hlmap["variable"] = "TSVariable"
|
hlmap["variable"] = "TSVariable"
|
||||||
hlmap["variable.builtin"] = "TSVariableBuiltin"
|
hlmap["variable.builtin"] = "TSVariableBuiltin"
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ highlight default link TSStringRegex String
|
||||||
highlight default link TSStringEscape SpecialChar
|
highlight default link TSStringEscape SpecialChar
|
||||||
highlight default link TSStringSpecial SpecialChar
|
highlight default link TSStringSpecial SpecialChar
|
||||||
highlight default link TSCharacter Character
|
highlight default link TSCharacter Character
|
||||||
|
highlight default link TSCharacterSpecial SpecialChar
|
||||||
highlight default link TSNumber Number
|
highlight default link TSNumber Number
|
||||||
highlight default link TSBoolean Boolean
|
highlight default link TSBoolean Boolean
|
||||||
highlight default link TSFloat Float
|
highlight default link TSFloat Float
|
||||||
|
|
@ -66,9 +67,18 @@ highlight default link TSKeywordFunction Keyword
|
||||||
highlight default link TSKeywordOperator TSOperator
|
highlight default link TSKeywordOperator TSOperator
|
||||||
highlight default link TSKeywordReturn TSKeyword
|
highlight default link TSKeywordReturn TSKeyword
|
||||||
highlight default link TSException Exception
|
highlight default link TSException Exception
|
||||||
|
highlight default link TSDebug Debug
|
||||||
|
highlight default link TSDefine Define
|
||||||
|
highlight default link TSPreProc PreProc
|
||||||
|
highlight default link TSStorageClass StorageClass
|
||||||
|
|
||||||
|
highlight default link TSTodo Todo
|
||||||
|
|
||||||
highlight default link TSType Type
|
highlight default link TSType Type
|
||||||
highlight default link TSTypeBuiltin Type
|
highlight default link TSTypeBuiltin Type
|
||||||
|
highlight default link TSTypeQualifier Type
|
||||||
|
highlight default link TSTypeDefinition Typedef
|
||||||
|
|
||||||
highlight default link TSInclude Include
|
highlight default link TSInclude Include
|
||||||
|
|
||||||
highlight default link TSVariableBuiltin Special
|
highlight default link TSVariableBuiltin Special
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue