virchau13 / tree-sitter-astro

Tree-sitter grammar for the Astro web framework
MIT License
98 stars 9 forks source link

docs: update ftdetect code snippets #21

Closed Je12emy closed 1 year ago

Je12emy commented 1 year ago

I have used astro and nvim for a while and the included instructions for setting up .astro files did not work for me. After a bit a digging I found this thread showing another solution which worked. Apparently, OP also used the instructions included in the readme but also ran into trouble.

virchau13 commented 1 year ago

Interesting; the previous Lua snippet works perfectly well for me.

Are you sure you're putting it in the correct file path (~/.config/nvim/ftdetect/astro.lua, not ~/.config/nvim/lua/ftdetect/astro.lua)?

Je12emy commented 1 year ago

Interesting; the previous Lua snippet works perfectly well for me.

Are you sure you're putting it in the correct file path (~/.config/nvim/ftdetect/astro.lua, not ~/.config/nvim/lua/ftdetect/astro.lua)?

Yes, the new code snippet is located in the same place. we could include both code snippets just in case!

virchau13 commented 1 year ago

Can you try running Neovim with a minimal config only containing the ftdetect/astro.lua file?

Je12emy commented 1 year ago

Can you try running Neovim with a minimal config only containing the ftdetect/astro.lua file?

will do!

Je12emy commented 1 year ago

I made a minimal config with Treesitter and Lazy, the original code snippet works! There must be something else causing trouble in OP's and my config. I will close this PR.

On the good side, if someone else has a similar issue, they will find a solution in the repository!