-
Notifications
You must be signed in to change notification settings - Fork 916
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
bug: example treesitter ensure_installed
gets called twice which leads to install errors
#628
Comments
I'm not sure why you need the |
Thx for your respone!
I added the
If you don't prepend the file with that code, but replace the whole content, you can lose the |
return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
-- add tsx and treesitter
vim.list_extend(opts.ensure_installed, {
"tsx",
"typescript",
})
end,
},
}
|
To ensure it's not somehow my system I re-created the issue in a
FROM ubuntu:22.04
RUN apt-get update \
&& apt-get install -y \
curl \
git \
ninja-build \
g++ \
gettext \
cmake \
unzip \
curl
# https://github.com/neovim/neovim/wiki/Installing-Neovim#appimage-universal-linux-package
RUN curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage \
&& chmod u+x nvim.appimage \
&& ./nvim.appimage --appimage-extract \
&& ln -s /squashfs-root/AppRun /usr/bin/nvim
RUN mkdir -p /root/.config \
&& git clone https://github.com/LazyVim/starter /root/.config/nvim
COPY test.lua /root/.config/nvim/lua/plugins/
return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
-- add tsx and treesitter
vim.list_extend(opts.ensure_installed, {
"tsx",
"typescript",
})
end,
},
}
docker build -t lazyvim-issue . && docker run --rm -it lazyvim-issue
You should see a lot of errors. Aside from the container, I'm able to produce it on two different linux systems (Ubuntu 20.04 and OpenSuse tumbleweed) on different hardware. Can you can confirm it now? 😱 |
here is a screen capture of the issue https://calip.io/MxW6AeUZ#CYYVeBS4 I added |
No i can't confirm it. As i did it there were no errors. I use neovim latest nightly build and i don't know what version the latest appimage is. Maybe an issue with Neovim version? I don't know what to tell you since i did not encounter the errors you're talking about. |
Should be fixed now. I didn't have this issue since I just override the whole list |
@folke Just out of curiosity I don't override the whole list myself, rather I vim.list_extend to ensure_installed table whatever I want. Why did this not happen to me? In my second post I also created a new instance of Neovim from the starter template seperate from the one I already have using the new NVIM_APPNAME variable to distinguish between the 2 and just extended the treesitter options again and did not encounter the problem either. |
No idea. I also didn't have this problem when testing regular LazyVim. |
Tested. Works well. Thx for the fast responses and fix! 😍
I hear you. I tried to forward the issue |
Did you check docs and existing issues?
Neovim version (nvim -v)
NVIM v0.9.0 stable release
Operating system/version
Ubuntu 20.04 / OpenSuse Tumbleweed
Describe the bug
I'm trying to add languages to the Treesetter plugin according to the tutoral and
plugins/example.lua
, which leads to errors when installing them.Steps To Reproduce
Note, the error occurs without
NVIM_APPNAME
too.${HOME}/.config/${NVIM_APPNAME}/lua/plugins/example.lua
so it starts withNote this code is taken from the
plugins/example.lua
.Everything will install just fine BUT it will bring you "dirty" errors looking like this
My research found that this happens because of
is getting called TWICE! Due to that,
ensure_installed
contains"tsx"
and"typescript"
TWICE! which leads to a parallel installation and error of "tsx"and
"typescript"`.A solution could be ensuring that every entry is unique, or to ensure the
function
is getting called only once.Expected Behavior
No errors.
Thanks a lot for your time! I'm having a blast with this starter kit. I really love these defaults and clean keymaps! 😍
Repro
No response
The text was updated successfully, but these errors were encountered: