Closed takase1121 closed 3 years ago
Strange, I tested on linux by renaming one of my lsp servers from lspcommand to lspcommand.exe and it still works. Could it be that the PATH envar isn't been properly given to lite-xl/lua by windows? What would be the output in windows of the following snippet when run inside of lite-xl?
print(os.getenv("PATH"))
As a workaround one may also provide the absolute path of the lsp server executable.
no that's not the problem, the problem is util.command_exist
, which tries to find the file in PATH. .exe
isn't appended there.
No window machine to test since it is the first thing I remove when getting one :disappointed: but if that is the case then util.split
may be at fault... but as I said I tested on linux by renaming or symlinking to a lsp server with a .exe appended to it and setting the command to point to it with lspconfig and it still worked.
Edit: pfff I reproduced the issue, the symlink test I did was dumb :smile: working on the fix
great to hear that :3 I was working on a repro since I'm not the one who discovered the issue. I was going to PR but don't really have time. Thanks!
Mmm, it works when launching from a shell but not from the .desktop file ...
Nope, I was wrong the thing is I have some additional paths added to my zsh rc file which aren't added globally so that is in my case why launching from shell works but not from the .desktop file. So in the end yes it works, can not reproduce the issue... Also was logging the path scanning and I don't see anything wrong:
closing since could not reproduce
local lsp = require "plugins.lsp"
lsp.add_server {
name = "powershell",
language = "lua",
file_patterns = { "%.lua$" },
command = { "powershell" },
verbose = false
}
Windows executables has
.exe
at the end.