racer-rust / racer

Rust Code Completion utility
MIT License
3.36k stars 279 forks source link

Completion based on trait bounds #939

Open kngwyu opened 6 years ago

kngwyu commented 6 years ago

Related: #706, #829

General roadmap

Precise roadmaps

refactor generics support

enhance scope_start's inefficiency

Method search

TypeName resolution

Related issues

letmutx commented 6 years ago

Hi! Is struct member method completions working? I can't seem to get completions with the latest master. I am using the same example above

struct S<T> {
    mem: T
}
fn f<T: Clone>(a: S<T>) {
    let b = a.mem.clo~
}
$ RUST_LOG=racer=trace ../racer/target/debug/racer complete 5 21 src/main.rs 2> trace.txt
PREFIX 71,74,clo
END

trace.txt

Weirdly enough, the testcases in tests/trait_bounds.rs pass.

kngwyu commented 6 years ago

Thanks.

Weirdly enough, the testcases in tests/trait_bounds.rs pass.

Tests contain only 'bounded by impl' cases, like

impl<T: Clone> S<T> {
    fn f(self) {
        let b = a.mem.clo~
    } 
}

, so it's not weird. I don't remember it's simply not implemented or broken, but anyway fix it later.

letmutx commented 6 years ago

Right. I was obviously overlooking that. Sorry. I would like to take a go at this.

On Wed, Oct 17, 2018 at 7:29 AM Yuji Kanagawa notifications@github.com wrote:

Thanks.

Weirdly enough, the testcases in tests/trait_bounds.rs pass.

Tests contain only 'bounded by impl' cases, like

impl S { fn f(self) { let b = a.mem.clo~ } }

, so it's not weird. I don't remember it's simply not implemented or broken, but anyway fix it later.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/racer-rust/racer/issues/939#issuecomment-430462432, or mute the thread https://github.com/notifications/unsubscribe-auth/AZcHBLvVtSfCCmh02uQ5gALD8sQAYbcvks5ulo8bgaJpZM4WTPiI .

kngwyu commented 6 years ago

@letmutx Thanks, but I want to fix this by myself, to recall what I implemented in last month.

letmutx commented 6 years ago

@kngwyu Okay. I have some progress here: https://github.com/letmutx/racer/tree/add-struct-member-trait-completions