olivercederborg / poimandres.nvim

Poimandres colorscheme for Neovim written in Lua
322 stars 28 forks source link

syntax highlighting for tsx/jsx not working #39

Open sherloach opened 9 months ago

sherloach commented 9 months ago

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 commented 8 months ago

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 commented 3 months ago

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

austincm commented 2 months ago

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

leweyse commented 2 months ago

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 commented 2 months ago

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: https://github.com/olivercederborg/poimandres.nvim/pull/43