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

bug: different keyword color with vscode OneMonokai #88

Closed
xanahopper opened this issue Jul 1, 2024 · 4 comments
Closed

bug: different keyword color with vscode OneMonokai #88

xanahopper opened this issue Jul 1, 2024 · 4 comments
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@xanahopper
Copy link

xanahopper commented Jul 1, 2024

Describe the bug

as you can see, key words enum, struct or even enum variant, field name have different color.

Same code source in VSCode:
image

with NVim 0.10 and one_monokai.nvim:

image

Screenshots

No response

Operating System + version

macOS 14.5 (23F79)

Neovim version

NVIM v0.10.1-dev-9+g671073e71

Reproduce steps

  1. open same code in VSCode and nvim with OneMonokai color theme.

Expected Behavior

No response

Additional context

No response

@xanahopper xanahopper added the bug Something isn't working label Jul 1, 2024
@cpea2506
Copy link
Owner

cpea2506 commented Jul 5, 2024

Hi, have you tried to disable semantic token highlighting? If semantic token highlighting is enable, some of colors will be decided by language server instead.

If you have disabled it but the issue still happens, please take a picture and note on what are the most clearly difference you see. I will take my time for a look. Or if you know what to do, please consider a PR, that would be so helpful.

Note:

The color scheme for Neovim is designed in a way that cannot totally mimic the original one from VSCode because of the way they treat the language tokens.

Tips:

You can use :Inspect from within Neovim to see the token's highlight group under your cursor. The result will be like this:

Screenshot 2024-07-05 at 22 33 42

See more:

@xanahopper
Copy link
Author

I'm not sure how to disable semantic token highlighting, but I tried

  • disable Rust LSP
  • disable nvim-treesitter's additional_vim_regex_highlighting
  • disable whole nvim-treesitter

the first two operations did not make a change. After disable LSP & treesitter, color changes, like VSCode but not exactly same.
It becomes like this
image
seems like with nvim builtin syntax, it lost lots of info for colorscheme.

I dont know what to do next.

@xanahopper
Copy link
Author

I reverted all disables and re-enable LSP and Treesitter, do some inspect.

struct, enum

image

Unnamed enum variant

image

@cpea2506 cpea2506 added enhancement New feature or request and removed bug Something isn't working labels Aug 18, 2024
@cpea2506
Copy link
Owner

Hi, sorry for the long wait! I'm afraid we can't make everything identical due to the differences in how the VSCode and Tree-sitter parsers handle token parsing. Adjusting settings for one language might affect another. The best approach is to use the customization settings with the Inspect command to adjust the colors to your preferences. For ex:

require("one_monokai").setup({
    themes = function(colors)
        return {
            -- This will change the color of enum and struct keywords in general.
			["@keyword.type"] = { fg = colors.cyan }
			-- Note that each language can define @keyword.type differently (in most cases).
			-- If this is the case, you can specify the language name at the end.
			["@keyword.type.rust"] = { fg = colors.cyan }
        }
    end,
})

@cpea2506 cpea2506 added the wontfix This will not be worked on label Feb 18, 2025
@cpea2506 cpea2506 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants