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

Checkhealth nvim-treesitter throwing error for yaml #5907

Closed
Gustavohenribra opened this issue Jan 16, 2024 · 5 comments
Closed

Checkhealth nvim-treesitter throwing error for yaml #5907

Gustavohenribra opened this issue Jan 16, 2024 · 5 comments
Labels
bug Something isn't working platform Windows Issues that are specific to Windows

Comments

@Gustavohenribra
Copy link

Describe the bug

I'm getting an error when I check checkhealt to see if there's a problem, and I've tried everything to fix this yaml error, I saw in another thread that I just had to change the require using require 'nvim-treesitter.install'.compilers = { 'clang' }, however I believe I did not find the correct init.lua path to make the change, it is worth mentioning that I am on Windows 11

To Reproduce

  1. Start nvim
  2. :Checkhealth nvim-treesitter
  3. Errors for yaml appearing

Expected behavior

No response

Output of :checkhealth nvim-treesitter

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

Installation ~
- WARNING `tree-sitter` executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall)
- OK `node` found v16.13.2 (only needed for :TSInstallFromGrammar)
- OK `git` executable found.
- OK `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
  Version: cc (Rev3, Built by MSYS2 project) 13.2.0
- 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 = "10.0.22621",
  sysname = "Windows_NT",
  version = "Windows 11 Home Single Language"
} ~

Parser/Features         H L F I J
  - bash                ✓ ✓ ✓ . ✓
  - c                   ✓ ✓ ✓ ✓ ✓
  - diff                ✓ . . . .
  - html                ✓ ✓ ✓ ✓ ✓
  - javascript          ✓ ✓ ✓ ✓ ✓
  - jsdoc               ✓ . . . .
  - json                ✓ ✓ ✓ ✓ .
  - jsonc               ✓ ✓ ✓ ✓ ✓
  - lua                 ✓ ✓ ✓ ✓ ✓
  - luadoc              ✓ . . . .
  - luap                ✓ . . . .
  - markdown            ✓ . ✓ ✓ ✓
  - markdown_inline     ✓ . . . ✓
  - python              ✓ ✓ ✓ ✓ ✓
  - query               ✓ ✓ ✓ ✓ ✓
  - regex               ✓ . . . .
  - toml                ✓ ✓ ✓ ✓ ✓
  - tsx                 ✓ ✓ ✓ ✓ ✓
  - typescript          ✓ ✓ ✓ ✓ ✓
  - vim                 ✓ ✓ ✓ . ✓
  - vimdoc              ✓ . . . ✓
  - yaml                x x x x x

  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 yaml(highlights): Failed to load parser for language 'yaml': uv_dlopen: The specified procedure could not be found.
  
  yaml(highlights) is concatenated from the following files:
  | [ERROR]:"C:\Users\Gusta\AppData\Local\nvim-data\lazy\nvim-treesitter\queries\yaml\highlights.scm", failed to load: Failed to load parser for language 'yaml': uv_dlopen: The specified procedure could not be found.
- ERROR yaml(locals): Failed to load parser for language 'yaml': uv_dlopen: The specified procedure could not be found.
  
  yaml(locals) is concatenated from the following files:
  | [ERROR]:"C:\Users\Gusta\AppData\Local\nvim-data\lazy\nvim-treesitter\queries\yaml\locals.scm", failed to load: Failed to load parser for language 'yaml': uv_dlopen: The specified procedure could not be found.
- ERROR yaml(folds): Failed to load parser for language 'yaml': uv_dlopen: The specified procedure could not be found.
  
  yaml(folds) is concatenated from the following files:
  | [ERROR]:"C:\Users\Gusta\AppData\Local\nvim-data\lazy\nvim-treesitter\queries\yaml\folds.scm", failed to load: Failed to load parser for language 'yaml': uv_dlopen: The specified procedure could not be found.
- ERROR yaml(indents): Failed to load parser for language 'yaml': uv_dlopen: The specified procedure could not be found.
  
  yaml(indents) is concatenated from the following files:
  | [ERROR]:"C:\Users\Gusta\AppData\Local\nvim-data\lazy\nvim-treesitter\queries\yaml\indents.scm", failed to load: Failed to load parser for language 'yaml': uv_dlopen: The specified procedure could not be found.
- ERROR yaml(injections): Failed to load parser for language 'yaml': uv_dlopen: The specified procedure could not be found.
  
  yaml(injections) is concatenated from the following files:
  | [ERROR]:"C:\Users\Gusta\AppData\Local\nvim-data\lazy\nvim-treesitter\queries\yaml\injections.scm", failed to load: Failed to load parser for language 'yaml': uv_dlopen: The specified procedure could not be found.

Output of nvim --version

NVIM v0.9.5
Build type: RelWithDebInfo
LuaJIT 2.1.1703942320
Compilation: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe /MD /Zi /O2 /Ob1  -W3 -wd4311 -wd4146 -DUNIT_TESTING -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_WIN32_WINNT=0x0602 -DMSWIN -DINCLUDE_GENERATED_DECLARATIONS -ID:/a/neovim/neovim/.deps/usr/include/luajit-2.1 -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/build/src/nvim/auto -ID:/a/neovim/neovim/build/include -ID:/a/neovim/neovim/build/cmake.config -ID:/a/neovim/neovim/src -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include

    arquivo vimrc de sistema: "$VIM\sysinit.vim"
            padrão para $VIM: "C:/Program Files (x86)/nvim/share/nvim"

Run :checkhealth for more info

Additional context

No response

@Gustavohenribra Gustavohenribra added the bug Something isn't working label Jan 16, 2024
@theHamsta
Copy link
Member

theHamsta commented Jan 16, 2024

tree-sitter-yaml has a c++ parser. There could be a problem with loading the C++ runtime. Could you check via https://github.com/lucasg/Dependencies what DLLs yaml.so would load (in reality it is a .DLL. So you might need to rename the file).

You could use this command to get the path to yaml.so: :echo nvim_get_runtime_file('parser/yaml.so', v:true)

@clason clason added the platform Windows Issues that are specific to Windows label Jan 16, 2024
@alkyde

This comment was marked as off-topic.

@JosiahEdington
Copy link

JosiahEdington commented Jan 20, 2024

I had the same issue as Gustavo above (also after confirming I was on the same version #'s). Following your steps with Dependencies, I was given the following results:

PATH: C:\Users\jcedi\AppData\Local\nvim-data\lazy\nvim-treesitter\parser\yaml.so
image

C:\Program Files\Neovim\bin\libgcc_s_seh-1.dll
-> C:\Windows\system32\kernel32.dll
---> ext-ms-win-oobe-query-l1-1-0.dll module could not be found on disk.
-> C:\Windows\system32\user32.dll
---> ext-ms-win32-subsystem-query-l1-1-0.dll module could not be found on disk.

This Microsoft post may be useful:

image

@JosiahEdington
Copy link

JosiahEdington commented Jan 20, 2024

MY SOLUTION

After digging around from the above, I found and followed the steps of this github page, which seemed to solve my issue.

TL;DR:

  1. Either choco install zig or scoop install zig
  2. Add zig as a parser type in your init/config: require ("nvim-treesitter.install").compilers = { "zig", "clang" }
  3. I had to :TSInstal yaml for it to work.

@FlippingBinary
Copy link

The zig compiler was the only one that worked on Windows "out of the box" for me too. It's also easy to install with the Windows package manager winget, which might already be present on a developer's Windows box and can be used similarly: winget install zig.zig. It also puts an uninstaller in my Apps & features control panel, which is nice. Plus, zig is already in the default list of compilers, so my nvim-treesitter config just uses the defaults that work on my Manjaro Linux setup as well.

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

No branches or pull requests

6 participants