Skip to content

Support per-language indent config for ibl #1283

@Jint-lzxy

Description

@Jint-lzxy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttreesitterTreesitter related issuesuiGeneral user interface related issues

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions