From d244ee75951d93cbef15bddc68ad987073d73d13 Mon Sep 17 00:00:00 2001 From: gbprod Date: Wed, 24 Jan 2024 17:24:05 +0100 Subject: [PATCH] feat(treesitter): improve treesitter (#59) * feat(treesitter): improve php treesitter * fix: diff * fix: diagnostics --- lua/nord/defaults.lua | 3 +++ lua/nord/lsp.lua | 1 + lua/nord/treesitter.lua | 7 ++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lua/nord/defaults.lua b/lua/nord/defaults.lua index 6195ef7..15cd5e7 100644 --- a/lua/nord/defaults.lua +++ b/lua/nord/defaults.lua @@ -73,6 +73,9 @@ function defaluts.highlights() diffAdded = { link = "DiffAdd" }, diffChanged = { link = "DiffChange" }, diffRemoved = { link = "DiffDelete" }, + Added = { link = "DiffAdd" }, + Changed = { link = "DiffChange" }, + Removed = { link = "DiffDelete" }, healthError = { fg = c.aurora.red }, healthSuccess = { fg = c.aurora.green }, healthWarning = { fg = c.aurora.yellow }, diff --git a/lua/nord/lsp.lua b/lua/nord/lsp.lua index d6cc69c..2388037 100644 --- a/lua/nord/lsp.lua +++ b/lua/nord/lsp.lua @@ -9,6 +9,7 @@ function lsp.highlights() -- LspReferenceRead = { bg = c.fg_gutter }, -- used for highlighting "read" references -- LspReferenceWrite = { bg = c.fg_gutter }, -- used for highlighting "write" references + DiagnosticOk = { fg = c.aurora.green }, -- Used as the base highlight group. Other Diagnostic highlights link to this by default DiagnosticError = { fg = c.aurora.red }, -- Used as the base highlight group. Other Diagnostic highlights link to this by default DiagnosticWarn = { fg = c.aurora.yellow }, -- Used as the base highlight group. Other Diagnostic highlights link to this by default DiagnosticInfo = { fg = c.frost.ice }, -- Used as the base highlight group. Other Diagnostic highlights link to this by default diff --git a/lua/nord/treesitter.lua b/lua/nord/treesitter.lua index d09a29b..f592cc2 100644 --- a/lua/nord/treesitter.lua +++ b/lua/nord/treesitter.lua @@ -91,6 +91,9 @@ function treesitter.highlights() ["@text.danger"] = { fg = c.aurora.red }, -- danger/error notes ["@text.diff.add"] = { link = "DiffAdd" }, -- added text (for diff files) ["@text.diff.delete"] = { link = "DiffDelete" }, -- deleted text (for diff files) + ["@diff.diff"] = { link = "DiffAdd" }, -- added text (for diff files) + ["@diff.minus"] = { link = "DiffDelete" }, -- deleted text (for diff files) + ["@diff.delta"] = { link = "DiffChange" }, -- Tags ["@tag"] = { fg = c.frost.artic_water }, -- XML tag names @@ -106,9 +109,11 @@ function treesitter.highlights() -- Language specific ["@constant.git_rebase"] = { fg = c.frost.polar_water }, - ["@field.yaml"] = { fg = c.frost.polar_water }, + ["@property.yaml"] = { fg = c.frost.polar_water }, ["@text.phpdoc"] = { fg = c.polar_night.light }, ["@attribute.phpdoc"] = { fg = c.frost.artic_water }, + ["@module.php"] = { fg = c.snow_storm.origin }, + ["@variable.parameter.php"] = { fg = c.frost.polar_water }, -- LSP Semantic Token Groups ["@lsp.type.class"] = { link = "@type" },