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

Opening specific files causes freeze #34

Closed
afreakk opened this issue Jan 14, 2023 · 7 comments
Closed

Opening specific files causes freeze #34

afreakk opened this issue Jan 14, 2023 · 7 comments

Comments

@afreakk
Copy link

afreakk commented Jan 14, 2023

Im using this treesitter for neovim, and its been fine until I tried opening:
pkgs/development/haskell-modules/make-package-set.nix from nixpkgs.

Then neovim froze and started using enourmous amounts of memory until I killed neovim.
This happens every time I open that file using neovim with this treesitter, if I disable the nix treesitter parser it opens fine.
Not sure how to debug this, so this is not very helpfull, but I could easily reproduce the issue atleast.

 ❯ nvim --version
NVIM v0.8.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by nixbld

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "
/nix/store/dl03s9vbm0i0qqg6sqv37rvd4mghbk6c-neovim-unwrapped-0.8.2/share/nvim
"
@folke
Copy link

folke commented Jan 17, 2023

Same issue on Neovim, with the following minimal nix file:

{}: let
in {
  programs.waybar = {
  exec = let
  in
    pkgs.writeShellScript "todo-waybar" ''
      $(${todo} | ${wc} -l)
    '';
  };
}

Seems to be caused by the bash parser, byt the injection at line 7, the |

@cstrahan
Copy link
Collaborator

cstrahan commented Feb 3, 2023

Hmm. That's no good. Thanks for the report!

I'm super swamped at the moment, so if anyone can take a stab at debugging this, it would be greatly appreciated. Otherwise I'll take a look as soon as I have some spare time.

@folke
Copy link

folke commented Feb 4, 2023

Treesitter has fixed a bug upstream that at least fixed the issue from my minimal nix file.

@afreakk
Copy link
Author

afreakk commented Feb 4, 2023

Treesitter has fixed a bug upstream that at least fixed the issue from my minimal nix file.

Thats weird, it didnt for me, running nvim-treesitter (0e6d4b4), and disabled all my treesitter plugins like nvim-hop and matchup.
Will try a minimal nvim config later with only treesitter and nothing else installed

@afreakk
Copy link
Author

afreakk commented Feb 5, 2023

A more minimal example

writeShellScript "test" "$(${x}|${y} )"

writeShellScript ( queries/injections.scm:17 ) turns the following string to be:

 (#set! injection.language "bash")
 (#set! injection.combined))

So when I tried removing my bash treesitter parser, it didnt freeze anymore.

@folke
Copy link

folke commented Feb 6, 2023

The treesitter dep was updated in a very recent nightly Neovim built.

See here: neovim/neovim#21858

@cstrahan
Copy link
Collaborator

I'm fairly certain that this has been resolved upstream, so I'll close this now; if I'm mistaken, ping me and I'll reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants