mirror of
https://github.com/neovim/neovim.git
synced 2025-10-15 06:16:08 +00:00
feat(treesitter)!: use @foo.bar style highlight groups
This removes the support for defining links via vim.treesitter.highlighter.hl_map (never documented, but plugins did anyway), or the uppercase-only `@FooGroup.Bar` to `FooGroup` rule. The fallback is now strictly `@foo.bar.lang` to `@foo.bar` to `@foo`, and casing is irrelevant (as it already was outside of treesitter) For compatibility, define default links to builting syntax groups as defined by pre-existing color schemes
This commit is contained in:
@@ -185,6 +185,54 @@ static const char *highlight_init_both[] = {
|
||||
"default link DiagnosticSignWarn DiagnosticWarn",
|
||||
"default link DiagnosticSignInfo DiagnosticInfo",
|
||||
"default link DiagnosticSignHint DiagnosticHint",
|
||||
|
||||
"default link @error Error",
|
||||
"default link @text.underline Underlined",
|
||||
"default link @todo Todo",
|
||||
"default link @debug Debug",
|
||||
|
||||
// Miscs
|
||||
"default link @comment Comment",
|
||||
"default link @punctuation Delimiter",
|
||||
|
||||
// Constants
|
||||
"default link @constant Constant",
|
||||
"default link @constant.builtin Special",
|
||||
"default link @constant.macro Define",
|
||||
"default link @define Define",
|
||||
"default link @macro Macro",
|
||||
"default link @string String",
|
||||
"default link @string.escape SpecialChar",
|
||||
"default link @character Character",
|
||||
"default link @character.special SpecialChar",
|
||||
"default link @number Number",
|
||||
"default link @boolean Boolean",
|
||||
"default link @float Float",
|
||||
|
||||
// Functions
|
||||
"default link @function Function",
|
||||
"default link @function.builtin Special",
|
||||
"default link @function.macro Macro",
|
||||
"default link @parameter Identifier",
|
||||
"default link @method Function",
|
||||
"default link @field Identifier",
|
||||
"default link @property Identifier",
|
||||
"default link @constructor Special",
|
||||
|
||||
// Keywords
|
||||
"default link @conditional Conditional",
|
||||
"default link @repeat Repeat",
|
||||
"default link @label Label",
|
||||
"default link @operator Operator",
|
||||
"default link @keyword Keyword",
|
||||
"default link @exception Exception",
|
||||
|
||||
"default link @type Type",
|
||||
"default link @type.definition Typedef",
|
||||
"default link @storageclass StorageClass",
|
||||
"default link @structure Structure",
|
||||
"default link @include Include",
|
||||
"default link @preproc PreProc",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@@ -244,7 +244,7 @@ func Test_match_completion()
|
||||
return
|
||||
endif
|
||||
hi Aardig ctermfg=green
|
||||
call feedkeys(":match \<Tab>\<Home>\"\<CR>", 'xt')
|
||||
call feedkeys(":match A\<Tab>\<Home>\"\<CR>", 'xt')
|
||||
call assert_equal('"match Aardig', getreg(':'))
|
||||
call feedkeys(":match \<S-Tab>\<Home>\"\<CR>", 'xt')
|
||||
call assert_equal('"match none', getreg(':'))
|
||||
@@ -255,9 +255,7 @@ func Test_highlight_completion()
|
||||
return
|
||||
endif
|
||||
hi Aardig ctermfg=green
|
||||
call feedkeys(":hi \<Tab>\<Home>\"\<CR>", 'xt')
|
||||
call assert_equal('"hi Aardig', getreg(':'))
|
||||
call feedkeys(":hi default \<Tab>\<Home>\"\<CR>", 'xt')
|
||||
call feedkeys(":hi default A\<Tab>\<Home>\"\<CR>", 'xt')
|
||||
call assert_equal('"hi default Aardig', getreg(':'))
|
||||
call feedkeys(":hi clear Aa\<Tab>\<Home>\"\<CR>", 'xt')
|
||||
call assert_equal('"hi clear Aardig', getreg(':'))
|
||||
|
Reference in New Issue
Block a user