I have duplicated entries in completion list. Duplications are not everywhere, but i.e., for env::args().
all functions will be present 3 times.
Here's gif with demo:
VSCode: 1.31.1
Extension version: 0.5.3
Any other RLS or Rust completion extension is not installed.
Ok, so it seems like the problem in RLS itself. What I understood from description - it uses racer for providing completions. Tried to invoke racer manually. Here's the result:
λ racer complete 3 16 src/main.rs | rg collect
MATCH collect,1476,7,/Users/rpeshkov/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/../libcore/iter/iterator.rs,Function,fn collect<B: FromIterator<Self::Item>>(self) -> B where Self: Sized
So, collect
occurs only once in racer's result.
Also, launched LSP inspector from Microsoft to check what language server sends to VSCode and found there 3 occurrences of collect
function and other functions as well. Log file:
rust.log.
Didn't manage to setup debuggable rls
environment. I'm noob in rust. Hope to have success tomorrow :)
Ok, figured out the problem. Prize goes to racer. I've tested racer completion while I had 2.0 version. RLS is built against 2.1 version. When I checked what happens when I invoke racer complete 3 16 src/main.rs
on racer 2.1 - it returns me duplicated entries. It happens because before deduplication of matches, matches are not sorted and dedup_by
function removes only consecutive elements.
Made a fix for this behaviour in Racer and opened PR https://github.com/racer-rust/racer/pull/1021
Fixed in https://github.com/rust-lang/rls/pull/1402, should be available in the newest nightly toolchain in 1-2 days.
Closing this as fixed (remember that it's available since Rust 1.35)
@Xanewok I guess this problem continues.
$ racer complete 16 9 src/main.rs
PREFIX 289,289,
MATCH username,2,4,src/main.rs,StructField,String
MATCH email,3,4,src/main.rs,StructField,String
MATCH sign_in_count,4,4,src/main.rs,StructField,u64
MATCH active,5,4,src/main.rs,StructField,bool
END
However, in VS Code, it looks like this:
Please let me know if you need any other debugging information.
Most helpful comment
@Xanewok I guess this problem continues.
However, in VS Code, it looks like this:
Please let me know if you need any other debugging information.