LhKipp / tree-sitter-nu

A tree-sitter grammar for the nushell language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

undefined symbol: tree_sitter_nu_external_scanner_create

lay-z opened this issue Β· comments

After trying to manually install tree-sitter-nu i get this error:

indent-blankline: Failed to load parser for language 'nu': uv_dlopen: /home/layz/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/parser/nu.so: undefined symbol: tree_sitter_nu_external_scanner_create

I don't know if thats because of an incorrect installation or if there's something not quite right with tree-sitter-nu plugin

My config file is set up as follows:

local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.nu = {
  install_info = {
    url = "https://github.com/LhKipp/tree-sitter-nu", -- local path or git repo
    files = { "src/parser.c" },                       -- note that some parsers also require src/scanner.c or src/scanner.cc
    -- optional entries:
    branch = "main",                                  -- default branch in case of git repo if different from master
    generate_requires_npm = false,                    -- if stand-alone parser without npm dependencies
    requires_generate_from_grammar = true,            -- if folder contains pre-generated src/parser.c
  },
  filetype = "nu",                                    -- if filetype does not match the parser name
}

I've installed the parser with TSInstall nu. And i've even tried TSInstallFromGrammer nu. But both don't give me any luck.

Please help πŸ™

Output of :checkhealth nvim-treesitter

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

Installation ~
- OK `tree-sitter` found 0.20.8 (d4c1bf7ce78051b7f4a381d1508d68928512ed5f) (parser generator, only needed for :TSInstallFromGrammar)
- OK `node` found v18.16.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) 13.2.1 20230801
- OK Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

OS Info:
{
  machine = "x86_64",
  release = "6.4.10-arch1-1",
  sysname = "Linux",
  version = "#1 SMP PREEMPT_DYNAMIC Fri, 11 Aug 2023 11:03:36 +0000"
} ~

Parser/Features         H L F I J
  - bash                βœ“ βœ“ βœ“ . βœ“
  - comment             βœ“ . . . .
  - dockerfile          βœ“ . . . βœ“
  - html                βœ“ βœ“ βœ“ βœ“ βœ“
  - json                βœ“ βœ“ βœ“ βœ“ .
  - lua                 βœ“ βœ“ βœ“ βœ“ βœ“
  - markdown            βœ“ . βœ“ . βœ“
  - markdown_inline     βœ“ . . . βœ“
  - nu                  . . . . .
  - python              βœ“ βœ“ βœ“ βœ“ βœ“
  - regex               βœ“ . . . .
  - toml                βœ“ βœ“ βœ“ βœ“ βœ“
  - vimdoc              βœ“ . . . βœ“
  - 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} ~

Ok i the config file to also include 'scanner.c' (didn't realize that was also there πŸ˜… ) and the error seems to go away, however, still no syntax highlighting 😭 could that be because of nushell version?

Screenshot_2023-09-19-12-14-34_1920x1080

Hi lay-z,
have you set the filetype of config.nu to be nu?

Have you seen https://github.com/lhKipp/nvim-nu. It's a plugin which sets up this grammar and makes it all work.

When i run :set filetype? it returns filetype=nu but still no highlighting. Maybe i'll checkout nvim-nu, perhaps will work better for me πŸ™

nvim-nu worked for me! thanks @LhKipp