vscode.nvim
vscode.nvim copied to clipboard
python colors for constants and modules are not unique, and dont match VSCode's real colors
The color of imported modules in python is identical to the color of regular local variables. Also, the color for CONSTANTS is identical to the color of regular functions
example - left is neovim, right is VSCode
This issue isnt about being 100% identical to VSCode, but about having unique colors for constants and modules which is nice. I do have treesitter installed.
OK so digging into it i found that:
-
imported modules are treated with the hl group
TSVariable
which is why they have the same color as variables. I guess this is a TreeSitter problem that it does not give modules a new group (though they are technically just variables in python). Correct me if im wrong on this one. -
Constants belong to
TSConstant
and are givenvscYellow
color by default. In VSCode the color for constants in python is#4fc1ff
. CPP constants in VSCode are of the colorvscBlue
which looks better than yellow IMO.
to anyone interested this can be changed with: For all constants:
local vs_colors = require("vscode.colors")
require("vscode").setup({
group_overrides = {
TSConstant = { fg = vs_colors.vscBlue },
},
})
Just for python colors:
if "vscode" == vim.g.colors_name then
require("vscode").setup({
group_overrides = {
TSConstant = { fg = "#4fc1ff" },
},
})
end
Maintainers, please decide if you want to apply this change.
this seems to be fixed @CyberMango