Does anyone know how to have syntax highlighting on svelte files? #2894
-
`nvim-treesitter[svelte]: Error during "tree-sitter generate" Error: Cannot find module 'tree-sitter-html/grammar'
Node.js v20.14.0 Caused by: Press ENTER or type command to continue` |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I know this is a bit complicated, so I just set the filetype to html and it's giving me the highlighting, however, I want to set the default filetype of svelte files to html. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
Treesitter on my machine is kinda neglecting the existence of svelte files, However setting filetype of svelte files to html works, I can have the syntax highlighting when I do :setfiletype html on svelte files and it's okay for me.
I just need now how can I automatically do it without typing the commands everytime.
EDIT
Found a simple solution now, I just created another table entry anywhere,
{
vim.filetype.add({
extension = {
svelte = "html",
},
})
},