Bug 279359

Summary: editors/neovim: error when opening lua code
Product: Ports & Packages Reporter: Mark Johnston <markj>
Component: Individual Port(s)Assignee: Adam Weinberger <adamw>
Status: Closed DUPLICATE    
Severity: Affects Only Me CC: laurent.chardon, pi
Priority: --- Flags: bugzilla: maintainer-feedback? (adamw)
Version: Latest   
Hardware: Any   
OS: Any   

Description Mark Johnston freebsd_committer freebsd_triage 2024-05-28 02:14:40 UTC
After the recent update to 0.10.0, I get an annoying error when opening lua code.

In a freshly installed VM with no config, if I run `echo 'print("hello, world")' > test.lua` and then run `nvim test.lua`, I'm greeted with:

---
Error detected while processing BufReadPost Autocommands for "*":
Error executing lua callback: /usr/local/share/nvim/runtime/filetype.lua:35: Error executing lua: /usr/local/share/nvim/runtime/filetype.lua:36: BufReadPost Au
tocommands for "*"..FileType Autocommands for "*"..function <SNR>1_LoadFTPlugin[20]..script /usr/local/share/nvim/runtime/ftplugin/lua.lua: Vim(runtime):E5113:
 Error while calling lua chunk: ...local/share/nvim/runtime/lua/vim/treesitter/language.lua:107: no parser for 'lua' language, see :help treesitter-parsers
stack traceback:
        [C]: in function 'error'
        ...local/share/nvim/runtime/lua/vim/treesitter/language.lua:107: in function 'add'
        ...l/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:111: in function 'new'
        /usr/local/share/nvim/runtime/lua/vim/treesitter.lua:41: in function '_create_parser'
        /usr/local/share/nvim/runtime/lua/vim/treesitter.lua:108: in function 'get_parser'
        /usr/local/share/nvim/runtime/lua/vim/treesitter.lua:416: in function 'start'
        /usr/local/share/nvim/runtime/ftplugin/lua.lua:2: in main chunk
        [C]: in function 'nvim_cmd'
        /usr/local/share/nvim/runtime/filetype.lua:36: in function </usr/local/share/nvim/runtime/filetype.lua:35>
        [C]: in function 'nvim_buf_call'
        /usr/local/share/nvim/runtime/filetype.lua:35: in function </usr/local/share/nvim/runtime/filetype.lua:10>
stack traceback:
        [C]: in function 'nvim_cmd'
        /usr/local/share/nvim/runtime/filetype.lua:36: in function </usr/local/share/nvim/runtime/filetype.lua:35>
        [C]: in function 'nvim_buf_call'
        /usr/local/share/nvim/runtime/filetype.lua:35: in function </usr/local/share/nvim/runtime/filetype.lua:10>
stack traceback:
        [C]: in function 'nvim_buf_call'
        /usr/local/share/nvim/runtime/filetype.lua:35: in function </usr/local/share/nvim/runtime/filetype.lua:10>
---

The code at the top of the stack is this:

    local fname = 'parser/' .. lang .. '.*'
    local paths = api.nvim_get_runtime_file(fname, false)
    if #paths == 0 then
      error("no parser for '" .. lang .. "' language, see :help treesitter-parsers")
    end
    path = paths[1]

but there's no directory called "parser" in the runtime path.  I suspect that there are some new files not included in the neovim package.
Comment 1 Laurent Chardon 2024-05-28 09:19:49 UTC
Bug 279293 should fix that for you. Use PORTREVISION 2 and let me know if the problem remains.
Comment 2 Mark Johnston freebsd_committer freebsd_triage 2024-05-28 11:35:57 UTC
(In reply to Laurent Chardon from comment #1)
neovim-0.10.0_2 works for me.  Thanks for the very fast update!

*** This bug has been marked as a duplicate of bug 279293 ***