Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Most features don't work on one of my projects #440

Closed
vorner opened this issue Aug 13, 2017 · 8 comments
Closed

Most features don't work on one of my projects #440

vorner opened this issue Aug 13, 2017 · 8 comments
Labels

Comments

@vorner
Copy link

vorner commented Aug 13, 2017

I use rls from rustup, inside neo-vim. In many projects and crates, it works like a charm ‒ I get completion suggestions, marks around compilation errors, goto definition, list of references ‒ in short, much better things than I'm used to from coding in C or C++ already.

However, in one of my projects (https://gitlab.labs.nic.cz/turris/pakon-aggregator), only the completion works to some extend and all the other features do nothing at all. I don't know if it's because the project is large in scope, contains complex code or has a lot of dependencies.

I captured rls's logs, stdin and stdout for both the good and bad scenario. In both scenarios, I cleared the target directory, so the logs contain the initial parsing, opened a file in the project, waited for rls to catch up (eg. as long as it showed some activity in top), then tried to do one hower and one go to definition command.

From what I can see, both inputs seem very similar, but in the broken case, empty results are returned. In both cases the log contains some errors from rustc („Mis-calculated spans“), but I have no idea if these might be related.

The versions I have:

$ rustc --verbose --version
rustc 1.21.0-nightly (215e0b10e 2017-08-08)
binary: rustc
commit-hash: 215e0b10eac17e43f0132971f4e2dd018fc33d43
commit-date: 2017-08-08
host: x86_64-unknown-linux-gnu
release: 1.21.0-nightly
LLVM version: 4.0

$ rustup run nightly rls --version --verbose
rls 0.1.0-nightly (5d4bbd9 2017-08-07)

$ racer --version
racer 2.0.10

good.in.txt
good.log.txt
good.out.txt
bad.in.txt
bad.log.txt
bad.out.txt

If it's really needed, I could try installing vscode (but it doesn't seem to be offered by my distribution, not as a package), but from the input and output of rls, it seems like the communication is sane, just that the results are empty.

@nrc
Copy link
Member

nrc commented Aug 13, 2017

only the completion works to some extend and all the other features do nothing at all.

This indicates that the RLS is 'working' but it has no data from the compiler for some reason (completion is provided by Racer). Empty result sets are also indicative of that.

Could you run with RUST_LOG=rls_analysis=info please, that should tell you what we're reading in from disk.

Probably a good idea to rustup update as well just to make sure you have the absolute latest versions of everything.

@vorner
Copy link
Author

vorner commented Aug 15, 2017

The original logs were with RUST_LOG=info, which AFAIK should contain info log of the rls_analysis as well. However I just updated to the newest and re-run (yes, the problem is still present) it with restricting the logs to rls_analysis only. Here they are (I'm posting only the broken case here).

analysis.log.txt

I was wondering, I saw the explanation that rls uses the compiler if it is fast enough and falls back to racer if the compiler is slow to respond. Could this be the reason why it prefers racer? Does this fallback happen on the other features as well? That project does take a long time to compile.

@nrc
Copy link
Member

nrc commented Aug 15, 2017

I saw the explanation that rls uses the compiler if it is fast enough and falls back to racer if the compiler is slow to respond

We actually don't do this any more by default (we used to do it for 'goto def' only). We now use compiler info for everything except code completion, and that uses Racer.

@Ronaldho80
Copy link

I have the same problem. My configuration is the same: Rust 1.21 nightly, neovim Rust plugin.

In bigger projects, I only get code completion (if at all). In smaller projects it works. However, I do not get code completion.

@radix
Copy link

radix commented Sep 8, 2017

Is this Is this just a duplicate of #263? I notice your linked project uses cargo workspaces.

@vorner
Copy link
Author

vorner commented Sep 8, 2017

It uses them now, but I split it into it quite recently ‒ it didn't use it at the time of the report.

If you want to have a look, you can check for example commit 15382717abbaea169b544d6d6e9416fb4fae79b8.

@nrc nrc added the bug label Oct 30, 2017
@nrc nrc added this to the 1.0 milestone Oct 30, 2017
@nrc
Copy link
Member

nrc commented Oct 30, 2017

For 1.0 we should at least try to reproduce this issue and decide how serious it is.

@nrc nrc removed this from the 1.0 milestone Apr 13, 2018
@nrc
Copy link
Member

nrc commented Apr 19, 2018

We've addressed a lot of stability problems recently, especially around workspaces. This issue pre-dates those, so I'll close, but please open new issues if there are still problems.

@nrc nrc closed this as completed Apr 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants