rls icon indicating copy to clipboard operation
rls copied to clipboard

No completion / hover info when function contains generic Fn(Once)

Open hasezoey opened this issue 5 years ago • 0 comments

(similar to https://github.com/rust-lang/rls/issues/674#issuecomment-361060293) i dont know if this is a duplicate or so, but i tried to search for something similar but didnt find anything

The Problem

When hovering or just autocompletion, it dosnt show something like unwrap_or_else but something like unwrap_or, but when i change pub fn unwrap_or_else<F: FnOnce() -> T>(self, f: F)(rust source code) to something like pub fn unwrap_or_else<F: String>(self, f: F) (removing the FnOnce() -> T), it magicly shows autocompletion and hover info

i know for sure that it is not happening on all generics, but only on those who include FnOnce and from what i could test is, when defining the function in the same file it needs to get info from, it just works

Using

VSCode: 1.41.1 Rust (rls) [rust-lang.rust]: 0.7.0 toolchain: nightly (project compiled in stable, but shouldnt affect rls autocompletion (compiled in different terminal)) OS: Linux Mint 19.3 config:

{
	"rust-client.updateOnStartup": true,
	"rust.unstable_features": true,
	"rust-client.channel": "nightly",
}

usage / reproduction

fn main() {
 let Some(()).unwrap_ // autocompletion will only show "unwrap_or", "unwrap_none", "unwrap_or_default"
}

hasezoey avatar Jan 04 '20 23:01 hasezoey