Skip to content

Highlight definitions leads to "Error detected while processing CursorHold" #20

Open
@madskjeldgaard

Description

@madskjeldgaard

Describe the bug
Hello
Highlight definitions for me freaks out Nvim when it encounters and error in the parser tree it seems:

E5108: Error executing lua ...m/plugged/nvim-treesitter/lua/nvim-treesitter/locals.lua:133: bad argument #1 to 'pairs' (table expected, g
ot string)   ```

This is tested with the supercollider grammar.

**Expected behavior**
I expect it to fail silently.

**Output of `:checkhealth nvim_treesitter`**

<details>
<code>

health#nvim_treesitter#check
========================================================================
## Installation
  - OK: `tree-sitter` found  0.19.4 (parser generator, only needed for :TSInstallFromGrammar)
  - OK: `node` found v14.16.0 (only needed for :TSInstallFromGrammar)
  - OK: `git` executable found.
  - OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl" }
  - OK: Neovim was compiled with tree-sitter runtime ABI version 13 (required >=13). Parsers must be compatible with runtime ABI.

## Parser/Features H L F I
  - c_sharp        ✓ . . . 
  - svelte         ✓ . ✓ ✓ 
  - beancount      ✓ . ✓ . 
  - zig            ✓ ✓ ✓ ✓ 
  - c              ✓ ✓ ✓ ✓ 
  - fortran        ✓ . ✓ . 
  - teal           ✓ ✓ ✓ ✓ 
  - java           ✓ ✓ . ✓ 
  - python         ✓ ✓ ✓ ✓ 
  - bibtex         ✓ . ✓ ✓ 
  - sparql         ✓ ✓ ✓ ✓ 
  - comment        ✓ . . . 
  - gomod          ✓ . . . 
  - dart           ✓ ✓ . ✓ 
  - lua            ✓ ✓ ✓ ✓ 
  - latex          ✓ . ✓ . 
  - ocaml          ✓ ✓ ✓ . 
  - bash           ✓ ✓ ✓ . 
  - r              ✓ ✓ . . 
  - scss           ✓ . . ✓ 
  - yaml           ✓ ✓ ✓ ✓ 
  - json           ✓ ✓ ✓ ✓ 
  - jsdoc          ✓ . . . 
  - ledger         ✓ . ✓ ✓ 
  - php            ✓ ✓ ✓ ✓ 
  - julia          ✓ ✓ ✓ . 
  - supercollider  ✓ ✓ ✓ ✓ 
  - devicetree     ✓ ✓ ✓ ✓ 
  - gdscript       ✓ ✓ . . 
  - turtle         ✓ ✓ ✓ ✓ 
  - vue            ✓ . ✓ . 
  - html           ✓ ✓ ✓ ✓ 
  - typescript     ✓ ✓ ✓ ✓ 
  - regex          ✓ . . . 
  - verilog        ✓ ✓ ✓ . 
  - jsonc          ✓ ✓ ✓ ✓ 
  - ql             ✓ ✓ . ✓ 
  - fennel         ✓ ✓ . . 
  - swift          . . . . 
  - rst            ✓ ✓ . . 
  - nix            ✓ ✓ ✓ . 
  - elm            . . . . 
  - query          ✓ ✓ ✓ ✓ 
  - graphql        ✓ . . ✓ 
  - cpp            ✓ ✓ ✓ ✓ 
  - toml           ✓ ✓ ✓ ✓ 
  - kotlin         ✓ . . . 
  - ruby           ✓ ✓ ✓ ✓ 
  - fish           ✓ ✓ ✓ ✓ 
  - ocamllex       ✓ . . . 
  - scala          . . . . 
  - dockerfile     ✓ . . . 
  - rust           ✓ ✓ ✓ ✓ 
  - haskell        . . . . 
  - ocaml_interface✓ ✓ ✓ . 
  - javascript     ✓ ✓ ✓ ✓ 
  - css            ✓ . ✓ ✓ 
  - glimmer        ✓ . . . 
  - erlang         . . . . 
  - clojure        ✓ ✓ . . 
  - go             ✓ ✓ ✓ ✓ 
  - tsx            ✓ ✓ ✓ ✓ 

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


</code>
</details>

**Output of `nvim --version`**

NVIM v0.5.0-dev+1318-g61aefaf29
Build type: RelWithDebInfo
LuaJIT 2.0.5
Compilation: /usr/bin/cc -D_FORTIFY
_SOURCE=2 -march=x86-64 -mtune=gene
ric -O2 -pipe -fno-plt -U_FORTIFY_S
OURCE -D_FORTIFY_SOURCE=1 -O2 -g -O
g -g -Wall -Wextra -pedantic -Wno-u
nused-parameter -Wstrict-prototypes
-std=gnu99 -Wshadow -Wconversion -
Wmissing-prototypes -Wimplicit-fall
through -Wvla -fstack-protector-str
ong -fno-common -fdiagnostics-color
=auto -DINCLUDE_GENERATED_DECLARATI
ONS -D_GNU_SOURCE -DNVIM_MSGPACK_HA
S_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM
-DMIN_LOG_LEVEL=3 -I/home/mads/.ca
che/yay/neovim-git/src/build/config
-I/home/mads/.cache/yay/neovim-git
/src/neovim-git/src -I/usr/include
-I/home/mads/.cache/yay/neovim-git/
src/build/src/nvim/auto -I/home/mad
s/.cache/yay/neovim-git/src/build/i
nclude
Compiled by mads

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

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


**Additional context**
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions