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

syntax highlighting for tsx/jsx not working #39

Open
sherloach opened this issue Oct 13, 2023 · 5 comments
Open

syntax highlighting for tsx/jsx not working #39

sherloach opened this issue Oct 13, 2023 · 5 comments

Comments

@sherloach
Copy link

I saw this issue was resolved by #32.
But it's not in my lunar vim.
Screenshot 2023-10-13 at 12 07 05 pm

@ZediWards
Copy link

I saw this issue was resolved by #32. But it's not in my lunar vim. Screenshot 2023-10-13 at 12 07 05 pm

This is the case for me as well. It looks like it going to load the correct colors but the white color turns dark after "tsserver" lsp finishes loading. I don't know if that helps or not.

@itsmejoeyb
Copy link

I'm having this same issue... Anybody find a solution?

@austincm
Copy link

Same, once treesitter kicks in, it looks like garbage. The only reason I don't use this theme anymore.

@leweyse
Copy link

leweyse commented Apr 27, 2024

This has worked for me: client.server_capabilities.semanticTokensProvider = nil. For me, like @ZediWards found, the theme breaks after the lsp finishes to load.

local default_setup = function(server)
  require('lspconfig')[server].setup({
    on_init = function(client)
      client.server_capabilities.semanticTokensProvider = nil
    end,
  })
end

require('mason').setup()
require('mason-lspconfig').setup({ 
  default_setup,
  ...
})

@AlexBeauchemin
Copy link

AlexBeauchemin commented May 6, 2024

I've been able to get closer to the desired result by adding this to theme.lua while running it in dev mode

    ['@variable.builtin.typescript'] = { fg = p.blue2 },
    ['@lsp.type.variable.typescript'] = { fg = p.text },
    ['@lsp.type.parameter.typescript'] = { fg = p.text },
    ['@lsp.type.property.lua'] = { fg = p.text },
    ['@comment.typescript'] = { fg = p.blueGray3 },
    ['@comment.documentation.typescript'] = { fg = p.blueGray3 },

It seems like there's a priority issue with Treesitter and lsp semantic tokens, where lsp semantic token take over treesitter in priority.
I'll look more into it in the next few days as I'm pretty busy right now, but I'm pretty inexperienced in terms of lua/nvim development.
I don't believe this is the correct way to fix the issue but it works. Ideally, we should be able to make treesitter tokens as higher priority but I'm not sure how or if it's even possible.

I'll try to open up a PR soon once I get to something I like

Edit

PR open as a work in progress: #43

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

6 participants