Skip to content
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

racer does not provide complete suggestions for trait and imp #1114

Open
stuardcg opened this issue Jun 9, 2020 · 0 comments
Open

racer does not provide complete suggestions for trait and imp #1114

stuardcg opened this issue Jun 9, 2020 · 0 comments

Comments

@stuardcg
Copy link

stuardcg commented Jun 9, 2020

Taking the std::fs::File example I write

use std::fs::File;
use std::io::prelude::Write;
use std::io::ErrorKind;

fn main() {
    let mut f = File::open("story.txt").unwrap_or_else(|err| {
        if err.kind() == ErrorKind::NotFound {
            File::create("story.txt").unwrap()
        } else {
            panic!("{}", err);
        }
    });

    match f.write(b"This is my story") {
        Ok(_) => println!("The story was written."),
        Err(e) => panic!("{}", e),
    }
}

If I go to let mut f = File::open("story.txt").u

$ racer complete 6 41 ./src/main.rs

PREFIX 125,126,u
MATCH unwrap,1002,11,/home/arthaclarius/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/result.rs,Function,pub fn unwrap(self) -> T
MATCH unwrap_err,1064,11,/home/arthaclarius/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/result.rs,Function,pub fn unwrap_err(self) -> E
MATCH unwrap_or,827,11,/home/arthaclarius/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/result.rs,Function,pub fn unwrap_or(self, default: T) -> T
MATCH unwrap_or_default,1102,11,/home/arthaclarius/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/result.rs,Function,pub fn unwrap_or_default(self) -> T
END

If you check the code I can use unwrap_or_else but is not in the complete suggestions.

If I go to match f.w

$ racer complete 14 13 ./src/main.rs

PREFIX 321,322,w
END

But I was expecting write, write_vectored, write_all, and even more.

Maybe I'm wrong but It should be working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant