1

I've updated my neovim from v0.8.x to v0.9.2, so my treesitter just stopped to work.

Every time a opened a file (js, ts, tsx, jsx, lua, html, css, etc...) it run the parser installation for that file extension, but if I quite (:q!) from nvim and back to that file, it will install the parser again, it looks like doesn't have permission to save parser files downloaded in installation process.

Is there any idea about it?

Machine Info

Machine: Mac M1

OS: MacOS 13.3.1

Neovim Version:

$ nvim --version
NVIM v0.9.2
Build type: Release
LuaJIT 2.1.0-beta3

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.9.2/share/nvim"

Checkhealth


==============================================================================
lazy: require("lazy.health").check()

lazy.nvim ~
- OK Git installed
- WARNING found existing packages at `/Users/lai/.local/share/nvim/site/pack/packer`
- OK packer_compiled.lua not found

==============================================================================
mason: require("mason.health").check()

mason.nvim ~
- OK mason.nvim version v1.8.0
- OK PATH: prepend
- OK Providers: 
  mason.providers.registry-api
  mason.providers.client
- OK neovim version >= 0.7.0

mason.nvim [Registries] ~
- OK Registry `github.com/mason-org/mason-registry version: 2023-09-14-breezy-opera` is installed.

mason.nvim [Core utils] ~
- OK unzip: `UnZip 6.00 of 20 April 2009, by Info-ZIP.  Maintained by C. Spieler.  Send`
- WARNING wget: not available
  - ADVICE:
    - spawn: wget failed with exit code - and signal -. wget is not executable
- OK curl: `curl 7.87.0 (x86_64-apple-darwin22.0) libcurl/7.87.0 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.11 nghttp2/1.51.0`
- OK gzip: `Apple gzip 403.100.6`
- OK tar: `bsdtar 3.5.3 - libarchive 3.5.3 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8 `
- OK bash: `GNU bash, version 3.2.57(1)-release (arm64-apple-darwin22)`
- OK sh: `Ok`

mason.nvim [Languages] ~
- OK Ruby: `ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin22]`
- OK Go: `go version go1.18.5 darwin/arm64`
- OK cargo: `cargo 1.68.0 (115f34552 2023-02-26)`
- OK RubyGem: `3.0.3.1`
- OK node: `v16.14.2`
- OK luarocks: `/opt/homebrew/bin/luarocks 3.9.2`
- OK npm: `8.5.0`
- WARNING julia: not available
  - ADVICE:
    - spawn: julia failed with exit code - and signal -. julia is not executable
- OK python: `Python 3.11.5`
- OK PHP: `PHP 8.2.10 (cli) (built: Aug 31 2023 18:52:55) (NTS)`
- OK Composer: `Composer version 2.1.14 2021-11-30 10:51:43`
- OK pip: `pip 23.2.1 from /opt/homebrew/lib/python3.11/site-packages/pip (python 3.11)`
- OK python venv: `Ok`
- OK JAVA_HOME: `openjdk version "17.0.8" 2023-07-18 LTS`
- OK java: `openjdk version "17.0.8" 2023-07-18 LTS`
- OK javac: `javac 17.0.8`

mason.nvim [GitHub] ~
- OK GitHub API rate limit. Used: 0. Remaining: 5000. Limit: 5000. Reset: Sun Sep 17 23:49:19 2023.

==============================================================================
nvim: require("nvim.health").check()

Configuration ~
- OK no issues found

Runtime ~
- OK $VIMRUNTIME: /opt/homebrew/Cellar/neovim/0.9.2/share/nvim/runtime

Performance ~
- OK Build type: Release

Remote Plugins ~
- OK Up to date

terminal ~
- key_backspace (kbs) terminfo entry: `key_backspace=^H`
- key_dc (kdch1) terminfo entry: `key_dc=\E[3~`
- $TERM_PROGRAM="tmux"
- $COLORTERM="truecolor"

tmux ~
- OK escape-time: 10
- WARNING `focus-events` is not enabled. |'autoread'| may not work.
  - ADVICE:
    - (tmux 1.9+ only) Set `focus-events` in ~/.tmux.conf:
      set-option -g focus-events on
- $TERM: screen-256color

==============================================================================
nvim-treesitter: require("nvim-treesitter.health").check()

Installation ~
- OK `tree-sitter` found 0.20.8 (parser generator, only needed for :TSInstallFromGrammar)
- OK `node` found v16.14.2 (only needed for :TSInstallFromGrammar)
- OK `git` executable found.
- OK `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
  Version: Apple clang version 14.0.3 (clang-1403.0.22.14.1)
- OK Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

OS Info:
{
  machine = "arm64",
  release = "22.4.0",
  sysname = "Darwin",
  version = "Darwin Kernel Version 22.4.0: Mon Mar  6 21:00:41 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T8103"
} ~

Parser/Features         H L F I J
  - c                   ✓ ✓ ✓ ✓ ✓
  - lua                 ✓ ✓ ✓ ✓ x
  - query               ✓ ✓ ✓ ✓ ✓
  - vim                 ✓ ✓ ✓ . ✓
  - vimdoc              ✓ . . . ✓

  Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
         +) multiple parsers found, only one will be used
         x) errors found in the query, try to run :TSUpdate {lang} ~

The following errors have been detected: ~
- ERROR lua(injections): ...im/0.9.2/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid structure at position 1238 for language lua
  lua(injections) is concatenated from the following files:
  | [ERROR]:"/Users/lai/.local/share/nvim/lazy/nvim-treesitter/queries/lua/injections.scm", failed to load: ...im/0.9.2/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid structure at position 1238 for language lua

==============================================================================
provider: health#provider#check

Clipboard (optional) ~
- OK Clipboard tool found: pbcopy

Python 3 provider (optional) ~
- pyenv: Path: /opt/homebrew/Cellar/pyenv/2.3.16/libexec/pyenv
- pyenv: $PYENV_ROOT is not set. Infer from `pyenv root`.
- pyenv: Root: /Users/lai/.pyenv
- `g:python3_host_prog` is not set.  Searching for python3.9 in the environment.
- WARNING pyenv is not set up optimally.
  - ADVICE:
    - Create a virtualenv specifically for Nvim using pyenv, and set `g:python3_host_prog`.  This will avoid the need to install the pynvim module in each version/virtualenv.
- Executable: /opt/homebrew/bin/python3.9
- Python version: 3.9.16
- pynvim version: 0.4.3
- OK Latest pynvim is installed.

Python virtualenv ~
- OK no $VIRTUAL_ENV

Ruby provider (optional) ~
- Ruby: ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin22]
- WARNING `neovim-ruby-host` not found.
  - ADVICE:
    - Run `gem install neovim` to ensure the neovim RubyGem is installed.
    - Run `gem environment` to ensure the gem bin directory is in $PATH.
    - If you are using rvm/rbenv/chruby, try "rehashing".
    - See :help |g:ruby_host_prog| for non-standard gem installations.
    - You may disable this provider (and warning) by adding `let g:loaded_ruby_provider = 0` to your init.vim

Node.js provider (optional) ~
- Node.js: v16.14.2
- WARNING Missing "neovim" npm (or yarn, pnpm) package.
  - ADVICE:
    - Run in shell: npm install -g neovim
    - Run in shell (if you use yarn): yarn global add neovim
    - Run in shell (if you use pnpm): pnpm install -g neovim
    - You may disable this provider (and warning) by adding `let g:loaded_node_provider = 0` to your init.vim

Perl provider (optional) ~
- WARNING "Neovim::Ext" cpan module is not installed
  - ADVICE:
    - See :help |provider-perl| for more information.
    - You may disable this provider (and warning) by adding `let g:loaded_perl_provider = 0` to your init.vim

==============================================================================
telescope: require("telescope.health").check()

Checking for required plugins ~
- OK plenary installed.
- OK nvim-treesitter installed.

Checking external dependencies ~
- OK rg: found ripgrep 13.0.0
- WARNING fd: not found. Install [sharkdp/fd](https://github.com/sharkdp/fd) for extended capabilities

===== Installed extensions ===== ~

Telescope Extension: `ag` ~
- No healthcheck provided

Telescope Extension: `command_palette` ~
- No healthcheck provided

Telescope Extension: `neoclip` ~
- No healthcheck provided

==============================================================================
vim.lsp: require("vim.lsp.health").check()

- LSP log level : WARN
- Log path: /Users/lai/.local/state/nvim/lsp.log
- Log size: 3260 KB

vim.lsp: Active Clients ~
- No active clients

==============================================================================
vim.treesitter: require("vim.treesitter.health").check()

- Nvim runtime ABI version: 14
- OK Parser: c          ABI: 14, path: /opt/homebrew/Cellar/neovim/0.9.2/lib/nvim/parser/c.so
- OK Parser: lua        ABI: 14, path: /opt/homebrew/Cellar/neovim/0.9.2/lib/nvim/parser/lua.so
- OK Parser: query      ABI: 14, path: /opt/homebrew/Cellar/neovim/0.9.2/lib/nvim/parser/query.so
- OK Parser: vim        ABI: 14, path: /opt/homebrew/Cellar/neovim/0.9.2/lib/nvim/parser/vim.so
- OK Parser: vimdoc     ABI: 14, path: /opt/homebrew/Cellar/neovim/0.9.2/lib/nvim/parser/vimdoc.so

==============================================================================
which-key: require("which-key.health").check()

WhichKey: checking conflicting keymaps ~
- WARNING conflicting keymap exists for mode **"n"**, lhs: **"yS"**
- rhs: `<Plug>(nvim-surround-normal-line)`
- WARNING conflicting keymap exists for mode **"n"**, lhs: **"ys"**
- rhs: `<Plug>(nvim-surround-normal)`
- WARNING conflicting keymap exists for mode **"n"**, lhs: **",cb"**
- rhs: `<Plug>(comment_toggle_blockwise)`
- WARNING conflicting keymap exists for mode **"n"**, lhs: **",cc"**
- rhs: `<Plug>(comment_toggle_linewise)`

The point to note is error in treesitter:

Parser/Features         H L F I J
  - c                   ✓ ✓ ✓ ✓ ✓
  - lua                 ✓ ✓ ✓ ✓ x
  - query               ✓ ✓ ✓ ✓ ✓
  - vim                 ✓ ✓ ✓ . ✓
  - vimdoc              ✓ . . . ✓

  Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
         +) multiple parsers found, only one will be used
         x) errors found in the query, try to run :TSUpdate {lang} ~

The following errors have been detected: ~
- ERROR lua(injections): ...im/0.9.2/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid structure at position 1238 for language lua
  lua(injections) is concatenated from the following files:
  | [ERROR]:"/Users/lai/.local/share/nvim/lazy/nvim-treesitter/queries/lua/injections.scm", failed to load: ...im/0.9.2/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid structure at position 1238 for language lua

Python Version:

$ python --version
command not found: python

$ python3 --version
Python 3.11.5
2
  • 1
    Perhaps file a bug or ticket with the NeoVim devs?
    – D. Ben Knoble
    Sep 18 at 15:05
  • I don't know, because I'm not sure if it's a bug or just m miss configuration
    – Lai32290
    Sep 18 at 20:19

1 Answer 1

1

I found the point, it's in conflict with Packer, that I had installed before

- WARNING found existing packages at `/Users/lai/.local/share/nvim/site/pack/packer`

So I deleted the folder /Users/lai/.local/share/nvim/site/ and everything is working well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.