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
Doesn't work with rls (Rust Language Server) #16
Comments
Most likely RLS uses a different structure than I expected for some response. I'll see if I can get it installed and look for a repro, if I can't I'll update with some info on debugging so we can narrow it down. |
Ok, I tracked down the first issue - vim-lsc uses expects no space between the I see the plugin sending the I think I have a second bug here where a completion request that gets back an empty list might put us in a state where we never ask for completions again. Will dig in to that. |
Partial fix for #16 - Add a space after the `Content-Length:` header since it is what the spec calls for and strict servers expect this. - Correct index for header end to not include a trailing `\r` in the last header. - Check that the decoded content is a dict. In this case it was v:none - Only call dispatch on a correctly parsed response, don't default to `{}`. - Strip a leading space from the length header value.
I've pushed a fix for the first issue - can you pull it down and try it out? I'll keep digging on the possible problem around completion. |
Fixed also the problem where it would stop requesting completions. I can now see it sending If you have a correctly set up rls I'm thinking this should unblock you. Please pull down the latest and let me know how it works for you. If you still see issues the next step is to try capture the messages being sent back and forth and see if we're missing something the server expects to get it configured properly. I tried setting the #!/bin/bash
tee in.log | rls | tee out.log Then point your vim config to run that script instead of rls directly. |
Hello It helped a lot. I still have some smallish issues, but it mostly works:
I have logs for these, but it seems I'm unable to attach them currently (my internet connection is very broken at the moment and it times out or something). If they are needed, I'll send them over the weekend, when I get to a better connection. I'm attaching at least the corresponding request:
I noticed this doesn't happen every time on the same place. If I first let it do some completion, then go-to-definition twice in a row and the second is into another file, this happens. If I just jum through definitions or just do completions, it works fine. Regarding setting up rls, you probably need something like:
(I'm not sure if all this is still needed, they gradually improve the experience, but rls is still very young) |
Glad to hear it's working 😄
Yeah I should have done this a while ago - it doesn't currently honor the triggerCharacters suggested by the server. Filed #18 to track.
I'm not sure I follow. Is this during completion? A screenshot and logs would definitely help here.
|
This came up in #16 where an exception during message handling gets swallowed and the error is about decoding.
Ah, I made a mistake where lots of exceptions could show up like decoding issues. Sync past 33b6259 and hopefully we can better track down where your complete or goto definition issues are coming from. |
Fixed the triggerCharacters as well. Remaining issue, I think, is "It seems rls sometimes sends multi-line definitions which look a bit un-aesthetical in the output" - If you can give some more information on this I can take a look. |
Thank you, the I still can't attach to github, so I put the screenshot elsewhere: https://vorner.cz/tmp/lsc.png. As you can notice, the definitions of the functions are really multi-line in the source file, and I guess rls really sends them so (the logs agree with the theory). It's nothing serious, I just think it would look a bit nicer to either cut-off on the first newline or turn all successive whitespace (including newlines) into single space. The logs are https://vorner.cz/tmp/log.in (vim → rls) and https://vorner.cz/tmp/log.out (rls → vim). The completion on the screenshot is id 9. |
Fixes remaining issue in #16 Some servers send multiline detail strings in completion suggestions. Split to just the first line to avoid ugly characters and long menu.
Thanks for the details - that what just what I needed. The "No write since last change" sounds like trying to jump to a definition in another file and not having 8278065 should fix the last remaining issue with the long lines in the completion menu - I'm truncating to the first line so you won't see anything after the first Hopefully this covers everything. If you run into further problems you can reopen this issue or file a new one. |
Hello
When I try to use vim-lsc with rls (rust language server), I get this error:
I think the rls is installed correctly, because it works in neovim with autozimu/LanguageClient-neovim, but I'd actually prefer to use the original vim over neovim. I don't have any other language server installed right now, so I can't check if it is broken with some other one.
How should I debug this further?
The text was updated successfully, but these errors were encountered: