-
Notifications
You must be signed in to change notification settings - Fork 4
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
Incorrect use of args passing in plugin.toml leads to logfile not working #4
Comments
I added a wrapper script passing the desired arguments to pylsp, and |
Yeah, using |
Nevermind I got it working! Turns out I was missing the language id from your pr @dholth |
Mind blown! Now I just have to get it running myself, trying cargo clean on the main editor build... |
And we have to figure out how to compile the entire lsp in wasi :) |
Suggest renaming to executable_args or just args |
No need for the lsp compilation in wasi! What is done for rust-analyze, and gopls is simply checks to make sure the necessary lsp server is installed. If not, a more robust plugin could warn the user to install it, or better yet, to install it for the user, just like vscode would do. as of new, I know my golang plugin stops and warns the user gopls was not found, and rust-analyzer downloads it's own lsp binary (which is not the best as it doesn't check for a local one, but that's another issue). I might as well rename it yes, args seems good as binary is already in the section name above ([configuration.options.binary]) |
In other words the name of the binary path could match the name of the options executable / executable or binary / binary
|
I got it working over here! Very neat. lapce makes me feel like I'm using a fast computer, because I am using a fast computer. Then it crashes but you have to take what you can get :) |
Just pushed an update where I renamed it to args! I prefer binary instead of executable but that's a purely subjective choice :) |
It's not the plugin, just the whole editor likes to crash on OSX when you do things like "save a file" or whatever. Not all the time, just often enough to be exciting. I suppose we think a Python script, a text file with the +x bit, is just executable and not binary. It doesn't exactly matter but it should be called the same thing in both places. Or put both path, args in [configuration.options.executable/binary] |
Very true! I can nest a check on either binary or executable in the options, but I suggest not bothering because the whole plugin.toml file will probably change once a plugin api draft is created |
I think that's what lapce-rust is doing here: https://github.com/lapce/lapce-rust/blob/9003eb1d29b95cad64a4f25ded4a9c89dab5dcf5/src/main.rs#L53-L57 A warning if pyls isn't found and instructions to |
Yes lapce-rust does install rust analyzer. The caveat being that it doesn't check if rust-analyzer is already installed, so you end up with a copy. The end goal to me would be to check and invoke directly all necessary commands if the user confirms some prompt . But I think an actual draft of the plugin api is more important than taking care of these problems for now! |
Agreed, and thanks for everything you've been doing! |
No problem! I'm glad my PR ended up making pylsp work. Now that it's merged, it should help more lsp servers to work out of the box in the future! If you have any questions, feel free to ping me wherever you want, but I'm more active on the discord :) |
Hello @superlou ,
I have taken a look at your try of the pylsp server. I noticed the reason you consider
--logfile
to not be passed to the plugin is actually because it is not implemented on master. On my PR there is a way, using binary_args. Here is an updated plugin.toml that will make the logfile working:the
pylsp-logs
file will be created where lapce lies (for me, as I ran lapce usingcargo run --bin lapce
, the file is created on my fork's folder). here is the output on my side:My theory is that it's because of the way the sandbox is created: as there is no python env, the plugin can't find any modules as it doesn't know where to look at. This is in theory pretty simple to solve, and I'm gonna try to look into it asap.using
pip install "python-lsp-server[all]"
solves this problem, and patching the Golang PR with this PR makes it run!The text was updated successfully, but these errors were encountered: