ad: Ad panics when using custom tree-sitter queries

Describe the bug

After configuring sources for ad on NixOS (I am using compiled grammars and queries from another project) I can’t open files because the editor just panics.

To Reproduce

Steps to reproduce the behavior:

  1. Install grammars and queries
  2. Set the source paths and [[languages]] in config.toml
  3. Try to open files

Expected behavior

Editor opens files without panicking and with tree-sitter highlighting.

Versions & OS Details

  • OS: Linux
  • Distribution NixOS
  • OS Version 24.11
  • ad Version commit 5bdc021baf4bc5854070e4a7452d5d8142626a59

Additional context

The error:

thread 'main' panicked at src/buffer/internal.rs:412:41:
slice index starts at 74 but ends at 4
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Full backtrace (not sure if needed): stack backtrace: 0: 0x55a77a25d087 - <unknown> 1: 0x55a77a1b0b7b - <unknown> 2: 0x55a77a25f50e - <unknown> 3: 0x55a77a28cde2 - <unknown> 4: 0x55a77a28dce3 - <unknown> 5: 0x55a77a25d4f5 - <unknown> 6: 0x55a77a25d459 - <unknown> 7: 0x55a77a28d294 - <unknown> 8: 0x55a779f76522 - <unknown> 9: 0x55a779f76356 - <unknown> 10: 0x55a77a097bd1 - <unknown> 11: 0x55a77a0da182 - <unknown> 12: 0x55a77a0d7973 - <unknown> 13: 0x55a779fd8b19 - <unknown> 14: 0x55a779fa657e - <unknown> 15: 0x55a779fdd14d - <unknown> 16: 0x55a779fc52c3 - <unknown> 17: 0x55a779fda97a - <unknown> 18: 0x7f7ac12b727e - __libc_start_call_main 19: 0x7f7ac12b7339 - __libc_start_main_alias_2 20: 0x55a779f7e3f5 - <unknown> 21: 0x0 - <unknown>

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

I’ve just spotted that the config sections you are adding are [[language]] when they should be [[languages]]. Can you try again with that corrected?

The neovim typescript queries work fine for me once I’ve replaced lua-match with match

Yep, now highlighting work well, both in ts and nix files! I checked more, and it also works with zig, haskell, go, js, and tsx | jsx files

Thanks! The language specific support is brand new and not yet released as a stable build on crates.io so there are definitely rough edges and missing features I’m afraid. I’m planning on making improvements in the near future but it’ll be a while before the experience is as polished as what is currently available in neovim and helix 😄