From 3ab6f60dc80d36f968102ba14b7c4ec96efeb56d Mon Sep 17 00:00:00 2001 From: Evgeni Chasnovski Date: Thu, 25 Jan 2024 13:28:26 +0200 Subject: [PATCH] fix(runtime): update 'vim' color scheme to use new tree-sitter groups --- runtime/colors/vim.lua | 63 +++++++++---------- test/functional/treesitter/highlight_spec.lua | 25 ++++---- 2 files changed, 43 insertions(+), 45 deletions(-) diff --git a/runtime/colors/vim.lua b/runtime/colors/vim.lua index 4e16b6e036..67f9ddd643 100644 --- a/runtime/colors/vim.lua +++ b/runtime/colors/vim.lua @@ -132,12 +132,12 @@ hi('LspInlayHint', { link = 'NonText' }) hi('SnippetTabstop', { link = 'Visual' }) -- Text -hi('@text.literal', { link = 'Comment' }) -hi('@text.reference', { link = 'Identifier' }) -hi('@text.title', { link = 'Title' }) -hi('@text.uri', { link = 'Underlined' }) -hi('@text.underline', { link = 'Underlined' }) -hi('@text.todo', { link = 'Todo' }) +hi('@markup.raw', { link = 'Comment' }) +hi('@markup.link', { link = 'Identifier' }) +hi('@markup.heading', { link = 'Title' }) +hi('@markup.link.url', { link = 'Underlined' }) +hi('@markup.underline', { link = 'Underlined' }) +hi('@comment.todo', { link = 'Todo' }) -- Miscs hi('@comment', { link = 'Comment' }) @@ -147,8 +147,7 @@ hi('@punctuation', { link = 'Delimiter' }) hi('@constant', { link = 'Constant' }) hi('@constant.builtin', { link = 'Special' }) hi('@constant.macro', { link = 'Define' }) -hi('@define', { link = 'Define' }) -hi('@macro', { link = 'Macro' }) +hi('@keyword.directive', { link = 'Define' }) hi('@string', { link = 'String' }) hi('@string.escape', { link = 'SpecialChar' }) hi('@string.special', { link = 'SpecialChar' }) @@ -156,35 +155,35 @@ hi('@character', { link = 'Character' }) hi('@character.special', { link = 'SpecialChar' }) hi('@number', { link = 'Number' }) hi('@boolean', { link = 'Boolean' }) -hi('@float', { link = 'Float' }) +hi('@number.float', { link = 'Float' }) -- Functions -hi('@function', { link = 'Function' }) -hi('@function.builtin', { link = 'Special' }) -hi('@function.macro', { link = 'Macro' }) -hi('@parameter', { link = 'Identifier' }) -hi('@method', { link = 'Function' }) -hi('@field', { link = 'Identifier' }) -hi('@property', { link = 'Identifier' }) -hi('@constructor', { link = 'Special' }) +hi('@function', { link = 'Function' }) +hi('@function.builtin', { link = 'Special' }) +hi('@function.macro', { link = 'Macro' }) +hi('@variable.parameter', { link = 'Identifier' }) +hi('@function.method', { link = 'Function' }) +hi('@variable.member', { link = 'Identifier' }) +hi('@property', { link = 'Identifier' }) +hi('@constructor', { link = 'Special' }) -- Keywords -hi('@conditional', { link = 'Conditional' }) -hi('@repeat', { link = 'Repeat' }) -hi('@label', { link = 'Label' }) -hi('@operator', { link = 'Operator' }) -hi('@keyword', { link = 'Keyword' }) -hi('@exception', { link = 'Exception' }) +hi('@keyword.conditional', { link = 'Conditional' }) +hi('@keyword.repeat', { link = 'Repeat' }) +hi('@label', { link = 'Label' }) +hi('@operator', { link = 'Operator' }) +hi('@keyword', { link = 'Keyword' }) +hi('@keyword.exception', { link = 'Exception' }) -hi('@variable', { link = 'Identifier' }) -hi('@type', { link = 'Type' }) -hi('@type.definition', { link = 'Typedef' }) -hi('@storageclass', { link = 'StorageClass' }) -hi('@namespace', { link = 'Identifier' }) -hi('@include', { link = 'Include' }) -hi('@preproc', { link = 'PreProc' }) -hi('@debug', { link = 'Debug' }) -hi('@tag', { link = 'Tag' }) +hi('@variable', { link = 'Identifier' }) +hi('@type', { link = 'Type' }) +hi('@type.definition', { link = 'Typedef' }) +hi('@keyword.storage', { link = 'StorageClass' }) +hi('@module', { link = 'Identifier' }) +hi('@keyword.import', { link = 'Include' }) +hi('@keyword.directive', { link = 'PreProc' }) +hi('@keyword.debug', { link = 'Debug' }) +hi('@tag', { link = 'Tag' }) -- LSP semantic tokens hi('@lsp.type.class', { link = 'Structure' }) diff --git a/test/functional/treesitter/highlight_spec.lua b/test/functional/treesitter/highlight_spec.lua index 2efdad1efa..932af0332b 100644 --- a/test/functional/treesitter/highlight_spec.lua +++ b/test/functional/treesitter/highlight_spec.lua @@ -745,7 +745,6 @@ describe('treesitter highlighting (help)', function() [3] = { bold = true, foreground = Screen.colors.Brown }, [4] = { foreground = Screen.colors.Cyan4 }, [5] = { foreground = Screen.colors.Magenta1 }, - [6] = { foreground = Screen.colors.SlateBlue }, } end) @@ -764,10 +763,10 @@ describe('treesitter highlighting (help)', function() screen:expect { grid = [[ - {6:>ruby} | - {6: -- comment} | - {6: local this_is = 'actually_lua'} | - {6:<} | + {1:>ruby} | + {1: -- comment} | + {1: local this_is = 'actually_lua'} | + {1:<} | ^ | | ]], @@ -777,10 +776,10 @@ describe('treesitter highlighting (help)', function() screen:expect { grid = [[ - {6:>lua} | - {6: }{1:-- comment} | - {6: }{3:local}{6: }{4:this_is}{6: }{3:=}{6: }{5:'actually_lua'} | - {6:<} | + {1:>lua} | + {1: -- comment} | + {1: }{3:local}{1: }{4:this_is}{1: }{3:=}{1: }{5:'actually_lua'} | + {1:<} | ^ | | ]], @@ -790,10 +789,10 @@ describe('treesitter highlighting (help)', function() screen:expect { grid = [[ - {6:>ruby} | - {6: -- comment} | - {6: local this_is = 'actually_lua'} | - {6:<} | + {1:>ruby} | + {1: -- comment} | + {1: local this_is = 'actually_lua'} | + {1:<} | ^ | | ]],