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 highlight not working #5

Open
mybadclan opened this issue May 25, 2024 · 3 comments
Open

JSX highlight not working #5

mybadclan opened this issue May 25, 2024 · 3 comments

Comments

@mybadclan
Copy link

Min Theme apply colors to jsx syntax like image below:

screenshot-dark

When I use min-theme.nvim, I have the result below:

Screenshot_20240525_194444

@datsfilipe
Copy link
Owner

datsfilipe commented May 25, 2024

Do you have your treesitter correctly setup? and you installed the parser for jsx?

@mybadclan
Copy link
Author

mybadclan commented May 25, 2024

I run :checkhealth nvim-treesitter and get the result below:

Screenshot_20240525_203308

Screenshot_20240525_203528

My treesitter config is like the code below:

return {
  "nvim-treesitter/nvim-treesitter",
  build = ":TSUpdate",
  config = function()
    -- Tree sitter config
    local config = require("nvim-treesitter.configs")

    config.setup({
      ensure_installed = { "lua", "javascript", "typescript", "html", "json", "css", "tsx" },

      -- auto_install = true,
      highlight = {
	enable = true,
	additional_vim_regex_highlighting = false,
      },
      indent = { enable = true },
    })
  end,
}

@datsfilipe
Copy link
Owner

I have these lines configured in mine treesitter config, see if it helps you:

local parser_config = require('nvim-treesitter.parsers').get_parser_configs()
parser_config.tsx.filetype_to_parsername = { 'javascript', 'typescript.tsx' }

The theme works well for me in tsx/jsx files, so I think it probably is some configuration problem.

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