From 669b0ce7d02d511c06ceae6201392dc29906dfc0 Mon Sep 17 00:00:00 2001 From: EdenEast Date: Tue, 11 Apr 2023 20:51:15 -0400 Subject: [PATCH] fix(module): remove `TS` prefix from cmp links --- lua/nightfox/group/modules/cmp.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lua/nightfox/group/modules/cmp.lua b/lua/nightfox/group/modules/cmp.lua index e6f16857..f53a0f5d 100644 --- a/lua/nightfox/group/modules/cmp.lua +++ b/lua/nightfox/group/modules/cmp.lua @@ -3,6 +3,7 @@ local M = {} function M.get(spec, config, opts) + local has_ts = config.modules.treesitter local syn = spec.syntax -- stylua: ignore @@ -20,8 +21,8 @@ function M.get(spec, config, opts) CmpItemKindKeyword = { link = "Identifier" }, - CmpItemKindVariable = { link = "TSVariable" }, - CmpItemKindConstant = { link = "TSConstant" }, + CmpItemKindVariable = { link = has_ts and "@variable" or "Identifier" }, + CmpItemKindConstant = { link = has_ts and "@constant" or "Constant" }, CmpItemKindReference = { link = "Keyword" }, CmpItemKindValue = { link = "Keyword" }, @@ -37,12 +38,12 @@ function M.get(spec, config, opts) CmpItemKindClass = { link = "Type" }, CmpItemKindStruct = { link = "Type" }, - CmpItemKindModule = { link = "TSNamespace" }, + CmpItemKindModule = { link = has_ts and "@namespace" or "Identifier" }, - CmpItemKindProperty = { link = "TSProperty" }, - CmpItemKindField = { link = "TSField" }, - CmpItemKindTypeParameter = { link = "TSField" }, - CmpItemKindEnumMember = { link = "TSField" }, + CmpItemKindProperty = { link = has_ts and "@property" or "Identifier" }, + CmpItemKindField = { link = has_ts and "@field" or "Identifier" }, + CmpItemKindTypeParameter = { link = has_ts and "@field" or "Identifier" }, + CmpItemKindEnumMember = { link = has_ts and "@field" or "Identifier" }, CmpItemKindOperator = { link = "Operator" }, CmpItemKindSnippet = { fg = spec.fg2 }, }