mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 19:30:02 -04:00
docs: Update docs for missing groups, re-order alphabetically
This commit is contained in:
parent
3727be629c
commit
07e86b1553
2 changed files with 167 additions and 139 deletions
|
|
@ -397,21 +397,30 @@ Note: This is highly experimental, and folding can break on some types of
|
||||||
==============================================================================
|
==============================================================================
|
||||||
HIGHLIGHTS *nvim-treesitter-highlights*
|
HIGHLIGHTS *nvim-treesitter-highlights*
|
||||||
|
|
||||||
`TSError`
|
`TSAnnotation`
|
||||||
*hl-TSError*
|
*hl-TSAnnotation*
|
||||||
For syntax/parser errors.
|
For C++/Dart attributes, annotations that can be attached to the code to
|
||||||
|
denote some kind of meta information.
|
||||||
|
|
||||||
`TSPunctDelimiter`
|
`TSAttribute`
|
||||||
*hl-TSPunctDelimiter*
|
hl-TSAttribute
|
||||||
For delimiters ie: `.`
|
(unstable) TODO: docs
|
||||||
|
|
||||||
`TSPunctBracket`
|
`TSBoolean`
|
||||||
*hl-TSPunctBracket*
|
*hl-TSBoolean*
|
||||||
For brackets and parens.
|
For booleans.
|
||||||
|
|
||||||
`TSPunctSpecial`
|
`TSCharacter`
|
||||||
*hl-TSPunctSpecial*
|
*hl-TSCharacter*
|
||||||
For special punctutation that does not fall in the catagories before.
|
For characters.
|
||||||
|
|
||||||
|
`TSConstructor`
|
||||||
|
*hl-TSConstructor*
|
||||||
|
For constructor calls and definitions: `{}` in Lua, and Java constructors.
|
||||||
|
|
||||||
|
`TSConditional`
|
||||||
|
*hl-TSConditional*
|
||||||
|
For keywords related to conditionnals.
|
||||||
|
|
||||||
`TSConstant`
|
`TSConstant`
|
||||||
*hl-TSConstant*
|
*hl-TSConstant*
|
||||||
|
|
@ -425,29 +434,17 @@ For constant that are built in the language: `nil` in Lua.
|
||||||
*hl-TSConstMacro*
|
*hl-TSConstMacro*
|
||||||
For constants that are defined by macros: `NULL` in C.
|
For constants that are defined by macros: `NULL` in C.
|
||||||
|
|
||||||
`TSString`
|
`TSError`
|
||||||
*hl-TSString*
|
*hl-TSError*
|
||||||
For strings.
|
For syntax/parser errors.
|
||||||
|
|
||||||
`TSStringRegex`
|
`TSException`
|
||||||
*hl-TSStringRegex*
|
*hl-TSException*
|
||||||
For regexes.
|
For exception related keywords.
|
||||||
|
|
||||||
`TSStringEscape`
|
`TSField`
|
||||||
*hl-TSStringEscape*
|
*hl-TSField*
|
||||||
For escape characters within a string.
|
For fields.
|
||||||
|
|
||||||
`TSCharacter`
|
|
||||||
*hl-TSCharacter*
|
|
||||||
For characters.
|
|
||||||
|
|
||||||
`TSNumber`
|
|
||||||
*hl-TSNumber*
|
|
||||||
For integers.
|
|
||||||
|
|
||||||
`TSBoolean`
|
|
||||||
*hl-TSBoolean*
|
|
||||||
For booleans.
|
|
||||||
|
|
||||||
`TSFloat`
|
`TSFloat`
|
||||||
*hl-TSFloat*
|
*hl-TSFloat*
|
||||||
|
|
@ -466,45 +463,10 @@ For builtin functions: `table.insert` in Lua.
|
||||||
For macro defined fuctions (calls and definitions): each `macro_rules` in
|
For macro defined fuctions (calls and definitions): each `macro_rules` in
|
||||||
Rust.
|
Rust.
|
||||||
|
|
||||||
`TSParameter`
|
`TSInclude`
|
||||||
*hl-TSParameter*
|
*hl-TSInclude*
|
||||||
For parameters of a function.
|
For includes: `#include` in C, `use` or `extern crate` in Rust, or `require`
|
||||||
|
in Lua.
|
||||||
`TSParameterReference`
|
|
||||||
*hl-TSParameterReference*
|
|
||||||
For references to parameters of a function.
|
|
||||||
|
|
||||||
`TSMethod`
|
|
||||||
*hl-TSMethod*
|
|
||||||
For method calls and definitions.
|
|
||||||
|
|
||||||
`TSField`
|
|
||||||
*hl-TSField*
|
|
||||||
For fields.
|
|
||||||
|
|
||||||
`TSProperty`
|
|
||||||
*hl-TSProperty*
|
|
||||||
Same as `TSField`.
|
|
||||||
|
|
||||||
`TSConstructor`
|
|
||||||
*hl-TSConstructor*
|
|
||||||
For constructor calls and definitions: `{}` in Lua, and Java constructors.
|
|
||||||
|
|
||||||
`TSConditional`
|
|
||||||
*hl-TSConditional*
|
|
||||||
For keywords related to conditionnals.
|
|
||||||
|
|
||||||
`TSRepeat`
|
|
||||||
*hl-TSRepeat*
|
|
||||||
For keywords related to loops.
|
|
||||||
|
|
||||||
`TSLabel`
|
|
||||||
*hl-TSLabel*
|
|
||||||
For labels: `label:` in C and `:label:` in Lua.
|
|
||||||
|
|
||||||
`TSOperator`
|
|
||||||
*hl-TSOperator*
|
|
||||||
For any operator: `+`, but also `->` and `*` in C.
|
|
||||||
|
|
||||||
`TSKeyword`
|
`TSKeyword`
|
||||||
*hl-TSKeyword*
|
*hl-TSKeyword*
|
||||||
|
|
@ -514,40 +476,86 @@ For keywords that don't fall in previous categories.
|
||||||
*hl-TSKeywordFunction*
|
*hl-TSKeywordFunction*
|
||||||
For keywords used to define a fuction.
|
For keywords used to define a fuction.
|
||||||
|
|
||||||
`TSException`
|
`TSLabel`
|
||||||
*hl-TSException*
|
*hl-TSLabel*
|
||||||
For exception related keywords.
|
For labels: `label:` in C and `:label:` in Lua.
|
||||||
|
|
||||||
`TSType`
|
`TSMethod`
|
||||||
*hl-TSType*
|
*hl-TSMethod*
|
||||||
For types.
|
For method calls and definitions.
|
||||||
|
|
||||||
`TSTypeBuiltin`
|
|
||||||
*hl-TSTypeBuiltin*
|
|
||||||
For builtin types (you guessed it, right ?).
|
|
||||||
|
|
||||||
`TSNamespace`
|
`TSNamespace`
|
||||||
*hl-TSNamespace*
|
*hl-TSNamespace*
|
||||||
For identifiers referring to modules and namespaces.
|
For identifiers referring to modules and namespaces.
|
||||||
|
|
||||||
`TSInclude`
|
`TSNone`
|
||||||
*hl-TSInclude*
|
*hl-None*
|
||||||
For includes: `#include` in C, `use` or `extern crate` in Rust, or `require`
|
TODO: docs
|
||||||
in Lua.
|
|
||||||
|
|
||||||
`TSAnnotation`
|
`TSNumber`
|
||||||
*hl-TSAnnotation*
|
*hl-TSNumber*
|
||||||
For C++/Dart attributes, annotations that can be attached to the code to
|
For all numbers
|
||||||
denote some kind of meta information.
|
|
||||||
|
`TSOperator`
|
||||||
|
*hl-TSOperator*
|
||||||
|
For any operator: `+`, but also `->` and `*` in C.
|
||||||
|
|
||||||
|
`TSParameter`
|
||||||
|
*hl-TSParameter*
|
||||||
|
For parameters of a function.
|
||||||
|
|
||||||
|
`TSParameterReference`
|
||||||
|
*hl-TSParameterReference*
|
||||||
|
For references to parameters of a function.
|
||||||
|
|
||||||
|
`TSProperty`
|
||||||
|
*hl-TSProperty*
|
||||||
|
Same as `TSField`.
|
||||||
|
|
||||||
|
`TSPunctDelimiter`
|
||||||
|
*hl-TSPunctDelimiter*
|
||||||
|
For delimiters ie: `.`
|
||||||
|
|
||||||
|
`TSPunctBracket`
|
||||||
|
*hl-TSPunctBracket*
|
||||||
|
For brackets and parens.
|
||||||
|
|
||||||
|
`TSPunctSpecial`
|
||||||
|
*hl-TSPunctSpecial*
|
||||||
|
For special punctutation that does not fall in the catagories before.
|
||||||
|
|
||||||
|
`TSRepeat`
|
||||||
|
*hl-TSRepeat*
|
||||||
|
For keywords related to loops.
|
||||||
|
|
||||||
|
`TSString`
|
||||||
|
*hl-TSString*
|
||||||
|
For strings.
|
||||||
|
|
||||||
|
`TSStringRegex`
|
||||||
|
*hl-TSStringRegex*
|
||||||
|
For regexes.
|
||||||
|
|
||||||
|
`TSStringEscape`
|
||||||
|
*hl-TSStringEscape*
|
||||||
|
For escape characters within a string.
|
||||||
|
|
||||||
|
`TSStructure`
|
||||||
|
*hl-TSStructure*
|
||||||
|
TODO: docs
|
||||||
|
|
||||||
|
`TSTag`
|
||||||
|
*hl-TSTag*
|
||||||
|
Tags like html tag names.
|
||||||
|
|
||||||
|
`TSTagDelimiter`
|
||||||
|
*hl-TSTagDelimiter*
|
||||||
|
Tag delimiter like `<` `>` `/`
|
||||||
|
|
||||||
`TSText`
|
`TSText`
|
||||||
*hl-TSText*
|
*hl-TSText*
|
||||||
For strings considered text in a markup language.
|
For strings considered text in a markup language.
|
||||||
|
|
||||||
`TSStrong`
|
|
||||||
*hl-TSStrong*
|
|
||||||
For text to be represented with strong.
|
|
||||||
|
|
||||||
`TSEmphasis`
|
`TSEmphasis`
|
||||||
*hl-TSEmphasis*
|
*hl-TSEmphasis*
|
||||||
For text to be represented with emphasis.
|
For text to be represented with emphasis.
|
||||||
|
|
@ -558,7 +566,6 @@ For text to be represented with an underline.
|
||||||
|
|
||||||
`TSTitle`
|
`TSTitle`
|
||||||
*hl-TSTitle*
|
*hl-TSTitle*
|
||||||
|
|
||||||
Text that is part of a title.
|
Text that is part of a title.
|
||||||
|
|
||||||
`TSLiteral`
|
`TSLiteral`
|
||||||
|
|
@ -569,6 +576,14 @@ Literal text.
|
||||||
*hl-TSURI*
|
*hl-TSURI*
|
||||||
Any URI like a link or email.
|
Any URI like a link or email.
|
||||||
|
|
||||||
|
`TSType`
|
||||||
|
*hl-TSType*
|
||||||
|
For types.
|
||||||
|
|
||||||
|
`TSTypeBuiltin`
|
||||||
|
*hl-TSTypeBuiltin*
|
||||||
|
For builtin types.
|
||||||
|
|
||||||
`TSVariable`
|
`TSVariable`
|
||||||
*hl-TSVariable*
|
*hl-TSVariable*
|
||||||
Any variable name that does not have another highlight.
|
Any variable name that does not have another highlight.
|
||||||
|
|
|
||||||
|
|
@ -11,58 +11,71 @@ local M = {
|
||||||
|
|
||||||
local hlmap = vim.treesitter.highlighter.hl_map
|
local hlmap = vim.treesitter.highlighter.hl_map
|
||||||
|
|
||||||
-- Misc
|
-- Constants
|
||||||
|
hlmap["annotation"] = "TSAnnotation"
|
||||||
|
|
||||||
|
hlmap["attribute"] = "TSAttribute"
|
||||||
|
|
||||||
|
hlmap["boolean"] = "TSBoolean"
|
||||||
|
|
||||||
|
hlmap["character"] = "TSCharacter"
|
||||||
|
|
||||||
|
hlmap["conditional"] = "TSConditional"
|
||||||
|
|
||||||
|
hlmap["constant"] = "TSConstant"
|
||||||
|
hlmap["constant.builtin"] = "TSConstBuiltin"
|
||||||
|
hlmap["constant.macro"] = "TSConstMacro"
|
||||||
|
|
||||||
|
hlmap["constructor"] = "TSConstructor"
|
||||||
|
|
||||||
hlmap.error = "TSError"
|
hlmap.error = "TSError"
|
||||||
|
hlmap["exception"] = "TSException"
|
||||||
|
|
||||||
|
hlmap["field"] = "TSField"
|
||||||
|
|
||||||
|
hlmap["float"] = "TSFloat"
|
||||||
|
|
||||||
|
hlmap["function"] = "TSFunction"
|
||||||
|
hlmap["function.builtin"] = "TSFuncBuiltin"
|
||||||
|
hlmap["function.macro"] = "TSFuncMacro"
|
||||||
|
|
||||||
|
hlmap["include"] = "TSInclude"
|
||||||
|
|
||||||
|
hlmap["keyword"] = "TSKeyword"
|
||||||
|
hlmap["keyword.function"] = "TSKeywordFunction"
|
||||||
|
hlmap["keyword.operator"] = "TSKeywordOperator"
|
||||||
|
|
||||||
|
hlmap["label"] = "TSLabel"
|
||||||
|
|
||||||
|
hlmap["method"] = "TSMethod"
|
||||||
|
|
||||||
|
hlmap["namespace"] = "TSNamespace"
|
||||||
|
|
||||||
|
hlmap["none"] = "TSNone"
|
||||||
|
hlmap["number"] = "TSNumber"
|
||||||
|
|
||||||
|
hlmap["operator"] = "TSOperator"
|
||||||
|
|
||||||
|
hlmap["parameter"] = "TSParameter"
|
||||||
|
hlmap["parameter.reference"] = "TSParameterReference"
|
||||||
|
|
||||||
|
hlmap["property"] = "TSProperty"
|
||||||
|
|
||||||
hlmap["punctuation.delimiter"] = "TSPunctDelimiter"
|
hlmap["punctuation.delimiter"] = "TSPunctDelimiter"
|
||||||
hlmap["punctuation.bracket"] = "TSPunctBracket"
|
hlmap["punctuation.bracket"] = "TSPunctBracket"
|
||||||
hlmap["punctuation.special"] = "TSPunctSpecial"
|
hlmap["punctuation.special"] = "TSPunctSpecial"
|
||||||
|
|
||||||
-- Constants
|
hlmap["repeat"] = "TSRepeat"
|
||||||
hlmap["constant"] = "TSConstant"
|
|
||||||
hlmap["constant.builtin"] = "TSConstBuiltin"
|
|
||||||
hlmap["constant.macro"] = "TSConstMacro"
|
|
||||||
hlmap["string"] = "TSString"
|
hlmap["string"] = "TSString"
|
||||||
hlmap["string.regex"] = "TSStringRegex"
|
hlmap["string.regex"] = "TSStringRegex"
|
||||||
hlmap["string.escape"] = "TSStringEscape"
|
hlmap["string.escape"] = "TSStringEscape"
|
||||||
hlmap["character"] = "TSCharacter"
|
|
||||||
hlmap["number"] = "TSNumber"
|
|
||||||
hlmap["boolean"] = "TSBoolean"
|
|
||||||
hlmap["float"] = "TSFloat"
|
|
||||||
hlmap["annotation"] = "TSAnnotation"
|
|
||||||
hlmap["attribute"] = "TSAttribute"
|
|
||||||
hlmap["namespace"] = "TSNamespace"
|
|
||||||
|
|
||||||
-- Functions
|
|
||||||
hlmap["function"] = "TSFunction"
|
|
||||||
hlmap["function.builtin"] = "TSFuncBuiltin"
|
|
||||||
hlmap["function.macro"] = "TSFuncMacro"
|
|
||||||
hlmap["parameter"] = "TSParameter"
|
|
||||||
hlmap["parameter.reference"] = "TSParameterReference"
|
|
||||||
hlmap["method"] = "TSMethod"
|
|
||||||
hlmap["field"] = "TSField"
|
|
||||||
hlmap["property"] = "TSProperty"
|
|
||||||
hlmap["constructor"] = "TSConstructor"
|
|
||||||
|
|
||||||
-- Keywords
|
|
||||||
hlmap["conditional"] = "TSConditional"
|
|
||||||
hlmap["repeat"] = "TSRepeat"
|
|
||||||
hlmap["label"] = "TSLabel"
|
|
||||||
hlmap["keyword"] = "TSKeyword"
|
|
||||||
hlmap["keyword.function"] = "TSKeywordFunction"
|
|
||||||
hlmap["keyword.operator"] = "TSKeywordOperator"
|
|
||||||
hlmap["operator"] = "TSOperator"
|
|
||||||
hlmap["exception"] = "TSException"
|
|
||||||
|
|
||||||
hlmap["type"] = "TSType"
|
|
||||||
hlmap["type.builtin"] = "TSTypeBuiltin"
|
|
||||||
hlmap["structure"] = "TSStructure"
|
hlmap["structure"] = "TSStructure"
|
||||||
hlmap["include"] = "TSInclude"
|
|
||||||
|
|
||||||
-- variable
|
hlmap["tag"] = "TSTag"
|
||||||
hlmap["variable"] = "TSVariable"
|
hlmap["tag.delimiter"] = "TSTagDelimiter"
|
||||||
hlmap["variable.builtin"] = "TSVariableBuiltin"
|
|
||||||
|
|
||||||
-- Text
|
|
||||||
hlmap["text"] = "TSText"
|
hlmap["text"] = "TSText"
|
||||||
hlmap["text.strong"] = "TSStrong"
|
hlmap["text.strong"] = "TSStrong"
|
||||||
hlmap["text.emphasis"] = "TSEmphasis"
|
hlmap["text.emphasis"] = "TSEmphasis"
|
||||||
|
|
@ -71,11 +84,11 @@ hlmap["text.title"] = "TSTitle"
|
||||||
hlmap["text.literal"] = "TSLiteral"
|
hlmap["text.literal"] = "TSLiteral"
|
||||||
hlmap["text.uri"] = "TSURI"
|
hlmap["text.uri"] = "TSURI"
|
||||||
|
|
||||||
-- Tags
|
hlmap["type"] = "TSType"
|
||||||
hlmap["tag"] = "TSTag"
|
hlmap["type.builtin"] = "TSTypeBuiltin"
|
||||||
hlmap["tag.delimiter"] = "TSTagDelimiter"
|
|
||||||
|
|
||||||
hlmap["none"] = "TSNone"
|
hlmap["variable"] = "TSVariable"
|
||||||
|
hlmap["variable.builtin"] = "TSVariableBuiltin"
|
||||||
|
|
||||||
function M.attach(bufnr, lang)
|
function M.attach(bufnr, lang)
|
||||||
local parser = parsers.get_parser(bufnr, lang)
|
local parser = parsers.get_parser(bufnr, lang)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue