ayamir / nvimdots

A well configured and structured Neovim.
BSD 3-Clause "New" or "Revised" License
2.82k stars 451 forks source link

Support per-language indent config for ibl #1283

Closed Jint-lzxy closed 2 weeks ago

Jint-lzxy commented 3 weeks ago

Feature description

Problem: Currently we maintain an insanely long list of Treesitter nodes that can be used as starting points for the next level of indentation in ibl. The problem is, most languages only need a small subset of these nodes. This could lead to performance implications on large files and affect overall parsing efficiency.

Possible Solution: Now that Treesitter support for indentation is almost complete for most programming languages, we can easily define per-language indent nodes using the ones specified in the @indent.begin capture in indents.scm. However, some effort may be needed to support this on a per-language basis.

Additional information

Below is the list of programming languages currently supported by Treesitter-indent:

Jint-lzxy commented 2 weeks ago

@ayamir @CharlesChiuGit I've selected several languages that imo are worth supporting in our base config. Do u have any suggestions for additions (or deletions) to this list?

CharlesChiuGit commented 2 weeks ago

maybe adding ocaml, ocaml_interface, nix and scss?

i saw the default settings in ibl, i think it's fine to use your current setup.

Jint-lzxy commented 2 weeks ago

ocaml, ocaml_interface, nix and scss

i saw the default settings in ibl, i think it's fine to use your current setup.

afaiu the default list of nodes in ibl is incomplete for all these languages. I'll update it then. (Though it seems nix doesn't even have an indents.scm file lmao I'll skip it for now)

EDIT: Done, see #1288.