Open kngwyu opened 6 years ago
I am not sure if this is just a bug or it's simply not supported:
use std::ops::Deref;
struct Foo {}
impl Foo {
fn bar(&self) {
println!("nights");
}
}
struct Ref<'a, T: 'a> {
obj: &'a T,
}
impl<'a, T> Deref for Ref<'a, T> {
type Target = T;
fn deref(&self) -> &Self::Target {
self.obj
}
}
fn main() {
let a = Ref { obj: &Foo {} };
// a. // Auto-complete does not work here
}
This doesn't work with rls, but since rls is actually using racer for auto-completion, I assume that it is more appropriate to report this here.
@cynecx
Are you pointing out that racer doesn't complete a.bar()
?
Racer supports method completion based on type coercions by Deref
, but if Target
is generic type parameter, racer doesn't seem to work well.
Though I'm not sure it's a bug or not, I'm going to open a separate issue after checking more deeper.
Thanks for reporting!
@kngwyu Oh yeah, sorry, I forgot to mention that. The field obj
and the method deref
are shown in the auto-completion set, the method bar
however is not included in that set.
Hmm... Now I feel this problem more difficult than others in this roadmap, so I decided to add it to this page and not to open separate issue.
I would love to see support for use_nested_groups!
@abbec
use_nested_groups
is already supported in my nightly version
Trying right now :D
Works, awesome ❤️ !
use_nested_groups is already supported in my nightly version
@kngwyu Any plans to merge it into racer mainline?
@Dushistov I got push previlege for this repository 2 days ago so I will send a PR soon. Sorry for delay.
Here's a list of functionalities I want to implement in racer. Please comment anything you think!
Completions
Completion based on trait bounds(#706)
[x] for
FnArg
already implemented in #828[ ] for struct member
[ ] for closures
Others
[ ] closure arguments
[ ] macros in other crate(related to #777)
[ ] resolve associated type bounded by type parameter, using real type (thanks to @cynecx !)
Nightly features
[ ] impl trait(universal_impl_trait, conservative_impl_trait)
[x] dyn_trait Currently
dyn
cause parse error in racer, and racer can't complete members in a struct withdyn
, like[ ] try_trait
[ ] extern_in_paths
[x] use_nested_groups (It's stable now!)
[x] crate_visibility_modifier
Since
syntex-syntax
isn't maintained now, we needrustc-ap-syntax
to support these features.Misc
(Though I don't know anyone need this...)