Giter VIP home page Giter VIP logo

Comments (19)

clason avatar clason commented on September 26, 2024

Duplicate. Please search previous (also closed) issues.

(And please don't use Lazy for minimal repro!)

from nvim-treesitter.

rogtino avatar rogtino commented on September 26, 2024

Sorry I didn't find anything related to my issues.Could you please provide more info?
If you mean windows support#troubleshooting, I have already installed llvm and added it to my path variable.
Also I have added

require 'nvim-treesitter.install'.compilers = { "clang" }

to my config.

from nvim-treesitter.

clason avatar clason commented on September 26, 2024

First, create a minimal repro config without Lazy. (You can just clone and add nvim-treesitter to rtp directly; no need to bootstrap a plugin manager just for that.)

from nvim-treesitter.

rogtino avatar rogtino commented on September 26, 2024

Ok I just updated the reproduced steps.

from nvim-treesitter.

clason avatar clason commented on September 26, 2024

And you're running this with nvim --clean -u test.lua? (And you should install the plugin in a fresh, temporary, directory, just to make sure.)

from nvim-treesitter.

rogtino avatar rogtino commented on September 26, 2024

Hi, I'm using NVIM_APPNAME=hello nvim to config this temporary config.

from nvim-treesitter.

clason avatar clason commented on September 26, 2024

That's not the same thing.

from nvim-treesitter.

rogtino avatar rogtino commented on September 26, 2024

Ok I just tried nvim --clean -u test.lua with the same error msg.

from nvim-treesitter.

clason avatar clason commented on September 26, 2024

Ok. And now let's check, from scratch (meaning, wipe the directory before doing the following steps):

  1. Are there any :messages after startup?
  2. If you look in the cloned nvim-treesitter folder, are there any parsers in parser?
  3. If not, what does :TSInstall lua say?
  4. Clone treesitter-grammars/tree-sitter-lua somewhere and manually compile the parser; the flags are here:
    "/Fe:",
    "parser.so",
    "/Isrc",
    repo.files,
    "-Os",
    "/utf-8",
    "/LD",

from nvim-treesitter.

rogtino avatar rogtino commented on September 26, 2024

1.If I enter a empty buffer,no error, If a lua buffer,messages show:

Error detected while processing BufReadPost Autocommands for "*":
Error executing lua callback: C:\Program Files\Neovim\share\nvim\runtime\filetype.lua:35: Error executing lua: C:\Program Files\Neovim\share\nvim\runtime\filetype.lua:36: BufReadPost Autocommands for "*"..FileType Autocommands for "*"..function <SNR>1_LoadFTPlugin[20]..script C:\Program Files\Neovim\share\nvim\runtime\ftplugin\lua.lua: Vim(runtime):E5113: Error while calling lua chunk: ...eovim\share\nvim\runtime/lua/vim/treesitter/language.lua:112: Failed to load parser for language 'lua': uv_dlopen: no error                     stack traceback:                                                                                                                              [C]: in function '_ts_add_language'                                                                                                   ...eovim\share\nvim\runtime/lua/vim/treesitter/language.lua:112: in function 'add'                                                    ...m\share\nvim\runtime/lua/vim/treesitter/languagetree.lua:111: in function 'new'                                                    ...m Files\Neovim\share\nvim\runtime/lua/vim/treesitter.lua:41: in function '_create_parser'                                          ...m Files\Neovim\share\nvim\runtime/lua/vim/treesitter.lua:108: in function 'get_parser'                                             ...m Files\Neovim\share\nvim\runtime/lua/vim/treesitter.lua:416: in function 'start'                                                  C:\Program Files\Neovim\share\nvim\runtime\ftplugin\lua.lua:2: in main chunk                                                          [C]: in function 'nvim_cmd'                                                                                                           C:\Program Files\Neovim\share\nvim\runtime\filetype.lua:36: in function <C:\Program Files\Neovim\share\nvim\runtime\filetype.lua:35>                                                                                                                                        [C]: in function 'nvim_buf_call'                                                                                                      C:\Program Files\Neovim\share\nvim\runtime\filetype.lua:35: in function <C:\Program Files\Neovim\share\nvim\runtime\filetype.lua:10>                                                                                                                                stack traceback:                                                                                                                              [C]: in function 'nvim_cmd'                                                                                                           C:\Program Files\Neovim\share\nvim\runtime\filetype.lua:36: in function <C:\Program Files\Neovim\share\nvim\runtime\filetype.lua:35>                                                                                                                                        [C]: in function 'nvim_buf_call'                                                                                                      C:\Program Files\Neovim\share\nvim\runtime\filetype.lua:35: in function <C:\Program Files\Neovim\share\nvim\runtime\filetype.lua:10>                                                                                                                                stack traceback:                                                                                                                              [C]: in function 'nvim_buf_call'                                                                                                      C:\Program Files\Neovim\share\nvim\runtime\filetype.lua:35: in function <C:\Program Files\Neovim\share\nvim\runtime\filetype.lua:10> 
❯ ls
 #      name      type     size        modified
 0   .gitignore   file       16 B   an hour ago
 1   c.so         file   701.4 KB   44 minutes ago
 2   cpp.so       file     3.9 MB   44 minutes ago
 3   lua.so       file   127.0 KB   44 minutes ago

4.compile successfully with cl.exe /Fe: parser.so /Isrc src/parser.c src/scanner.c -Os /utf-8 /LD if I understand correctly:

C:\Users\kn1e1\dev\tree-sitter-lua>cl.exe /Fe: parser.so /Isrc src/parser.c src/scanner.c -Os /utf-8 /LD
Microsoft (R) C/C++ Optimizing Compiler Version 19.39.33523 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

parser.c
scanner.c
Generating Code...
Microsoft (R) Incremental Linker Version 14.39.33523.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:parser.so
/dll
/implib:parser.lib
parser.obj
scanner.obj
   Creating library parser.lib and object parser.exp

from nvim-treesitter.

clason avatar clason commented on September 26, 2024

How did you install Neovim? What does :checkhealth vim.treesitter show?

from nvim-treesitter.

clason avatar clason commented on September 26, 2024

Nevermind, I see the issue. You are configuring the plugin wrong. It should be

require'nvim-treesitter.configs'.setup()

from nvim-treesitter.

rogtino avatar rogtino commented on September 26, 2024

Hi,after using require'nvim-treesitter.configs'.setup() ,the parsers get installed automatically while the problem still exists.
Here is config now:

local path = vim.fn.stdpath("data") .. "/plug/nvim-treesitter"
if not vim.uv.fs_stat(path) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/nvim-treesitter/nvim-treesitter.git",
    path,
  })
