NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.27k stars 14.25k forks source link

Vento Treesitter grammar crashes Neovim #345923

Open getchoo opened 1 month ago

getchoo commented 1 month ago

Describe the bug

On opening any Vento file using Vento's syntax, Neovim crashes with no errors in the log

Steps To Reproduce

Steps to reproduce the behavior:

  1. Open a file like so
    <!DOCTYPE html>
    <html lang="en">
        <body>
                <h1>Hello world!</h1>
                {{ include "other_file.vto" }}
        </body>
    </html>

Expected behavior

Vento treesitter highlighting works

Screenshots

n/a

Additional context

Removing Vento specific syntax like {{ include "other_file".vto }} in the above file doesn't cause a crash, so this doesn't appear to be an issue with its injections. This is also not reproducible when installing the grammar through nvim-treesitter itself

Notify maintainers

@figsoda

Metadata

$ nix-shell -p nix-info --run "nix-info -m"
fetching path input 'path:/nix/store/r2hk87rfvc5fpfbl2bj64a3x7mcq9f6c-source'
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.153.1-microsoft-standard-WSL2, NixOS, 24.11 (Vicuna), 24.11.20240929.06cf0e1`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Lix, like Nix) 2.91.0
System type: x86_64-linux
Additional system types: i686-linux, x86_64-v1-linux, x86_64-v2-linux, x86_64-v3-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/seth/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/seth/.nix-profile/etc/xdg/nix/nix.conf:/nix/profile/etc/xdg/nix/nix.conf:/home/seth/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/seth/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/cfl6rqw64ndbh2m0qapg410jf4xmycia-lix-2.91.0/share`
 - nixpkgs: `/nix/store/r2hk87rfvc5fpfbl2bj64a3x7mcq9f6c-source`

Add a :+1: reaction to issues you find important.

teto commented 1 month ago

nowhere near information.what neovim/ what nixpkgs ? Does it crash with regex-based syntax or the grammar you install ? how ?

This is also not reproducible when installing the grammar through nvim-treesitter

You can install those via nix too pkgs.vimPlugins.nvim-treesitter-parsers.nix for instance. They might get outdated in which case you can run the updater. Depends if you run neovim unstable or stable too. My personal take is that for this kind of trouble you are on your own. treesitter + neovim is not robust.

getchoo commented 1 month ago

what neovim

From nixpkgs

$ nvim --version
NVIM v0.10.1
Build type: Release
LuaJIT 2.1.1713773202
Run "nvim -V1 -v" for more info

what nixpkgs

From the nixos-unstable branch

$ nixos-version --revision
06cf0e1da4208d3766d898b7fdab6513366d45b9

Does it crash with regex-based syntax or the grammar you install ?

This is said in the title of the issue: the treesitter grammar

how ?

As I said

Neovim crashes with no errors in the log

:messages also has no output, and gdb doesn't seem to be able to get a backtrace either. Only an error code of 0123

This can be reproduced locally with nix run github:getchoo/getchvim -- /path/to/the/file/above.vto (which uses a different revision of nixpkgs than my system at 28b5b8af91ffd2623e995e20aee56510db49001a, but demonstrates the same behavior)