this repo has no description

Switch to new treesitter groups

+111 -62
+111 -62
lua/wombat_lua.lua
··· 192 192 Group.new("Noop", c.norm_accent, c.none, s.none) 193 193 Group.link("CocFadeOut", g.Noop) 194 194 195 + 196 + 197 + 198 + 199 + 200 + -- WIP 201 + 195 202 -- Syntax - Treesitter {{{1 196 203 Group.new("UnknownThing", c.norm, c.unknown) 197 204 198 - Group.link("TSBoolean", g.Boolean) 199 - Group.link("TSFloat", g.Float) 200 - Group.link("TSConstant", g.Constant) 201 - Group.link("TSNumber", g.Number) 205 + -- Structured following: 206 + -- https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#highlights 207 + 208 + -- Misc {{{2 209 + Group.link("@comment", g.Comment) -- line and block comments 210 + Group.link("@error", g.ErrorMsg) -- syntax/parser errors 211 + --Group.link("@none", g.UnknownThing) -- completely disable the highlight 212 + --Group.link("@preproc" g.UnknownThing) -- various preprocessor directives & shebangs 213 + --Group.link("@define" g.UnknownThing) -- preprocessor definition directives 214 + Group.link("@operator", g.Operator) -- symbolic operators (e.g. `+` / `*`) 215 + 216 + -- Punctuation {{{2 217 + Group.link("@punctuation.delimiter", g.Special) -- delimiters (e.g. `;` / `.` / `,`) 218 + Group.link("@punctuation.bracket", g.Special) -- brackets (e.g. `()` / `{}` / `[]`) 219 + Group.link("@punctuation.special", g.Special) -- special symbols (e.g. `{}` in string interpolation) 220 + 221 + -- Literals {{{2 222 + Group.link("@string", g.String) -- string literals 223 + Group.link("@string.regex", g.String) -- regular expressions 224 + Group.link("@string.escape", g.StringEscape) -- escape sequences 225 + Group.link("@string.special", g.String) -- other special strings (e.g. dates) 226 + 227 + Group.link("@character", g.Character) -- character literals 228 + Group.link("@character.special", g.Character) -- special characters (e.g. wildcards) 229 + 230 + Group.link("@boolean", g.Boolean) -- boolean literals 231 + Group.link("@number", g.Number) -- numeric literals 232 + Group.link("@float", g.Float) -- floating-point number literals 233 + 234 + -- Functions {{{2 235 + Group.link("@function", g.Function) -- function definitions 236 + Group.link("@function.builtin", g.Function) -- built-in functions 237 + --Group.link("@function.call", g.UnknownThing) -- function calls 238 + Group.link("@function.macro", g.Function) -- preprocessor macros 239 + 240 + Group.link("@method", g.Function) -- method definitions 241 + -- Group.link("@method.call", g.UnknownThing) -- method calls 242 + 243 + Group.link("@constructor", g.Function) -- constructor calls and definitions 244 + Group.link("@parameter", g.Normal) -- parameters of a function 202 245 203 - Group.link("TSCharacter", g.Character) 204 - Group.link("TSString", g.String) 205 - Group.link("TSStringRegex", g.String) 206 - Group.link("TSStringSpecial", g.String) 207 - Group.link("TSStringEscape", g.StringEscape) 246 + -- Keywords {{{2 247 + Group.link("@keyword", g.Keyword) -- various keywords 248 + Group.link("@keyword.function", g.Keyword) -- keywords that define a function (e.g. `func` in Go, `def` in Python) 249 + Group.link("@keyword.operator", g.Keyword) -- operators that are English words (e.g. `and` / `or`) 250 + Group.link("@keyword.return", g.Keyword) -- keywords like `return` and `yield` 251 + 252 + Group.link("@conditional", g.Conditional) -- keywords related to conditionals (e.g. `if` / `else`) 253 + Group.link("@repeat", g.Repeat) -- keywords related to loops (e.g. `for` / `while`) 254 + --Group.link("@debug" g.UnknownThing) -- keywords related to debugging 255 + Group.link("@label", g.Label) -- GOTO and other labels (e.g. `label:` in C) 256 + Group.link("@include", g.Include) -- keywords for including modules (e.g. `import` / `from` in Python) 257 + Group.link("@exception", g.Exception) -- keywords related to exceptions (e.g. `throw` / `catch`) 208 258 209 - Group.link("TSLabel", g.Label) 259 + -- Types {{{2 260 + Group.link("@type", g.Type) -- type or class definitions and annotations 261 + Group.link("@type.builtin", g.Type) -- built-in types 262 + --Group.link("@type.definition", g.UnknownThing) -- type definitions (e.g. `typedef` in C) 263 + --Group.link("@type.qualifier", g.UnknownThing) -- type qualifiers (e.g. `const`) 210 264 211 - Group.link("TSKeyword", g.Keyword) 212 - Group.link("TSKeywordFunction", g.Keyword) 213 - Group.link("TSKeywordOperator", g.Keyword) 214 - Group.link("TSKeywordReturn", g.Keyword) 265 + --Group.link("@storageclass", g.UnknownThing) -- visibility/life-time modifiers 266 + --Group.link("@storageclass.lifetime", g.UnknownThing) -- life-time modifiers (e.g. `static`) 267 + --Group.link("@attribute", g.UnknownThing) -- attribute annotations (e.g. Python decorators) 268 + --Group.link("@field", g.UnknownThing) -- object and struct fields 269 + Group.link("@property", g.Identifier) -- similar to `@field` 215 270 216 - Group.link("TSFunction", g.Function) 217 - Group.link("TSFuncBuiltin", g.Function) 218 - Group.link("TSFuncMacro", g.Function) 219 - Group.link("TSMethod", g.Function) 220 - Group.link("TSConstructor", g.Function) 271 + -- Identifiers {{{2 272 + Group.link("@variable", g.Identifier) -- various variable names 273 + --Group.link("@variable.builtin", g.UnknownThing) -- built-in variable names (e.g. `this`) 221 274 222 - Group.link("TSInclude", g.Include) 275 + Group.link("@constant", g.Constant) -- constant identifiers 276 + --Group.link("@constant.builtin", g.UnknownThing) -- built-in constant values 277 + --Group.link("@constant.macro", g.UnknownThing) -- constants defined by the preprocessor 223 278 224 - Group.link("TSConditional", g.Conditional) 225 - Group.link("TSRepeat", g.Repeat) 226 - Group.link("TSException", g.Exception) 279 + Group.new("@namespace", c.namespace, c.none) -- modules or namespaces 280 + Group.link("@symbol", g.Special) -- symbols or atoms 227 281 228 - Group.link("TSTag", g.Special) 229 - Group.link("TSTagAttribute", g.Special) 230 - Group.link("TSTagDelimiter", g.Special) 282 + -- Text {{{2 283 + Group.link("@text", g.Normal) -- non-structured text 284 + Group.link("@text.strong", g.Normal) -- bold text 285 + Group.link("@text.emphasis", g.Normal) -- text with emphasis 286 + Group.link("@text.underline", g.Normal) -- underlined text 287 + Group.link("@text.strike", g.Normal) -- strikethrough text 288 + Group.link("@text.title", g.Normal) -- text that is part of a title 289 + Group.link("@text.literal", g.Normal) -- literal or verbatim text 290 + Group.link("@text.uri", g.UnknownThing) -- URIs (e.g. hyperlinks) 291 + Group.link("@text.math", g.UnknownThing) -- math environments (e.g. `$ ... $` in LaTeX) 292 + Group.link("@text.environment", g.UnknownThing) -- text environments of markup languages 293 + Group.link("@text.environment.name", g.UnknownThing) -- text indicating the type of an environment 294 + Group.link("@text.reference", g.Normal) -- text references, footnotes, citations, etc. 231 295 232 - Group.link("TSWarning", g.Warning) 233 - Group.link("TSDanger", g.Error) 234 296 235 - Group.link("TSComment", g.Comment) 297 + -- I think the defaults are fine here? 298 + -- Group.link("@text.todo", g.TODO) -- todo notes 299 + Group.link("@text.note", g.Note) -- info notes 300 + Group.link("@text.warning", g.Warning) -- warning notes 301 + Group.link("@text.danger", g.Error) -- danger/error notes 236 302 237 - Group.link("TSType", g.Type) 238 - Group.link("TSTypeBuiltin", g.Type) 303 + Group.link("@text.diff.add", g.DiffAdd) -- added text (for diff files) 304 + Group.link("@text.diff.delete", g.DiffDelete) -- deleted text (for diff files) 239 305 240 - Group.link("TSError", g.ErrorMsg) 306 + -- Tags {{{2 307 + Group.link("@tag", g.Special) -- XML tag names 308 + Group.link("@tag.attribute", g.Special) -- XML tag attributes 309 + Group.link("@tag.delimiter", g.Special) -- XML tag delimiters 241 310 242 - Group.link("TSText", g.Normal) 243 - Group.link("TSStrong", g.Normal) 244 - Group.link("TSEmphasis", g.Normal) 245 - Group.link("TSUnderline", g.Normal) 246 - Group.link("TSStrike", g.Normal) 247 - Group.link("TSTitle", g.Normal) 248 - Group.link("TSLiteral", g.Normal) 249 - Group.link("TSTextReference", g.Normal) 311 + -- Conceal {{{2 312 + --Group.link("@conceal", g.UnknownThing) -- for captures that are only used for concealing 250 313 251 - Group.link("TSParameter", g.Normal) 314 + -- Spell {{{2 315 + --Group.link("@spell", g.UnknownThing) -- for defining regions to be spellchecked 252 316 253 - Group.link("TSPunctDelimiter", g.Special) 254 - Group.link("TSPunctBracket", g.Special) 255 - Group.link("TSPunctSpecial", g.Special) 317 + -- Non-standard 318 + -- @variable.global 256 319 257 - Group.link("TSAnnotation", g.UnknownThing) 258 - --Group.link("TSAttribute", g.UnknownThing) 259 - --Group.link("TSField", g.UnknownThing) 260 - --Group.link("TSNone", g.UnknownThing) 261 - Group.link("TSMath", g.UnknownThing) 262 - Group.link("TSURI", g.UnknownThing) 263 - Group.link("TSEnvironment", g.UnknownThing) 264 - Group.link("TSEnvironmentName", g.UnknownThing) 265 - Group.link("TSNote", g.Note) 320 + ------------------------------------- 266 321 267 - Group.new("TSNamespace", c.namespace, c.none) 268 - Group.link("TSOperator", g.Operator) 269 - Group.link("TSProperty", g.Identifier) 270 - Group.link("TSVariable", g.Identifier) 271 - Group.link("TSSymbol", g.Special) 272 - --Group.link("TSParameterReference", g.UnknownThing) 273 - --Group.link("TSVariableBuiltin", g.UnknownThing) 274 - --Group.link("TSConstBuiltin", g.UnknownThing) 275 - --Group.link("TSConstMacro", g.UnknownThing) 322 + -- Undocumented or invalid? 323 + Group.link("@annotation", g.UnknownThing) 324 + --Group.link("@parameter.reference", g.UnknownThing) 276 325 277 326 Group.new("TODO", c.none, c.none) -- what even set this?