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

JSX components highlight support #79

Open
Maverick5000 opened this issue Mar 1, 2024 · 4 comments
Open

JSX components highlight support #79

Maverick5000 opened this issue Mar 1, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@Maverick5000
Copy link

Is your feature request related to a problem? Please describe.

HTML tags are the same color than JSX tags

image

Describe the solution you'd like

Different coloring for React components and HTML tags, similar to vscode one monokai theme

image

Describe alternatives you've considered

I've seen some post's mentioning treesitter changed the way highlighting is done for some tags since some themes support this color difference ex: tokyonight

image

Additional context

No response

@Maverick5000 Maverick5000 added the enhancement New feature or request label Mar 1, 2024
@cpea2506
Copy link
Owner

cpea2506 commented Mar 1, 2024

Hi, currently I'm not a React user anymore so I will need time to investigate and think on how to make it fit your experience. If you have something in your mind. Please consider a PR, that way you may add more useful changes to help improve the theme beside your current request. Thanks a lot <3

@Maverick5000
Copy link
Author

I've been trying to find the solution, but I'm new to the Neovim ecosystem, so I'm mostly lost when trying to do stuff. Anyway, if I find something, I'll be happy to make a PR. 😁

@cpea2506
Copy link
Owner

cpea2506 commented Mar 3, 2024

Hi, if you are using Neovim 0.9 or above, I think it could be because semantic token is enable by default. Could you please try the code below and tell me the result?

-- Hide all semantic highlights
for _, group in ipairs(vim.fn.getcompletion("@lsp", "highlight")) do
    vim.api.nvim_set_hl(0, group, {})
end

Also, you can put the cursor inside any of your component and execute :Inspect. This command will show the highlight group that your component currently has.

@Maverick5000
Copy link
Author

Maverick5000 commented Mar 4, 2024

I tested the code snippet but it didn't make any difference in the highlighting. However, using :Inspect helped me a bunch! I managed to change the color using the highlight group. ["@tag.tsx"] = { fg = colors.aqua },

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

No branches or pull requests

2 participants