Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support per-language indent config for ibl #1283

Closed
Tracked by #1259
Jint-lzxy opened this issue Jun 10, 2024 · 3 comments
Closed
Tracked by #1259

Support per-language indent config for ibl #1283

Jint-lzxy opened this issue Jun 10, 2024 · 3 comments
Labels
enhancement New feature or request treesitter Treesitter related issues ui General user interface related issues

Comments

@Jint-lzxy
Copy link
Collaborator

Jint-lzxy commented Jun 10, 2024

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:

  • angular (inherits html_tags)
  • arduino (inherits cpp)
  • astro (inherits html)
  • bass
  • bibtex
  • bicep
  • bitbake
  • bp
  • c
  • cairo
  • capnp
  • chatito
  • cmake
  • corn
  • cpon
  • cpp
  • css
  • cuda (inherits cpp)
  • cue
  • d
  • dart
  • devicetree
  • djot
  • dot
  • doxygen
  • ecma
  • elixir
  • elsa
  • facility
  • firrtl
  • fish
  • foam
  • forth
  • fortran
  • fusion
  • gdscript
  • gleam
  • glimmer
  • glsl (inherits c)
  • gn
  • go
  • graphql
  • groovy
  • hare
  • hcl
  • heex
  • hjson (inherits json)
  • hlsl (inherits cpp)
  • html (inherits html_tags)
  • html_tags
  • htmldjango
  • hurl
  • hyprlang
  • inko
  • ispc
  • java
  • javascript (inherits ecma, jsx)
  • json
  • jsonc (inherits json)
  • jsx
  • julia
  • just
  • kconfig
  • kdl
  • ledger
  • leo
  • linkerscript
  • liquidsoap
  • lua
  • luau (inherits lua)
  • markdown
  • matlab
  • meson
  • nickel
  • ninja
  • nqc
  • objc (inherits c)
  • ocaml
  • ocaml_interface
  • odin
  • pascal
  • php
  • php_only (inherits php_only)
  • poe_filter
  • pony
  • puppet
  • python
  • ql
  • query
  • r
  • rasi
  • rbs
  • re2c
  • readline
  • robot
  • ron
  • ruby
  • rust
  • scss
  • slang
  • slint
  • smali
  • snakemake
  • sparql
  • sql
  • squirrel
  • ssh_config
  • starlark
  • styled
  • supercollider
  • surface
  • svelte
  • swift
  • t32
  • tablegen
  • tact
  • tcl
  • teal
  • terraform
  • textproto
  • thrift
  • tiger
  • toml
  • tsx
  • turtle
  • typescript
  • typespec
  • typoscript
  • typst
  • ungrammar
  • usd
  • uxntal
  • v
  • vue
  • wgsl
  • wgsl_bevy
  • xml
  • yaml
  • yang
  • yuck
  • zig
@Jint-lzxy Jint-lzxy added enhancement New feature or request treesitter Treesitter related issues ui General user interface related issues labels Jun 10, 2024
@Jint-lzxy
Copy link
Collaborator Author

@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
Copy link
Collaborator

CharlesChiuGit commented Jun 12, 2024

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
Copy link
Collaborator Author

Jint-lzxy commented Jun 12, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request treesitter Treesitter related issues ui General user interface related issues
Projects
None yet
Development

No branches or pull requests

2 participants