tree-sitter-nu icon indicating copy to clipboard operation
tree-sitter-nu copied to clipboard

Invalid node type "composite_type"

Open AdrienLemaire opened this issue 6 months ago • 1 comments

Using NixOS, nushell 0.104.1 and LazyVim in neovim.

When running :checkhealth nvim-treesitter, I can see an error related to the nu parser

==============================================================================
nvim-treesitter:                                                          1 ❌

Installation ~
- ✅ OK `tree-sitter` found 0.25.3 (parser generator, only needed for :TSInstallFromGrammar)
- ✅ OK `node` found v24.1.0 (only needed for :TSInstallFromGrammar)
- ✅ OK `git` executable found.
- ✅ OK `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
  Version: gcc (GCC) 14.2.1 20250322
- ✅ OK Neovim was compiled with tree-sitter runtime ABI version 15 (required >=13). Parsers must be compatible with runtime ABI.

OS Info:
{
  machine = "x86_64",
  release = "6.15.2-zen1",
  sysname = "Linux",
  version = "#1-NixOS ZEN SMP PREEMPT_DYNAMIC Tue Jan  1 00:00:00 UTC 1980"
} ~

Parser/Features         H L F I J
  - c                   ✓ ✓ ✓ ✓ ✓
  - css                 ✓ . ✓ ✓ ✓
  - csv                 ✓ . . . .
  - diff                ✓ . ✓ . ✓
  - html                ✓ ✓ ✓ ✓ ✓
  - javascript          ✓ ✓ ✓ ✓ ✓
  - latex               ✓ . ✓ . ✓
  - lua                 ✓ ✓ ✓ ✓ ✓
  - markdown            ✓ . ✓ ✓ ✓
  - markdown_inline     ✓ . . . ✓
  - norg                . . . . .
  - nu                  x . ✓ ✓ ✓
  - python              ✓ ✓ ✓ ✓ ✓
  - query               ✓ ✓ ✓ ✓ ✓
  - regex               ✓ . . . .
  - scss                ✓ . ✓ ✓ ✓
  - svelte              ✓ ✓ ✓ ✓ ✓
  - tsv                 ✓ . . . .
  - tsx                 ✓ ✓ ✓ ✓ ✓
  - turtle              ✓ ✓ ✓ ✓ ✓
  - typescript          ✓ ✓ ✓ ✓ ✓
  - typst               ✓ . ✓ ✓ ✓
  - vim                 ✓ ✓ ✓ . ✓
  - vimdoc              ✓ . . . ✓
  - vue                 ✓ . ✓ ✓ ✓
  - yaml                ✓ ✓ ✓ ✓ ✓

  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 nu(highlights): ...d-0.11.2/share/nvim/runtime/lua/vim/treesitter/query.lua:373: Query error at 263:2. Invalid node type "composite_type":
  (composite_type
   ^

  nu(highlights) is concatenated from the following files:
  | [ERROR]:"/home/dori/.local/share/nvim/lazy/tree-sitter-nu/queries/nu/highlights.scm", failed to load: ...d-0.11.2/share/nvim/runtime/lua/vim/treesitter/query.lua:373: Query error at 263:2. Invalid node type "composite_type":
  (composite_type
   ^

Commenting lines 263~266 temporarily resolves the issue

; (composite_type
;     "oneof" @type.enum
;     ["<" ">"] @punctuation.bracket
; )

AdrienLemaire avatar Jun 18 '25 15:06 AdrienLemaire

The query files in this repo are ahead of the parser installed via nvim-treesitter.

My suggestion: stop installing this repo as a nvim plugin since all those query files you need are already included by nvim-treesitter.

I'm gonna to remove the dependency part from the neovim doc later.

blindFS avatar Jun 18 '25 16:06 blindFS