Closed YogiLiu closed 7 months ago
Please provide the error you are getting verbatim next time. From a cursory glance I am guessing you are nesting the returned table one level too deeply.
If you have a look at the screenshot you can see the returned tables is wrapped in an extra table, which is not the format lazy.nvim
is expecting.
Bracket highlighting achieved with rainbow-delimiters.nvim
Please see if this resolves your issue.
-- ~/.config/nvim/lua/plugins/clangd.lua
return {
"neovim/nvim-lspconfig",
opts = {
---@type lspconfig.options
servers = {
clangd = {
mason = false,
},
},
},
}
@TomJo2000 Thank you for your answer. I'm sorry that I didn't explain the problem clearly and I feel ashamed of my disrespectful behavior.
LazyVim is a Neovim setup powered by lazy.nvim, they are not the same project. So this problem has nothing to do with the format of lazy.vim
.
I will now list my reproduction steps in detail. These steps are referenced from lazyvim's official website :
pkg update
pkg install neovim git lazygit clang ripgrep fd make
git clone https://github.com/LazyVim/starter ~/.config/nvim
rm -rf ~/.config/nvim/.git
~/.config/nvim/lua/plugins/clangd.lua
and write above lua code to itlang.clangd
in :LazyExtras
and then restart neovima.c
and then type #include
, the error message will appear in noiceThe complete error message is ...ers/foo/.local/share/nvim/lazy/nvim-cmp/lua/cmp/view.lua:110: invalid order function for sorting
.
According to https://github.com/LazyVim/LazyVim/issues/1973, the problem seems to be caused by the version of LuaJIT.
I originally encountered this problem on my tablet. In order to reproduce the problem, the above operations were completed on my mobile phone. The termux on the mobile phone was also newly installed.
Screenshot:
Thank you for your answer. I'm sorry that I didn't explain the problem clearly and I feel ashamed of my disrespectful behavior.
Oh no worries you weren't being disrespectful, it's quite natural to make mistakes, that's how you learn.
I'm familar with LazyVim
and lazy.nvim
, though I do not use C/C++ or Clangd myself.
So I'm not exactly sure how to interpret the error you have provided.
It's certainly possible LuaJIT is at fault, though that wouldn't immediately make sense to me.
I did some initial digging and our LuaJIT version is currently built against LuaJIT 2.1.1703358377
.
LuaJIT doesn't do numbered releases so the last part of the version number is a UNIX Epoch timestamp.
This one translates to:
date -u --date='@1703358377'
# Sat Dec 23 07:06:17 PM UTC 2023
Which is newer than the versions mentioned in the LazyVim issue you mentioned, as such provided your LuaJIT is up to date with the version on the repos it should not be effected by the same bug.
I have installed the latest version of LuaJIT, but the output of luajit -v
is LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2021 Mike Pall. https://luajit.org/
, and the output of nvim --version
is
NVIM v0.9.5
Build type: Release
LuaJIT 2.1.0-beta3
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/data/data/com.termux/files/usr/share/nvim"
Run :checkhealth for more info
Neovim seems to have built-in LuaJIT, and there is no need to install additional LuaJIT in the repos.
I did some investigation, and it seems that this is caused by https://github.com/termux/termux-packages/issues/18847. The current LuaJIT version in the repos has actually been stuck at two years ago.
Ah that makes sense now. Do you mind if I close this as a duplicate of #18847 then?
OK, I can subscribe https://github.com/termux/termux-packages/issues/18847 to follow the latest status.
Problem description
I'm not familiar with Lua. For relevant details, please refer to: https://github.com/LazyVim/LazyVim/issues/1973
What steps will reproduce the bug?
The steps to reproduce are similar to https://github.com/LazyVim/LazyVim/issues/1973, but I made additional configuration to use the system clang instead of downloading it through mason:
What is the expected behavior?
No response
System information
termux-info: