AstroNvim / template

AstroNvim template (v4+)
https://astronvim.com/
77 stars 152 forks source link

fix(treesitter): enable setting and add vimdoc #6

Closed liufuyang closed 6 months ago

liufuyang commented 6 months ago

πŸ“‘ Description

My bet is when people clone this repo they will not just do lua development and so perhaps everyone will just go add some lang for treesitter in this file, so we do not need to setup the return blocker in the first line. These early returns tricked me several times as I moved around the configurations and made changes and things did not take effect. I guess for this common setting, we can remove it?

Also would like to add this vimdoc as enforced, or recommended here. Otherwise doing some random :help abc will print treesitter errors.

But feel free to close the PR if you think otherwise :)

β„Ή Additional Information

:checkhealth gives this if vimdoc is not installed or updated again via TSInstall, perhaps.

Parser/Features         H L F I J
  - c                   βœ“ βœ“ βœ“ βœ“ βœ“
  - lua                 βœ“ βœ“ βœ“ βœ“ x
  - query               βœ“ βœ“ βœ“ βœ“ βœ“
  - vim                 βœ“ βœ“ βœ“ . βœ“
  - vimdoc              x . . . βœ“

  Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
         +) multiple parsers found, only one will be used
         x) errors found in the query, try to run :TSUpdate {lang} ~

The following errors have been detected: ~
- ERROR lua(injections): ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid structure at position 3154 for language lua
  lua(injections) is concatenated from the following files:
  | [ERROR]:"/Users/fuyangl/.local/share/nvim-astro-v4/lazy/nvim-treesitter/queries/lua/injections.scm", failed to load: ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid structure at position 3154 for language lua
- ERROR vimdoc(highlights): ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid node type at position 746 for language vimdoc
  vimdoc(highlights) is concatenated from the following files:
  | [ERROR]:"/Users/fuyangl/.local/share/nvim-astro-v4/lazy/nvim-treesitter/queries/vimdoc/highlights.scm", failed to load: ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid node type at position 746 for language vimdoc
mehalter commented 6 months ago

This is unnecessary. Cloning the template should not do anything and treesitter automatically installs these now. It doesn't need to be hard coded

liufuyang commented 6 months ago

Good, thanks. I guess you will then fix the vimdoc issue in the astronvim repo?

mehalter commented 6 months ago

That's just a thing that happens with treesitter sometimes. Nothing to fix on our end

liufuyang commented 6 months ago

@mehalter Aha, you sure? I think that was due to vimdoc not installed by default, which should? I think you have it installed out of the box for v3, but not for v4?