Skip to content

Commit

Permalink
fix(treesitter): don't hl keys in lua table literals
Browse files Browse the repository at this point in the history
This brings it more in-line with GitHub.com, and also seems to improve
contrast and legibility (especially when all the values are numbers).
  • Loading branch information
tmillr committed Jul 29, 2024
1 parent 41c8c35 commit b17b727
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ misc
node_modules/
/cache
/.cache

# Lua LSP
/.log
/.meta
6 changes: 3 additions & 3 deletions lua/github-theme/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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<GhTheme.Theme|"all", table>
---@field specs? table<GhTheme.Theme|"all", table>
---@field groups? table<GhTheme.Theme|"all", table<string, GhTheme.HighlightGroup>>
---@field palettes? table<GhTheme.Theme|"all", table>|false
---@field specs? table<GhTheme.Theme|"all", table>|false
---@field groups? table<GhTheme.Theme|"all", table<string, GhTheme.HighlightGroup|false>>|false

---@class (exact) GhTheme.Config.Module
---@field enable? boolean whether to set plugin-specific highlights for this module/plugin
Expand Down
5 changes: 3 additions & 2 deletions lua/github-theme/group/modules/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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?`

Expand Down

0 comments on commit b17b727

Please sign in to comment.