Closed lost22git closed 2 years ago
the same problem even if manually add %LOCALAPPDATA%\nvim-data\mason\bin to PATH
> $env:PATH | rg -i mason
Hello! So on Windows, Neovim (or more precisely libuv) doesn't recognize .cmd
commands in PATH. libuv is used by Neovim's LSP client to start servers. You have a few options:
cmd
override when setting up the server (the cmd
you provided is the default anyway).cmd
to "typescript-language-server.cmd"
(I think this should work):h exepath()
to ask Neovim to find the absolute path of an executable: cmd = { vim.fn.exepath("typescript-language-server"), "--stdio" }
.cmd
scripts in PATH, such as cmd.exe
(this is what lspconfig
does internally): cmd = { "cmd.exe", "/C", "typescript-language-server", "--stdio" }
@williamboman Thank you for your timely response.
don't provide a cmd override when setting up the server (the cmd you provided is the default anyway)
This approach is not always successful, for example, it fails under zls.
But vim.fn.exepath
works for me now
Ah yeah there are a few servers who cmd needs to be patched on Windows, for the same underlying reason as above. mason-lspconfig patches these cmds automatically for you.
I believe this to be an issue that should be addressed by maintainers of mason.nvim.
Why do you think this is an issue with mason.nvim?
Can not find the installed lsp server executable file in windows
Neovim version (>= 0.7)
NVIM v0.7.2 Build type: RelWithDebInfo LuaJIT 2.1.0-beta3 Compiled by runneradmin@fv-az276-503
Operating system/version
win11
I've manually reviewed logs to find potential errors
I've recently downloaded the latest plugin version of mason.nvim
Affected packages
all
Problem description
MasonLog
No content
LspLog
Steps to reproduce
config tsserver in lspconfig
config mason lspconfig
Actual behavior
Can not find the ts server executable file in windows
Expected behavior
ts lsp server start successuflly when open ts file
Healthcheck
Screenshots or recordings
No response