Open ishaanparlikar opened 3 months ago
I am experiencing the same issue. My config is based off of Kickstart.nvim and my treesitter config looks like the following
{ -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
opts = {
ensure_installed = {
'bash',
'c',
'diff',
'html',
'lua',
'luadoc',
'markdown',
'markdown_inline',
'query',
'vim',
'vimdoc',
'javascript',
'astro',
},
-- Autoinstall languages that are not installed
auto_install = true,
highlight = {
enable = true,
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
-- If you are experiencing weird indenting issues, add the language to
-- the list of additional_vim_regex_highlighting and disabled languages for indent.
additional_vim_regex_highlighting = { 'ruby', 'astro' },
},
indent = { enable = true, disable = { 'ruby' } },
},
-- There are additional nvim-treesitter modules that you can use to interact
-- with nvim-treesitter. You should go explore a few and see what interests you:
--
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
},
I've tried everything, including converting the implementation into a separate require, but I can not get the syntax highlighting to work. If I manually invoke :TSBufEnable highlight
in an .astro
file it works like I expect.
Turns out it was an issue on my end. A trailing comma in my tsconfig.json
was the culprit...
@zachbharris how did you debug this? I have to try with my config now.
neo-tree
was actually proving an error dump that I used gpt to disect that lead me to a trailing comma error. It originally was pointing at astro.vim
but I found a few posts around tsconfig having a trailing error causing an error with astro.
I bashed my head for so long. I gave up using neovim for astro projects.
I'm right there with you. I almost gave up and was going to use Cursor for my astro project, but found the needle in the haystack issue.
Turns out it was an issue on my end. A trailing comma in my
tsconfig.json
was the culprit...
Thank you, I was beating my head on the wall. Everything was working in one project, but not in another and this was the problem.
Turns out it was an issue on my end. A trailing comma in my
tsconfig.json
was the culprit...
Can confirm, weirdly for me this fixes it also. Too bad it tries to point to some kind of hard to decipher error in this case. Thank you for investigating this!
Phew this fixed my config issue too, I'm kinda new to using treesitter, is there a way I could have debugged this than just lucking out on the solution ?
@zachbharris THANK YOU, man. I almost gave up on using Neovim for Astro. (based pfp btw)
@zachbharris Thank you!! I was almost going to switch to back to VSCode for Astro
Is it working on the latest neovim and treesitter builds? Unfortunatly I was unable to get it to work. I am using Kickstart Neovim
My TS Config
*:TSConfigInfo*
Originally posted by @ishaanparlikar in https://github.com/virchau13/tree-sitter-astro/issues/16#issuecomment-2158743404