From b17b727a5a55adab787a54b1b5ffe0d28123d4de Mon Sep 17 00:00:00 2001 From: Tyler Miller Date: Sun, 28 Jul 2024 20:41:12 -0700 Subject: [PATCH] fix(treesitter): don't hl keys in lua table literals This brings it more in-line with GitHub.com, and also seems to improve contrast and legibility (especially when all the values are numbers). --- .gitignore | 4 ++++ lua/github-theme/config.lua | 6 +++--- lua/github-theme/group/modules/treesitter.lua | 5 +++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index ec3042c..0431f44 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,7 @@ misc node_modules/ /cache /.cache + +# Lua LSP +/.log +/.meta diff --git a/lua/github-theme/config.lua b/lua/github-theme/config.lua index 7aad864..5a3bc32 100644 --- a/lua/github-theme/config.lua +++ b/lua/github-theme/config.lua @@ -7,9 +7,9 @@ local M = { theme = 'github_dark', has_options = false } -- TODO: improve type of `specs` and `palettes` ---@class (exact) GhTheme.Config ---@field options? GhTheme.Config.Options ----@field palettes? table ----@field specs? table ----@field groups? table> +---@field palettes? table|false +---@field specs? table|false +---@field groups? table>|false ---@class (exact) GhTheme.Config.Module ---@field enable? boolean whether to set plugin-specific highlights for this module/plugin diff --git a/lua/github-theme/group/modules/treesitter.lua b/lua/github-theme/group/modules/treesitter.lua index 5a1a30b..70cdf67 100644 --- a/lua/github-theme/group/modules/treesitter.lua +++ b/lua/github-theme/group/modules/treesitter.lua @@ -264,13 +264,14 @@ If you want to stay on nvim 0.7, disable the module, or track on 'v0.0.x' branch ['@lsp.type.variable.lua'] = { fg = spec.variable }, ['@constructor.lua'] = { fg = syn.bracket }, -- {} ['@operator.lua'] = { fg = syn.keyword, style = stl.operators }, - -- ['@property'] = { fg = syn.variable }, + ['@property.lua'] = { fg = syn.ident }, -- ['@function.call.lua'] = { fg = syn.const }, -- ['@function.method.call.lua'] = { link = '@function.call.lua' }, ['@function.builtin.lua'] = { fg = syn.builtin0, style = stl.functions }, ['@module.builtin.lua'] = { fg = syn.builtin0, style = stl.variables }, -- `table`, `io`, `_G` -- ['@label.lua'] = { fg = syn.string }, -- The `LABEL` in `::LABEL::` and `goto LABEL` - ['@variable.member.luadoc'] = { link = '@variable.member.lua' }, + ['@property.luadoc'] = { link = '@property.lua' }, + ['@variable.member.luadoc'] = { link = '@property.luadoc' }, ['@operator.luadoc'] = { fg = spec.fg1 }, -- The `|` in `string|number` ['@markup.list.luadoc'] = { fg = spec.fg1 }, -- The `?` in `string?`