end
vim.opt.rtp:prepend(path)
require 'nvim-treesitter.install'.compilers = { "clang" }
require("nvim-treesitter.configs").setup({
	ensure_installed = { "c", "lua", "cpp" },
	auto_install = true
})

I installed neovim by winget install neovim.neovim,the :checkhealth vim.treesitter:

- Nvim runtime ABI version: 14
- ERROR Parser "c" failed to load (path: C:\Users\kn1e1\AppData\Local\nvim-data\plug\nvim-treesitter\parser\c.so): ...eovim\share\nvim\runtime/lua/vim/treesitter/language.lua:112: Failed to load parser for language 'c': uv_dlopen: no error
- ERROR Parser "cpp" failed to load (path: C:\Users\kn1e1\AppData\Local\nvim-data\plug\nvim-treesitter\parser\cpp.so): ...eovim\share\nvim\runtime/lua/vim/treesitter/language.lua:112: Failed to load parser for language 'cpp': uv_dlopen: no error
- ERROR Parser "lua" failed to load (path: C:\Users\kn1e1\AppData\Local\nvim-data\plug\nvim-treesitter\parser\lua.so): ...eovim\share\nvim\runtime/lua/vim/treesitter/language.lua:112: Failed to load parser for language 'lua': uv_dlopen: no error
- OK Parser: bash                 ABI: 14, path: C:\Program Files\Neovim\lib\nvim\parser\bash.dll
- ERROR Parser "c" failed to load (path: C:\Program Files\Neovim\lib\nvim\parser\c.dll): ...eovim\share\nvim\runtime/lua/vim/treesitter/language.lua:112: Failed to load parser for language 'c': uv_dlopen: no error
- ERROR Parser "lua" failed to load (path: C:\Program Files\Neovim\lib\nvim\parser\lua.dll): ...eovim\share\nvim\runtime/lua/vim/treesitter/language.lua:112: Failed to load parser for language 'lua': uv_dlopen: no error
- OK Parser: markdown             ABI: 14, path: C:\Program Files\Neovim\lib\nvim\parser\markdown.dll
- OK Parser: markdown_inline      ABI: 14, path: C:\Program Files\Neovim\lib\nvim\parser\markdown_inline.dll
- OK Parser: python               ABI: 14, path: C:\Program Files\Neovim\lib\nvim\parser\python.dll
- OK Parser: query                ABI: 14, path: C:\Program Files\Neovim\lib\nvim\parser\query.dll
- OK Parser: vim                  ABI: 14, path: C:\Program Files\Neovim\lib\nvim\parser\vim.dll
- OK Parser: vimdoc               ABI: 14, path: C:\Program Files\Neovim\lib\nvim\parser\vimdoc.dll

from nvim-treesitter.

clason avatar clason commented on September 26, 2024

Please test the release from the Neovim release page.

from nvim-treesitter.

rogtino avatar rogtino commented on September 26, 2024

I tried nvim-win64.zip,same error

❯ where.exe nvim
C:\Users\kn1e1\Downloads\nvim-win64\nvim-win64\bin\nvim.exe
C:\Program Files\Neovim\bin\nvim.exe

from nvim-treesitter.

clason avatar clason commented on September 26, 2024

Then I'm out of ideas. Play with different compilers.

from nvim-treesitter.

rogtino avatar rogtino commented on September 26, 2024

I think there are some issues with clang here.
Using require 'nvim-treesitter.install'.compilers = { "cl" } sovles my problem.
But here is another one:
norg does not compile correctly:

❯ cl.exe /Fe: parser.so /Isrc src/parser.c src/scanner.cc -Os /utf-8 /LD
Microsoft (R) C/C++ Optimizing Compiler Version 19.39.33523 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

parser.c
src\tree_sitter/parser.h(8): fatal error C1083: Cannot open include file: 'stdbool.h': No such file or directory
Generating Code...
Compiling...
scanner.cc
src/scanner.cc(1): fatal error C1083: Cannot open include file: 'algorithm': No such file or directory
Generating Code...

from nvim-treesitter.

clason avatar clason commented on September 26, 2024

Yes, norg does not work. Just don't install it.

from nvim-treesitter.

byfarm avatar byfarm commented on September 26, 2024

I am also having this issue. Also on windows, neovim 0.10 and trying to use clang

from nvim-treesitter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.