Open axzilla opened 7 months ago
I've now found out that it's really due to the HTML dot notation. I changed the imports and tags to CamelCase and everything works as expected. That's pretty bad!
I have the same problem, it makes Neovim unusable for Svelte projects.
The grammar that nvim-treesitter installs is actually https://github.com/tree-sitter-grammars/tree-sitter-svelte and not this one (I also got confused because this repo is the first result when searching on Google)
I have opened a PR on tree-sitter-grammars/tree-sitter-svelte
which resolves this issue: https://github.com/tree-sitter-grammars/tree-sitter-svelte/pull/4.
Hopefully, it will be merged quickly because there doesn't seem to be an easy way to override the installation source in nvim-treesitter
🤞
The grammar that nvim-treesitter installs is actually https://github.com/tree-sitter-grammars/tree-sitter-svelte and not this one (I also got confused because this repo is the first result when searching on Google)
I have opened a PR on
tree-sitter-grammars/tree-sitter-svelte
which resolves this issue: tree-sitter-grammars/tree-sitter-svelte#4.Hopefully, it will be merged quickly because there doesn't seem to be an easy way to override the installation source in
nvim-treesitter
🤞
Hey, oh, good to know, thanks for letting me know. I see you already opened a related issue in the right repo. Thanks for that! Hopefully it will be fixed soon!
I am experiencing a problem with the syntax highlighting of Svelte files in Neovim when using Tree-sitter. The highlighting works correctly with smaller files but begins to fail when
each
orif
blocks are introduced, especially in lines involving dot notation (e.g.,<Card.Title>
). This issue persists across different configurations, including setups with LazyVim and AstroVim, indicating it might not be specific to my personal setup. I am using the latest version of Neovim.Environment Details:
Steps to Reproduce:
each
orif
blocks.Expected Behavior:
Syntax highlighting should remain consistent throughout the file, regardless of the presence of Svelte-specific syntax, control structures, or dot notation usage.
Actual Behavior:
Syntax highlighting fails, losing coloration after specific blocks of code are introduced, particularly those involving dot notation.
Additional Notes:
Attempts to resolve the issue by switching themes (e.g., Rose-pine.nvim) or inspecting with
:InspectTree
have not been successful. Further investigation and community support are needed to determine if this is a bug with the Svelte parser integration or a compatibility issue with specific configurations.https://github.com/Himujjal/tree-sitter-svelte/assets/26936893/a623f33b-5dde-4ed7-8205-92a868051bee