Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python colors for constants and modules are not unique, and dont match VSCode's real colors #85

Open
TheResplandor opened this issue Aug 18, 2022 · 2 comments

Comments

@TheResplandor
Copy link

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
image image

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.

@TheResplandor
Copy link
Author

TheResplandor commented Aug 18, 2022

OK so digging into it i found that:

  1. 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.

  2. Constants belong to TSConstant and are given vscYellow color by default. In VSCode the color for constants in python is #4fc1ff. CPP constants in VSCode are of the color vscBlue 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.

@johannesrld
Copy link
Contributor

johannesrld commented May 5, 2024

this seems to be fixed @CyberMango
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants