Closed txctxc closed 9 months ago
Can you apply this patch and try again?
diff --git a/nvim/lua/usr/lsp/mason.lua b/nvim/lua/usr/lsp/mason.lua
index 8d79e98f5374..e9d68e1ee6d7 100644
--- a/nvim/lua/usr/lsp/mason.lua
+++ b/nvim/lua/usr/lsp/mason.lua
@@ -1,7 +1,6 @@
-- 在 https://github.com/williamboman/mason-lspconfig.nvim 中含有所有支持的 lsp
local servers = {
"lua_ls",
- "nil_ls",
"cssls",
"html",
-- "tsserver",
@@ -39,7 +38,7 @@ if not lspconfig_status_ok then
return
end
-local all_servers = {"ccls"}
+local all_servers = {"ccls", "nil_ls"}
for i = 1, #servers do
all_servers[#all_servers + 1] = servers[i]
end
Can you apply this patch and try again?
diff --git a/nvim/lua/usr/lsp/mason.lua b/nvim/lua/usr/lsp/mason.lua index 8d79e98f5374..e9d68e1ee6d7 100644 --- a/nvim/lua/usr/lsp/mason.lua +++ b/nvim/lua/usr/lsp/mason.lua @@ -1,7 +1,6 @@ -- 在 https://github.com/williamboman/mason-lspconfig.nvim 中含有所有支持的 lsp local servers = { "lua_ls", - "nil_ls", "cssls", "html", -- "tsserver", @@ -39,7 +38,7 @@ if not lspconfig_status_ok then return end -local all_servers = {"ccls"} +local all_servers = {"ccls", "nil_ls"} for i = 1, #servers do all_servers[#all_servers + 1] = servers[i] end
After applying this patch, the bug still exists, and Mason Log DEBUG shows as:
The previous line [DEBUG 2023年11月04日 星期六 03时32分44秒] ...are/nvim/lazy/mason.nvim/lua/mason-core/package/init.lua:148: Handle InstallHandle(package=Package(name=nil), state=ACTIVE) already exist for package Package(name=nil)
is not displayed.
execute this command in nim :MasonUninstall nil
I executed this command in Neovim :MasonUninstall nil
The bug still exists. After that, I restarted my computer, opened Neovim, MasonLog DEBUG shows:
I searched on the Internet, and found onehttps://www.reddit.com/r/neovim/comments/zf44kc/cant_install_assembly_server_asm_lsp_with_mason/
with this bug:
spawn: cargo failed with exit code 101 and signal 0.
Our situations are not exactly the same.
Then I turned to https://github.com/williamboman/mason.nvim/issues/580#event-7953440352
but I do not understand it. I can not find file~/mason.nvim/lua/mason-core/managers/cargo/init.lua
on my computer.
should me the result of "ls ~/.local/share/nvim/mason/staging"
I searched on the Internet, and found one
https://www.reddit.com/r/neovim/comments/zf44kc/cant_install_assembly_server_asm_lsp_with_mason/
with this bug:↳spawn: cargo failed with exit code 101 and signal 0.
Our situations are not exactly the same. Then I turned to williamboman/mason.nvim#580 (comment) but I do not understand it. I can not find file
~/mason.nvim/lua/mason-core/managers/cargo/init.lua
on my computer.↳
I think this is unrelated
- Mason will automatically download the source code of lsp and compile it locally
- nil_ls1 is a nix language server. To compile it, nix is required. I'm using nixos, so the config works for me.
- After the patch, the nil_ls shouldn't managed by the mason. But maybe caused the cached or something else, mason.nvim still try to install nil_ls
Footnotes
Yes, it might be because our operating system is different.
https://github.com/williamboman/mason-lspconfig.nvim shows rnix
is also a LSP for Nix
language.
As a result, I installed rnix
instead of nil_ls
. It works for me.
- Mason will automatically download the source code of lsp and compile it locally
- nil_ls1 is a nix language server. To compile it, nix is required. I'm using nixos, so the config works for me.
- After the patch, the nil_ls shouldn't managed by the mason. But maybe caused the cached or something else, mason.nvim still try to install nil_ls
Footnotes
Thank you for your help. It's too difficult for me to understand these now. Maybe I can study it later and use another LSP as a replacement for now.
Can you apply the patch, and check whether the bug still exists.
Can you apply the patch, and check whether the bug still exists.您能否应用补丁,并检查错误是否仍然存在。
I followed Nix 详解(一) 像传统包管理器一样使用 Nix to install Nix on my Ubuntu.
Then I applied this change:
-- 在 https://github.com/williamboman/mason-lspconfig.nvim 中含有所有支持的 lsp
local servers = {
"lua_ls",
"nil_ls",
+ -- "rnix",
"cssls",
"html",
-- "tsserver",
"pyright",
"rust_analyzer",
"jsonls",
"yamlls",
"efm",
"vimls",
"marksman",
}
Open Neovim, the bug still exits:
clear the cache :
rm -r /home/t/.local/share/nvim/mason/staging/
and apply this one
diff --git a/nvim/lua/usr/lsp/mason.lua b/nvim/lua/usr/lsp/mason.lua
index 8d79e98f5374..e9d68e1ee6d7 100644
--- a/nvim/lua/usr/lsp/mason.lua
+++ b/nvim/lua/usr/lsp/mason.lua
@@ -1,7 +1,6 @@
-- 在 https://github.com/williamboman/mason-lspconfig.nvim 中含有所有支持的 lsp
local servers = {
"lua_ls",
- "nil_ls",
"cssls",
"html",
-- "tsserver",
@@ -39,7 +38,7 @@ if not lspconfig_status_ok then
return
end
-local all_servers = {"ccls"}
+local all_servers = {"ccls", "nil_ls"}
for i = 1, #servers do
all_servers[#all_servers + 1] = servers[i]
end
After applying these change in /nvim/lua/usr/lsp/mason.lua
:
-- 在 https://github.com/williamboman/mason-lspconfig.nvim 中含有所有支持的 lsp
local servers = {
"lua_ls",
~ -- "nil_ls",
+ -- "rnix",
"cssls",
"html",
-- "tsserver",
"pyright",
"rust_analyzer",
"jsonls",
"yamlls",
"efm",
"vimls",
"marksman",
}
local all_servers = {"ccls", "nil_ls"}
and installed nil use nix-env:
The bug still exits:
clear the cache :
rm -r /home/t/.local/share/nvim/mason/staging/
and apply this one
diff --git a/nvim/lua/usr/lsp/mason.lua b/nvim/lua/usr/lsp/mason.lua index 8d79e98f5374..e9d68e1ee6d7 100644 --- a/nvim/lua/usr/lsp/mason.lua +++ b/nvim/lua/usr/lsp/mason.lua @@ -1,7 +1,6 @@ -- 在 https://github.com/williamboman/mason-lspconfig.nvim 中含有所有支持的 lsp local servers = { "lua_ls", - "nil_ls", "cssls", "html", -- "tsserver", @@ -39,7 +38,7 @@ if not lspconfig_status_ok then return end -local all_servers = {"ccls"} +local all_servers = {"ccls", "nil_ls"} for i = 1, #servers do all_servers[#all_servers + 1] = servers[i] end
~/.local/share/nvim/mason/staging
folder is empty. I do runnedrm -r /home/t/.local/share/nvim/mason/staging/
before open Neovim:
Fine, I will try this config in a Ubuntu Virtual machine, and rewrite the instructions about installing.
I've searched open issues and searched on the Internet for similar requests
[x] Yes
I've downloaded and applied the latest version of this repository(2023y11m3d version)
[x] Yes
Problem description
When opening Neovim each time, it shows red warnings at the bottom:
[mason-lspconfig.nvim] failed to install nil_ls. Installation logs are available in :Mason and :MasonLog
Problem Screenshots[x] Mason output
[ERROR 2023年11月03日 星期五 17时59分16秒] ...e/nvim/lazy/mason.nvim/lua/mason-core/installer/init.lua:249: Installation failed for Package(name=nil) error=spawn: cargo failed with exit code 101 and signal 0.
[INFO 2023年11月03日 星期五 18时03分10秒] ...e/nvim/lazy/mason.nvim/lua/mason-core/installer/init.lua:184: Executing installer for Package(name=nil) {}
To provide more valuable information, I wroteinto
/home/t/.dotfiles/nvim/lua/usr/lsp/mason.lua
.Here is the mason log information in more detail: