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

lua parser error on each line #2435

Closed
marcelarie opened this issue Feb 2, 2022 · 4 comments
Closed

lua parser error on each line #2435

marcelarie opened this issue Feb 2, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@marcelarie
Copy link

Describe the bug

If I have the lua highlighting enabled the error treesitter/highlighter: Error executing lua: /usr/local/share/nvim/runtime/lua/vim/treesitter/query.lua:172 appears on each line.

To Reproduce

  1. Enable lua highlight on treesitter config.

Expected behavior

Highlight the code using the treesitter syntax.

Output of :checkhealth nvim-treesitter

nvim-treesitter: require("nvim-treesitter.health").check()
========================================================================
## Installation
  - OK: `tree-sitter` found 0.20.4 (parser generator, only needed for :TSInstallFromGrammar)
  - OK: `node` found v16.8.0 (only needed for :TSInstallFromGrammar)
  - OK: `git` executable found.
  - OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
    Version: cc (GCC) 11.1.0
  - OK: Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

## Parser/Features H L F I J
  - eex            ✓ . . . ✓ 
  - julia          ✓ ✓ ✓ ✓ ✓ 
  - bibtex         ✓ . ✓ ✓ . 
  - jsonc          ✓ ✓ ✓ ✓ ✓ 
  - gowork         ✓ . . . ✓ 
  - kotlin         ✓ ✓ ✓ . ✓ 
  - cmake          ✓ . ✓ . . 
  - gdscript       ✓ ✓ . ✓ ✓ 
  - c              ✓ ✓ ✓ ✓ ✓ 
  - yang           ✓ . ✓ . . 
  - yaml           ✓ ✓ ✓ ✓ ✓ 
  - nix            ✓ ✓ ✓ . ✓ 
  - dot            ✓ . . . ✓ 
  - llvm           ✓ . . . . 
  - rust           ✓ ✓ ✓ ✓ ✓ 
  - javascript     ✓ ✓ ✓ ✓ ✓ 
  - scala          ✓ . ✓ . ✓ 
  - rasi           ✓ ✓ ✓ ✓ . 
  - java           ✓ ✓ . ✓ ✓ 
  - foam           ✓ ✓ ✓ ✓ ✓ 
  - norg           ✓ . ✓ . ✓ 
  - dart           ✓ ✓ . ✓ ✓ 
  - ql             ✓ ✓ . ✓ ✓ 
  - query          ✓ ✓ ✓ ✓ ✓ 
  - gomod          ✓ . . . ✓ 
  - cuda           ✓ ✓ ✓ ✓ ✓ 
  - pug            ✓ . . . ✓ 
  - fish           ✓ ✓ ✓ ✓ ✓ 
  - beancount      ✓ . ✓ . . 
  - css            ✓ . ✓ ✓ ✓ 
  - fennel         ✓ ✓ . . ✓ 
  - vala           ✓ . . . . 
  - hack           ✓ . . . . 
  - make           ✓ . . . ✓ 
  - prisma         ✓ . . . . 
  - ruby           ✓ ✓ ✓ ✓ ✓ 
  - hjson          ✓ ✓ ✓ ✓ ✓ 
  - tlaplus        ✓ ✓ ✓ . ✓ 
  - json5          ✓ . . . ✓ 
  - hocon          ✓ . . . ✓ 
  - pioasm         ✓ . . . ✓ 
  - glimmer        ✓ . . . . 
  - http           ✓ . . . ✓ 
  - vim            ✓ ✓ . . ✓ 
  - supercollider  ✓ ✓ ✓ ✓ ✓ 
  - sparql         ✓ ✓ ✓ ✓ ✓ 
  - hcl            ✓ . ✓ ✓ ✓ 
  - dockerfile     ✓ . . . ✓ 
  - zig            ✓ . ✓ ✓ ✓ 
  - heex           ✓ ✓ ✓ ✓ ✓ 
  - r              ✓ ✓ . ✓ . 
  - svelte         ✓ . ✓ ✓ ✓ 
  - devicetree     ✓ ✓ ✓ ✓ ✓ 
  - clojure        ✓ ✓ ✓ . ✓ 
  - html           ✓ ✓ ✓ ✓ ✓ 
  - turtle         ✓ ✓ ✓ ✓ ✓ 
  - ocamllex       ✓ . . . ✓ 
  - rst            ✓ ✓ . . ✓ 
  - ledger         ✓ . ✓ ✓ ✓ 
  - c_sharp        ✓ ✓ ✓ . ✓ 
  - typescript     ✓ ✓ ✓ ✓ ✓ 
  - jsdoc          ✓ . . . . 
  - comment        ✓ . . . . 
  - tsx            ✓ ✓ ✓ ✓ ✓ 
  - ninja          ✓ . ✓ ✓ . 
  - pascal         ✓ ✓ ✓ ✓ ✓ 
  - verilog        ✓ ✓ ✓ . ✓ 
  - fusion         ✓ ✓ ✓ ✓ . 
  - php            ✓ ✓ ✓ ✓ ✓ 
  - phpdoc         ✓ . . . . 
  - d              ✓ . ✓ ✓ ✓ 
  - perl           ✓ . . . . 
  - haskell        ✓ . . . ✓ 
  - surface        ✓ . ✓ ✓ ✓ 
  - bash           ✓ ✓ ✓ . ✓ 
  - swift          ✓ ✓ . . . 
  - commonlisp     ✓ ✓ ✓ . . 
  - markdown       ✓ . ✓ . ✓ 
  - elixir         ✓ ✓ ✓ ✓ ✓ 
  - scss           ✓ . . ✓ . 
  - lua            x ✓ ✓ ✓ ✓ 
  - toml           ✓ ✓ ✓ ✓ ✓ 
  - graphql        ✓ . . ✓ ✓ 
  - godot_resource ✓ ✓ ✓ . . 
  - erlang         . . . . . 
  - python         ✓ ✓ ✓ ✓ ✓ 
  - vue            ✓ . ✓ ✓ ✓ 
  - teal           ✓ ✓ ✓ ✓ ✓ 
  - ocaml_interface✓ ✓ ✓ . ✓ 
  - regex          ✓ . . . . 
  - json           ✓ ✓ ✓ ✓ . 
  - fortran        ✓ . ✓ ✓ . 
  - elm            ✓ . . . ✓ 
  - go             ✓ ✓ ✓ ✓ ✓ 
  - latex          ✓ . ✓ . ✓ 
  - cpp            ✓ ✓ ✓ ✓ ✓ 
  - glsl           ✓ ✓ ✓ ✓ ✓ 
  - ocaml          ✓ ✓ ✓ . ✓ 

  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(highlights): /usr/local/share/nvim/runtime/lua/vim/treesitter/query.lua:172: query: invalid node type at position 1
    lua(highlights) is concatenated from the following files:
    | [ERROR]:"/home/marcel/.local/share/nvim/site/pack/packer/start/gruvbox-flat.nvim/queries/lua/highlights.scm", failed to load: /usr/local/share/nvim/runtime/lua/vim/treesitter/query.lua:172: query: invalid node type at position 1
    |    [OK]:"/home/marcel/.local/share/nvim/site/pack/packer/start/nvim-treesitter/queries/lua/highlights.scm"

Output of nvim --version

NVIM v0.7.0-dev+997-g21cdecc8e
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by root

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

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/share/nvim"

Run :checkhealth for more info

Additional context

treesitter-lua

@marcelarie marcelarie added the bug Something isn't working label Feb 2, 2022
@clason
Copy link
Contributor

clason commented Feb 2, 2022

Duplicate of #2338

(Update nvim-treesitter; uninstall the Lua parser; restart Neovim; install the parser again; restart Neovim. Make sure none of your plugins are using old, incompatible queries.)

@clason clason closed this as completed Feb 2, 2022
@marcelarie
Copy link
Author

Thanks! I needed to delete $HOME/.local/share/nvim/site/pack/packer/start/gruvbox-flat.nvim/queries/lua/highlights.scm

@clason
Copy link
Contributor

clason commented Feb 2, 2022

Yes, I don't understand why color schemes do that (silently, it seems). Nvim-treesitter is declared "experimental" for a reason.

@rodhash
Copy link

rodhash commented May 7, 2022

It seems just updating the language parser seems to do the trick too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants