nvim-orgmode / orgmode

Orgmode clone written in Lua for Neovim 0.9+.
https://nvim-orgmode.github.io/
MIT License
3.04k stars 134 forks source link

Failed to load parser uv_dlopen on Windows #141

Closed hasansujon786 closed 2 years ago

hasansujon786 commented 2 years ago

Describe the bug

On windows with master branch(new treesitter support) while I open or save a org file it shows "Error executing vim.schedule lua callback: Failed to load parser: uv_dlopen: The specified procedure could not be found. And every org features doesn't work anymore.

But on my other Linux pc it works fine.

Steps to reproduce

  1. Open a orgfile.
  2. Enter :w to save the file.
  3. It will show the error.

Expected behavior

TreeSitter should parse the file correctly.

Emacs functionality

No response

Minimal init.lua

vim.cmd [[set runtimepath=$VIMRUNTIME]] vim.cmd [[set packpath=/tmp/nvim/site]]

local package_root = '/tmp/nvim/site/pack' local install_path = package_root .. '/packer/start/packer.nvim'

local function load_plugins() require('packer').startup { { 'wbthomason/packer.nvim', {'nvim-treesitter/nvim-treesitter', run = ':TSUpdate'}, {'kristijanhusak/orgmode.nvim', branch = 'tree-sitter' }, }, config = { package_root = package_root, compile_path = install_path .. '/plugin/packer_compiled.lua', }, } end

_G.load_config = function() require('nvim-treesitter.configs').setup({})

local parser_config = require('nvim-treesitter.parsers').get_parser_configs()

parser_config.org = { install_info = { url = 'https://github.com/milisims/tree-sitter-org', revision = 'main', files = {'src/parser.c', 'src/scanner.cc'}, }, filetype = 'org', } vim.cmd[[packadd nvim-treesitter]] vim.cmd[[TSUpdate]]

require('orgmode').setup() end

if vim.fn.isdirectory(install_path) == 0 then vim.fn.system { 'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path } load_plugins() require('packer').sync() vim.cmd [[autocmd User PackerComplete ++once lua load_config()]] else load_plugins() require('packer').sync() _G.load_config() end

Screenshots and recordings

Screenshot (8)

OS / Distro

Windows 10

Neovim version/commit

NVIM v0.5.1

Additional context

No response

kristijanhusak commented 2 years ago

Are you using other treesitter parsers or this is the only one? nvim-treesitter has a section about windows support here https://github.com/nvim-treesitter/nvim-treesitter/wiki/Windows-support, and Troubleshooting section mentiones similar issue. Can you try following that instruction and see if it helps?

kristijanhusak commented 2 years ago

@hasansujon786 did you manage to set it up?

kristijanhusak commented 2 years ago

Closing due to inactivity.

azinsharaf commented 1 year ago

@kristijanhusak i am having the same issue in neovim and treesitter on windows. Will check the troubleshooting link and update you here.

azinsharaf commented 1 year ago

nope, didn't work

azinsharaf commented 1 year ago

ok, i was able to fix it by using this treesitter.lua file instead of the one i had.

return {
  "nvim-treesitter/nvim-treesitter",
  dependencies = { "windwp/nvim-ts-autotag", "JoosepAlviste/nvim-ts-context-commentstring" },
  init = function() table.insert(astronvim.file_plugins, "nvim-treesitter") end,
  cmd = {
    "TSBufDisable",
    "TSBufEnable",
    "TSBufToggle",
    "TSDisable",
    "TSEnable",
    "TSToggle",
    "TSInstall",
    "TSInstallInfo",
    "TSInstallSync",
    "TSModuleInfo",
    "TSUninstall",
    "TSUpdate",
    "TSUpdateSync",
  },
  build = ":TSUpdate",
  opts = {
    highlight = { enable = true },
    incremental_selection = { enable = true },
    autotag = { enable = true },
    context_commentstring = { enable = true, enable_autocmd = false },
  },
  config = require "plugins.configs.nvim-treesitter",
}