More robust workaround for symantic highlights

Uses new experimental API
This commit is contained in:
ViViDboarder 2024-05-30 15:44:47 -07:00
parent 002915c21f
commit ea2ca3916a
2 changed files with 222 additions and 218 deletions

View File

@ -17,6 +17,3 @@ lua package.loaded['lush_theme.lush_template'] = nil
" include our theme file and pass it to lush to apply " include our theme file and pass it to lush to apply
lua require('lush')(require('lush_theme.wombat_lush')) lua require('lush')(require('lush_theme.wombat_lush'))
" Workaround for not being able to link from semantic groups to highlight groups in lush
lua vim.api.nvim_set_hl(0, "@variable", { link = "TSVariable" })

View File

@ -42,7 +42,7 @@
-- --
-- `:lua require('lush').ify()` -- `:lua require('lush').ify()`
local lush = require('lush') local lush = require("lush")
local hsl = lush.hsl local hsl = lush.hsl
local c = require("lush_theme.wombat_lush_colors").colors local c = require("lush_theme.wombat_lush_colors").colors
@ -50,244 +50,251 @@ local italic = require("lush_theme.wombat_lush_colors").italic
local classic = require("lush_theme.wombat_classic") local classic = require("lush_theme.wombat_classic")
-- LSP/Linters mistakenly show `undefined global` errors in the spec, they may -- LSP/Linters mistakenly show `undefined global` errors in the spec, they may
-- support an annotation like the following. Consult your server documentation. -- support an annotation li
-- -@diagnostic disable: undefined-global -- luacheck: ignore
local theme = lush.extends({classic}).with(function() -- @diagnostic disable: undefined-global
return { local theme = lush.extends({ classic }).with(function(injected_functions)
-- The following are all the Neovim default highlight groups from the docs local sym = injected_functions.sym
-- as of 0.5.0-nightly-446, to aid your theme creation. Your themes should return {
-- probably style all of these at a bare minimum. -- The following are all the Neovim default highlight groups from the docs
-- -- as of 0.5.0-nightly-446, to aid your theme creation. Your themes should
-- Referenced/linked groups must come before being referenced/lined, -- probably style all of these at a bare minimum.
-- so the order shown ((mostly) alphabetical) is likely --
-- not the order you will end up with. -- Referenced/linked groups must come before being referenced/lined,
-- -- so the order shown ((mostly) alphabetical) is likely
-- You can uncomment these and leave them empty to disable any -- not the order you will end up with.
-- styling for that group (meaning they mostly get styled as Normal) --
-- or leave them commented to apply vims default colouring or linking. -- You can uncomment these and leave them empty to disable any
-- styling for that group (meaning they mostly get styled as Normal)
-- or leave them commented to apply vims default colouring or linking.
-- Comment { fg = c.grey_2, gui = italic }, -- any comment -- Comment { fg = c.grey_2, gui = italic }, -- any comment
-- ColorColumn { }, -- used for the columns set with 'colorcolumn' -- ColorColumn { }, -- used for the columns set with 'colorcolumn'
-- Conceal { }, -- placeholder characters substituted for concealed text (see 'conceallevel') -- Conceal { }, -- placeholder characters substituted for concealed text (see 'conceallevel')
-- Cursor { bg = c.yellow }, -- character under the cursor -- Cursor { bg = c.yellow }, -- character under the cursor
-- lCursor { }, -- the character under the cursor when |language-mapping| is used (see 'guicursor') -- lCursor { }, -- the character under the cursor when |language-mapping| is used (see 'guicursor')
-- CursorIM { }, -- like Cursor, but used when in IME mode |CursorIM| -- CursorIM { }, -- like Cursor, but used when in IME mode |CursorIM|
-- CursorColumn { Cursor }, -- Screen-column at the cursor, when 'cursorcolumn' is set. -- CursorColumn { Cursor }, -- Screen-column at the cursor, when 'cursorcolumn' is set.
-- CursorLine { bg = c.grey_6}, -- Screen-line at the cursor, when 'cursorline' is set. Low-priority if foreground (ctermfg OR guifg) is not set. -- CursorLine { bg = c.grey_6}, -- Screen-line at the cursor, when 'cursorline' is set. Low-priority if foreground (ctermfg OR guifg) is not set.
-- Directory { }, -- directory names (and other special names in listings) -- Directory { }, -- directory names (and other special names in listings)
DiffAdd { fg = c.darkgreen.readable(), bg = c.darkgreen }, -- diff mode: Added line |diff.txt| DiffAdd({ fg = c.darkgreen.readable(), bg = c.darkgreen }), -- diff mode: Added line |diff.txt|
DiffChange { bg = c.violet }, -- diff mode: Changed line |diff.txt| DiffChange({ bg = c.violet }), -- diff mode: Changed line |diff.txt|
DiffDelete { fg = c.darkred.readable(), bg = c.darkred }, -- diff mode: Deleted line |diff.txt| DiffDelete({ fg = c.darkred.readable(), bg = c.darkred }), -- diff mode: Deleted line |diff.txt|
DiffText { fg = c.magenta.readable(), bg = c.magenta }, -- diff mode: Changed text within a changed line |diff.txt| DiffText({ fg = c.magenta.readable(), bg = c.magenta }), -- diff mode: Changed text within a changed line |diff.txt|
-- EndOfBuffer { }, -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|. -- EndOfBuffer { }, -- filler lines (~) after the end of the buffer. By default, this is highlighted like |hl-NonText|.
-- TermCursor { }, -- cursor in a focused terminal -- TermCursor { }, -- cursor in a focused terminal
-- TermCursorNC { }, -- cursor in an unfocused terminal -- TermCursorNC { }, -- cursor in an unfocused terminal
-- ErrorMsg { fg = c.error_red, bg = c.grey_5, gui = "bold" }, -- error messages on the command line -- ErrorMsg { fg = c.error_red, bg = c.grey_5, gui = "bold" }, -- error messages on the command line
-- VertSplit { fg = c.grey_5, bg = c.grey_5 }, -- the column separating vertically split windows -- VertSplit { fg = c.grey_5, bg = c.grey_5 }, -- the column separating vertically split windows
-- Folded { fg = c.grey_2, bg = c.grey_4 }, -- line used for closed folds -- Folded { fg = c.grey_2, bg = c.grey_4 }, -- line used for closed folds
-- FoldColumn { Folded }, -- 'foldcolumn' -- FoldColumn { Folded }, -- 'foldcolumn'
-- SignColumn { }, -- column where |signs| are displayed -- SignColumn { }, -- column where |signs| are displayed
-- IncSearch { }, -- 'incsearch' highlighting; also used for the text replaced with ":s///c" -- IncSearch { }, -- 'incsearch' highlighting; also used for the text replaced with ":s///c"
-- Substitute { }, -- |:substitute| replacement text highlighting -- Substitute { }, -- |:substitute| replacement text highlighting
-- LineNr { fg = c.grey_4, bg = c.black }, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set. -- LineNr { fg = c.grey_4, bg = c.black }, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.
-- CursorLineNr { }, -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line. -- CursorLineNr { }, -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line.
-- MatchParen { fg = c.yellow, bg = c.grey_2, gui = "bold"}, -- The character under the cursor or just before it, if it is a paired bracket, and its match. |pi_paren.txt| -- MatchParen { fg = c.yellow, bg = c.grey_2, gui = "bold"}, -- The character under the cursor or just before it, if it is a paired bracket, and its match. |pi_paren.txt|
-- ModeMsg { }, -- 'showmode' message (e.g., "-- INSERT -- ") -- ModeMsg { }, -- 'showmode' message (e.g., "-- INSERT -- ")
-- MsgArea { }, -- Area for messages and cmdline -- MsgArea { }, -- Area for messages and cmdline
-- MsgSeparator { }, -- Separator for scrolled messages, `msgsep` flag of 'display' -- MsgSeparator { }, -- Separator for scrolled messages, `msgsep` flag of 'display'
-- MoreMsg { }, -- |more-prompt| -- MoreMsg { }, -- |more-prompt|
-- NonText { LineNr }, -- '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|. -- NonText { LineNr }, -- '@' at the end of the window, characters from 'showbreak' and other characters that do not really exist in the text (e.g., ">" displayed when a double-wide character doesn't fit at the end of the line). See also |hl-EndOfBuffer|.
Normal {bg = c.dark_bg, fg = c.dark_fg}, -- normal text Normal({ bg = c.dark_bg, fg = c.dark_fg }), -- normal text
NormalFloat {bg = Normal.bg.lighten(10), fg = classic.Special.fg }, -- Normal text in floating windows. NormalFloat({ bg = Normal.bg.lighten(10), fg = classic.Special.fg }), -- Normal text in floating windows.
FloatBorder {bg = NormalFloat.bg, fg = classic.Pmenu.fg}, -- float border FloatBorder({ bg = NormalFloat.bg, fg = classic.Pmenu.fg }), -- float border
-- NormalNC { }, -- normal text in non-current windows -- NormalNC { }, -- normal text in non-current windows
-- Pmenu { fg = c.light_yellow, bg = c.grey_5 }, -- Popup menu: normal item. -- Pmenu { fg = c.light_yellow, bg = c.grey_5 }, -- Popup menu: normal item.
-- PmenuSel { fg = c.green.readable(), bg = c.green }, -- Popup menu: selected item. -- PmenuSel { fg = c.green.readable(), bg = c.green }, -- Popup menu: selected item.
-- PmenuSbar { }, -- Popup menu: scrollbar. -- PmenuSbar { }, -- Popup menu: scrollbar.
-- PmenuThumb { }, -- Popup menu: Thumb of the scrollbar. -- PmenuThumb { }, -- Popup menu: Thumb of the scrollbar.
-- Question { }, -- |hit-enter| prompt and yes/no questions -- Question { }, -- |hit-enter| prompt and yes/no questions
-- QuickFixLine { }, -- Current |quickfix| item in the quickfix window. Combined with |hl-CursorLine| when the cursor is there. -- QuickFixLine { }, -- Current |quickfix| item in the quickfix window. Combined with |hl-CursorLine| when the cursor is there.
-- Search { fg = c.purple, bg = c.grey_3 }, -- Last search pattern highlighting (see 'hlsearch'). Also used for similar items that need to stand out. -- Search { fg = c.purple, bg = c.grey_3 }, -- Last search pattern highlighting (see 'hlsearch'). Also used for similar items that need to stand out.
-- SpecialKey { fg = c.grey_3, bg = c.grey_6 }, -- Unprintable characters: text displayed differently from what it really is. But not 'listchars' whitespace. |hl-Whitespace| -- SpecialKey { fg = c.grey_3, bg = c.grey_6 }, -- Unprintable characters: text displayed differently from what it really is. But not 'listchars' whitespace. |hl-Whitespace|
-- SpellBad { }, -- Word that is not recognized by the spellchecker. |spell| Combined with the highlighting used otherwise. -- SpellBad { }, -- Word that is not recognized by the spellchecker. |spell| Combined with the highlighting used otherwise.
-- SpellCap { }, -- Word that should start with a capital. |spell| Combined with the highlighting used otherwise. -- SpellCap { }, -- Word that should start with a capital. |spell| Combined with the highlighting used otherwise.
-- SpellLocal { }, -- Word that is recognized by the spellchecker as one that is used in another region. |spell| Combined with the highlighting used otherwise. -- SpellLocal { }, -- Word that is recognized by the spellchecker as one that is used in another region. |spell| Combined with the highlighting used otherwise.
-- SpellRare { }, -- Word that is recognized by the spellchecker as one that is hardly ever used. |spell| Combined with the highlighting used otherwise. -- SpellRare { }, -- Word that is recognized by the spellchecker as one that is hardly ever used. |spell| Combined with the highlighting used otherwise.
-- StatusLine { fg = c.light_yellow, bg = c.grey_5, gui = italic }, -- status line of current window -- StatusLine { fg = c.light_yellow, bg = c.grey_5, gui = italic }, -- status line of current window
-- StatusLineNC { fg = c.grey_2, bg = StatusLine.bg }, -- status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window. -- StatusLineNC { fg = c.grey_2, bg = StatusLine.bg }, -- status lines of not-current windows Note: if this is equal to "StatusLine" Vim will use "^^^" in the status line of the current window.
-- TabLine { }, -- tab pages line, not active tab page label -- TabLine { }, -- tab pages line, not active tab page label
-- TabLineFill { }, -- tab pages line, where there are no labels -- TabLineFill { }, -- tab pages line, where there are no labels
-- TabLineSel { }, -- tab pages line, active tab page label -- TabLineSel { }, -- tab pages line, active tab page label
-- Title { fg = c.light_yellow, gui = "bold" }, -- titles for output from ":set all", ":autocmd" etc. -- Title { fg = c.light_yellow, gui = "bold" }, -- titles for output from ":set all", ":autocmd" etc.
-- Visual { fg = c.grey_1, bg = c.grey_4 }, -- Visual mode selection -- Visual { fg = c.grey_1, bg = c.grey_4 }, -- Visual mode selection
-- VisualNOS { fg = c.grey_1, bg = c.grey_5 }, -- Visual mode selection when vim is "Not Owning the Selection". -- VisualNOS { fg = c.grey_1, bg = c.grey_5 }, -- Visual mode selection when vim is "Not Owning the Selection".
-- WarningMsg { fg = c.red }, -- warning messages -- WarningMsg { fg = c.red }, -- warning messages
-- Whitespace { }, -- "nbsp", "space", "tab" and "trail" in 'listchars' -- Whitespace { }, -- "nbsp", "space", "tab" and "trail" in 'listchars'
-- WildMenu { }, -- current match in 'wildmenu' completion -- WildMenu { }, -- current match in 'wildmenu' completion
-- These groups are not listed as default vim groups, -- These groups are not listed as default vim groups,
-- but they are defacto standard group names for syntax highlighting. -- but they are defacto standard group names for syntax highlighting.
-- commented out groups should chain up to their "preferred" group by -- commented out groups should chain up to their "preferred" group by
-- default, -- default,
-- Uncomment and edit if you want more specific syntax highlighting. -- Uncomment and edit if you want more specific syntax highlighting.
-- Constant { fg = c.orange }, -- (preferred) any constant -- Constant { fg = c.orange }, -- (preferred) any constant
-- String { fg = c.bright_green, gui = italic }, -- a string constant: "this is a string" -- String { fg = c.bright_green, gui = italic }, -- a string constant: "this is a string"
-- Character { }, -- a character constant: 'c', '\n' -- Character { }, -- a character constant: 'c', '\n'
-- Number { fg = c.orange }, -- a number constant: 234, 0xff -- Number { fg = c.orange }, -- a number constant: 234, 0xff
Boolean { fg = c.red }, -- a boolean constant: TRUE, false Boolean({ fg = c.red }), -- a boolean constant: TRUE, false
Float { classic.Number }, -- a floating point constant: 2.3e10 Float({ classic.Number }), -- a floating point constant: 2.3e10
-- Identifier { classic.Identifier }, -- (preferred) any variable name -- Identifier { classic.Identifier }, -- (preferred) any variable name
-- Function { classic.Function }, -- function name (also: methods for classes) -- Function { classic.Function }, -- function name (also: methods for classes)
-- Statement { fg = c.purple }, -- (preferred) any statement -- Statement { fg = c.purple }, -- (preferred) any statement
Conditional { classic.Statement }, -- if, then, else, endif, switch, etc. Conditional({ classic.Statement }), -- if, then, else, endif, switch, etc.
Repeat { classic.Statement }, -- for, do, while, etc. Repeat({ classic.Statement }), -- for, do, while, etc.
Label { fg = c.magenta }, -- case, default, etc. Label({ fg = c.magenta }), -- case, default, etc.
Operator { fg = c.magenta }, -- "sizeof", "+", "*", etc. Operator({ fg = c.magenta }), -- "sizeof", "+", "*", etc.
-- Keyword { classic.Keyword }, -- any other keyword -- Keyword { classic.Keyword }, -- any other keyword
Exception { fg = c.orange }, -- try, catch, throw Exception({ fg = c.orange }), -- try, catch, throw
-- PreProc { fg = c.orange }, -- (preferred) generic Preprocessor -- PreProc { fg = c.orange }, -- (preferred) generic Preprocessor
-- Include { }, -- preprocessor #include -- Include { }, -- preprocessor #include
-- Define { }, -- preprocessor #define -- Define { }, -- preprocessor #define
-- Macro { }, -- same as Define -- Macro { }, -- same as Define
-- PreCondit { }, -- preprocessor #if, #else, #endif, etc. -- PreCondit { }, -- preprocessor #if, #else, #endif, etc.
-- Type { classic.Type }, -- (preferred) int, long, char, etc. -- Type { classic.Type }, -- (preferred) int, long, char, etc.
-- StorageClass { }, -- static, register, volatile, etc. -- StorageClass { }, -- static, register, volatile, etc.
-- Structure { }, -- struct, union, enum, etc. -- Structure { }, -- struct, union, enum, etc.
-- Typedef { }, -- A typedef -- Typedef { }, -- A typedef
-- Special { classic.Special }, -- (preferred) any special symbol -- Special { classic.Special }, -- (preferred) any special symbol
-- SpecialChar { }, -- special character in a constant -- SpecialChar { }, -- special character in a constant
-- Tag { }, -- you can use CTRL-] on this -- Tag { }, -- you can use CTRL-] on this
Delimiter { fg = c.purple }, -- character that needs attention Delimiter({ fg = c.purple }), -- character that needs attention
-- SpecialComment { }, -- special things inside a comment -- SpecialComment { }, -- special things inside a comment
-- Debug { }, -- debugging statements -- Debug { }, -- debugging statements
-- Underlined { gui = "underline" }, -- (preferred) text that stands out, HTML links -- Underlined { gui = "underline" }, -- (preferred) text that stands out, HTML links
-- Bold { gui = "bold" }, -- Bold { gui = "bold" },
-- Italic { gui = "italic" }, -- Italic { gui = "italic" },
-- ("Ignore", below, may be invisible...) -- ("Ignore", below, may be invisible...)
-- Ignore { }, -- (preferred) left blank, hidden |hl-Ignore| -- Ignore { }, -- (preferred) left blank, hidden |hl-Ignore|
-- Error { }, -- (preferred) any erroneous construct -- Error { }, -- (preferred) any erroneous construct
-- Todo { fg = c.grey_3, gui = italic }, -- (preferred) anything that needs extra attention; mostly the keywords TODO FIXME and XXX -- Todo { fg = c.grey_3, gui = italic }, -- (preferred) anything that needs extra attention; mostly the keywords TODO FIXME and XXX
-- These groups are for the native LSP client. Some other LSP clients may -- These groups are for the native LSP client. Some other LSP clients may
-- use these groups, or use their own. Consult your LSP client's -- use these groups, or use their own. Consult your LSP client's
-- documentation. -- documentation.
-- LspReferenceText { }, -- used for highlighting "text" references -- LspReferenceText { }, -- used for highlighting "text" references
-- LspReferenceRead { }, -- used for highlighting "read" references -- LspReferenceRead { }, -- used for highlighting "read" references
-- LspReferenceWrite { }, -- used for highlighting "write" references -- LspReferenceWrite { }, -- used for highlighting "write" references
-- LspDiagnosticsDefaultError { }, -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline) -- LspDiagnosticsDefaultError { }, -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
-- LspDiagnosticsDefaultWarning { }, -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline) -- LspDiagnosticsDefaultWarning { }, -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
-- LspDiagnosticsDefaultInformation { }, -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline) -- LspDiagnosticsDefaultInformation { }, -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
-- LspDiagnosticsDefaultHint { }, -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline) -- LspDiagnosticsDefaultHint { }, -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
-- LspDiagnosticsVirtualTextError { }, -- Used for "Error" diagnostic virtual text -- LspDiagnosticsVirtualTextError { }, -- Used for "Error" diagnostic virtual text
-- LspDiagnosticsVirtualTextWarning { }, -- Used for "Warning" diagnostic virtual text -- LspDiagnosticsVirtualTextWarning { }, -- Used for "Warning" diagnostic virtual text
-- LspDiagnosticsVirtualTextInformation { }, -- Used for "Information" diagnostic virtual text -- LspDiagnosticsVirtualTextInformation { }, -- Used for "Information" diagnostic virtual text
-- LspDiagnosticsVirtualTextHint { }, -- Used for "Hint" diagnostic virtual text -- LspDiagnosticsVirtualTextHint { }, -- Used for "Hint" diagnostic virtual text
-- LspDiagnosticsUnderlineError { }, -- Used to underline "Error" diagnostics -- LspDiagnosticsUnderlineError { }, -- Used to underline "Error" diagnostics
-- LspDiagnosticsUnderlineWarning { }, -- Used to underline "Warning" diagnostics -- LspDiagnosticsUnderlineWarning { }, -- Used to underline "Warning" diagnostics
-- LspDiagnosticsUnderlineInformation { }, -- Used to underline "Information" diagnostics -- LspDiagnosticsUnderlineInformation { }, -- Used to underline "Information" diagnostics
-- LspDiagnosticsUnderlineHint { }, -- Used to underline "Hint" diagnostics -- LspDiagnosticsUnderlineHint { }, -- Used to underline "Hint" diagnostics
-- LspDiagnosticsFloatingError { }, -- Used to color "Error" diagnostic messages in diagnostics float -- LspDiagnosticsFloatingError { }, -- Used to color "Error" diagnostic messages in diagnostics float
-- LspDiagnosticsFloatingWarning { }, -- Used to color "Warning" diagnostic messages in diagnostics float -- LspDiagnosticsFloatingWarning { }, -- Used to color "Warning" diagnostic messages in diagnostics float
-- LspDiagnosticsFloatingInformation { }, -- Used to color "Information" diagnostic messages in diagnostics float -- LspDiagnosticsFloatingInformation { }, -- Used to color "Information" diagnostic messages in diagnostics float
-- LspDiagnosticsFloatingHint { }, -- Used to color "Hint" diagnostic messages in diagnostics float -- LspDiagnosticsFloatingHint { }, -- Used to color "Hint" diagnostic messages in diagnostics float
-- LspDiagnosticsSignError { }, -- Used for "Error" signs in sign column -- LspDiagnosticsSignError { }, -- Used for "Error" signs in sign column
-- LspDiagnosticsSignWarning { }, -- Used for "Warning" signs in sign column -- LspDiagnosticsSignWarning { }, -- Used for "Warning" signs in sign column
-- LspDiagnosticsSignInformation { }, -- Used for "Information" signs in sign column -- LspDiagnosticsSignInformation { }, -- Used for "Information" signs in sign column
-- LspDiagnosticsSignHint { }, -- Used for "Hint" signs in sign column -- LspDiagnosticsSignHint { }, -- Used for "Hint" signs in sign column
-- LspCodeLens { }, -- Used to color the virtual text of the codelens -- LspCodeLens { }, -- Used to color the virtual text of the codelens
-- These groups are for the neovim tree-sitter highlights. -- These groups are for the neovim tree-sitter highlights.
-- As of writing, tree-sitter support is a WIP, group names may change. -- As of writing, tree-sitter support is a WIP, group names may change.
-- By default, most of these groups link to an appropriate Vim group, -- By default, most of these groups link to an appropriate Vim group,
-- TSError -> Error for example, so you do not have to define these unless -- TSError -> Error for example, so you do not have to define these unless
-- you explicitly want to support Treesitter's improved syntax awareness. -- you explicitly want to support Treesitter's improved syntax awareness.
-- TSAnnotation { }, -- For C++/Dart attributes, annotations that can be attached to the code to denote some kind of meta information. -- TSAnnotation { }, -- For C++/Dart attributes, annotations that can be attached to the code to denote some kind of meta information.
-- TSAttribute { }, -- (unstable) TODO: docs -- TSAttribute { }, -- (unstable) TODO: docs
-- TSBoolean { }, -- For booleans. -- TSBoolean { }, -- For booleans.
-- TSCharacter { }, -- For characters. -- TSCharacter { }, -- For characters.
-- TSComment { }, -- For comment blocks. -- TSComment { }, -- For comment blocks.
-- TSConstructor { }, -- For constructor calls and definitions: ` { }` in Lua, and Java constructors. -- TSConstructor { }, -- For constructor calls and definitions: ` { }` in Lua, and Java constructors.
-- TSConditional { }, -- For keywords related to conditionnals. -- TSConditional { }, -- For keywords related to conditionnals.
-- TSConstant { }, -- For constants -- TSConstant { }, -- For constants
-- TSConstBuiltin { }, -- For constant that are built in the language: `nil` in Lua. -- TSConstBuiltin { }, -- For constant that are built in the language: `nil` in Lua.
-- TSConstMacro { }, -- For constants that are defined by macros: `NULL` in C. -- TSConstMacro { }, -- For constants that are defined by macros: `NULL` in C.
-- TSError { }, -- For syntax/parser errors. -- TSError { }, -- For syntax/parser errors.
-- TSException { }, -- For exception related keywords. -- TSException { }, -- For exception related keywords.
-- TSField { }, -- For fields. -- TSField { }, -- For fields.
-- TSFloat { }, -- For floats. -- TSFloat { }, -- For floats.
TSFunction { classic.Function }, -- For function (calls and definitions). TSFunction({ classic.Function }), -- For function (calls and definitions).
-- TSFuncBuiltin { }, -- For builtin functions: `table.insert` in Lua. -- TSFuncBuiltin { }, -- For builtin functions: `table.insert` in Lua.
-- TSFuncMacro { }, -- For macro defined fuctions (calls and definitions): each `macro_rules` in Rust. -- TSFuncMacro { }, -- For macro defined fuctions (calls and definitions): each `macro_rules` in Rust.
-- TSInclude { }, -- For includes: `#include` in C, `use` or `extern crate` in Rust, or `require` in Lua. -- TSInclude { }, -- For includes: `#include` in C, `use` or `extern crate` in Rust, or `require` in Lua.
TSKeyword { classic.Keyword }, -- For keywords that don't fall in previous categories. TSKeyword({ classic.Keyword }), -- For keywords that don't fall in previous categories.
-- TSKeywordFunction { }, -- For keywords used to define a fuction. -- TSKeywordFunction { }, -- For keywords used to define a fuction.
-- TSLabel { }, -- For labels: `label:` in C and `:label:` in Lua. -- TSLabel { }, -- For labels: `label:` in C and `:label:` in Lua.
TSMethod { classic.Function }, -- For method calls and definitions. TSMethod({ classic.Function }), -- For method calls and definitions.
-- TSNamespace { }, -- For identifiers referring to modules and namespaces. -- TSNamespace { }, -- For identifiers referring to modules and namespaces.
-- TSNone { }, -- TODO: docs -- TSNone { }, -- TODO: docs
-- TSNumber { }, -- For all numbers -- TSNumber { }, -- For all numbers
-- TSOperator { }, -- For any operator: `+`, but also `->` and `*` in C. -- TSOperator { }, -- For any operator: `+`, but also `->` and `*` in C.
-- TSParameter { }, -- For parameters of a function. -- TSParameter { }, -- For parameters of a function.
-- TSParameterReference { }, -- For references to parameters of a function. -- TSParameterReference { }, -- For references to parameters of a function.
TSProperty { classic.Identifier }, -- Same as `TSField`. TSProperty({ classic.Identifier }), -- Same as `TSField`.
-- TSPunctDelimiter { }, -- For delimiters ie: `.` -- TSPunctDelimiter { }, -- For delimiters ie: `.`
-- TSPunctBracket { }, -- For brackets and parens. -- TSPunctBracket { }, -- For brackets and parens.
-- TSPunctSpecial { }, -- For special punctutation that does not fall in the catagories before. -- TSPunctSpecial { }, -- For special punctutation that does not fall in the catagories before.
-- TSRepeat { }, -- For keywords related to loops. -- TSRepeat { }, -- For keywords related to loops.
-- TSString { }, -- For strings. -- TSString { }, -- For strings.
-- TSStringRegex { }, -- For regexes. -- TSStringRegex { }, -- For regexes.
-- TSStringEscape { }, -- For escape characters within a string. -- TSStringEscape { }, -- For escape characters within a string.
-- TSSymbol { }, -- For identifiers referring to symbols or atoms. -- TSSymbol { }, -- For identifiers referring to symbols or atoms.
TSType { classic.Type }, -- For types. TSType({ classic.Type }), -- For types.
-- TSTypeBuiltin { }, -- For builtin types. -- TSTypeBuiltin { }, -- For builtin types.
TSVariable { classic.Special }, -- Any variable name that does not have another highlight. TSVariable({ classic.Special }), -- Any variable name that does not have another highlight.
-- TSVariableBuiltin { }, -- Variable names that are defined by the languages, like `this` or `self`. -- TSVariableBuiltin { }, -- Variable names that are defined by the languages, like `this` or `self`.
-- TSTag { }, -- Tags like html tag names. -- TSTag { }, -- Tags like html tag names.
-- TSTagDelimiter { }, -- Tag delimiter like `<` `>` `/` -- TSTagDelimiter { }, -- Tag delimiter like `<` `>` `/`
TSText { fg = Normal.fg }, -- For strings considered text in a markup language. TSText({ fg = Normal.fg }), -- For strings considered text in a markup language.
-- TSEmphasis { }, -- For text to be represented with emphasis. -- TSEmphasis { }, -- For text to be represented with emphasis.
-- TSUnderline { }, -- For text to be represented with an underline. -- TSUnderline { }, -- For text to be represented with an underline.
-- TSStrike { }, -- For strikethrough text. -- TSStrike { }, -- For strikethrough text.
-- TSTitle { }, -- Text that is part of a title. -- TSTitle { }, -- Text that is part of a title.
-- TSLiteral { }, -- Literal text. -- TSLiteral { }, -- Literal text.
-- TSURI { }, -- Any URI like a link or email. -- TSURI { }, -- Any URI like a link or email.
-- gray -- Link all uncommented TS values to their semantic equivalents
CmpItemAbbrDeprecated { fg = c.grey, gui = "strikethrough" }, sym("@function")({ TSFunction }),
-- blue sym("@keyword")({ TSKeyword }),
CmpItemAbbrMatch { fg = c.green }, sym("@method")({ TSMethod }),
CmpItemAbbrMatchFuzzy { CmpItemAbbrMatch }, sym("@property")({ TSProperty }),
-- light blue sym("@type")({ TSType }),
CmpItemKindVariable { TSVariable }, sym("@variable")({ TSVariable }),
CmpItemKindInterface { TSType }, sym("@text")({ TSText }),
CmpItemKindText { TSText },
-- pink -- cmp highlights
CmpItemKindFunction { TSFunction }, CmpItemAbbrDeprecated({ fg = c.green, gui = "strikethrough" }),
CmpItemKindMethod { TSMethod }, CmpItemAbbrMatch({ fg = c.green }),
-- front CmpItemAbbrMatchFuzzy({ CmpItemAbbrMatch }),
CmpItemKindKeyword { TSKeyword }, CmpItemKindVariable({ TSVariable }),
CmpItemKindProperty { TSProperty }, CmpItemKindInterface({ TSType }),
-- CmpItemKindUnit { Normal }, CmpItemKindText({ TSText }),
} CmpItemKindFunction({ TSFunction }),
CmpItemKindMethod({ TSMethod }),
CmpItemKindKeyword({ TSKeyword }),
CmpItemKindProperty({ TSProperty }),
-- CmpItemKindUnit { Normal },
}
end) end)
-- return our parsed theme for extension or use else where. -- return our parsed theme for extension or use else where.