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