Closed
Description
Describe the bug
treesitter/highlighter
will complain about Error executing lua ...
on ---@diagnostic disable-next-line: duplicate-set-field
and other similar doc comments.
To Reproduce
- Find a fresh computer that have never installed neovim, e.g. a ubuntu virtual machine (for best reproduction)
- Install neovim v0.9.4 via
sudo snap install nvim --classic
- Install kickstart.nvim by flowing the instruction
- Open neovim, wait for plugins to install, and navigate to one of the
@diagnostic
doc comment - Observe
treesitter/highlighter
complain about "Error executing lua"
Desktop
- OS: Ubuntu 22.04 jammy
- Terminal: zsh 5.8.1 (gnome-shell)
Neovim Version
NVIM v0.9.4
Build type: RelWithDebInfo
LuaJIT 2.1.1692716794
Compilation: /usr/bin/cc -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -W
missing-prototypes -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=always -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/build/nvim/parts/nvim
/build/.deps/usr/include/luajit-2.1 -I/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/build/src/nvim/auto -I/build/nvim/parts/nvim/build/build/include -I/build/nvim/p
arts/nvim/build/build/cmake.config -I/build/nvim/parts/nvim/build/src -I/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/bui
ld/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include -I/build/nvim/parts/nvim/build/.deps/usr/include
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"
Run :checkhealth for more info
Possible Fix
Add luadoc
to the ensure_installed
table (or list maybe?) of nvim-treesitter
, inspired by this discourse post, and worked for me.
Specifically, the following steps helped:
- Add
'luadoc',
to theensure_installed
- Restart
nvim
, wait for it to finish install - Then restart
nvim
again, navigate to one of the@diagnostic
doc comment - No more complains, yeah
For instance, change this line of code:
-- /init.lua 792~796
build = ':TSUpdate',
opts = {
-- ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' },
ensure_installed = { 'bash', 'c', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' },
-- Autoinstall languages that are not installed
auto_install = true,
Misc
Might be a bit irrelevant but, shall this be an issue or a pull request? Sorry but this is my first time actually have a solution to a potential problem of other's project. And if this kind of things should be a pull request, will it be suitable for me to directly open a pull request without opening an issue in the future (if I encounter the same situation again)?
Metadata
Metadata
Assignees
Labels
No labels