Stream: t-compiler/rust-analyzer

Topic: Lack of completion in impl block


Riccardo D'Ambrosio (Feb 10 2021 at 15:04, on Zulip):

Hello!

I recently started doing some things for regex simplification in my project, however, i noticed something slightly odd. RA seems to kind of just give up on anything in this impl block i have as you can see from the red lines. Is it intentional? it's a bit annoying for me. Screenshot_1960.png

the visitor macro is simply:

macro_rules! visitor {
    ($regex:expr, $src:expr) => {
        struct Visitor<'a> {
            ran: bool,
            #[allow(dead_code)]
            src: &'a str,
        }
        let mut new = Visitor {
            ran: false,
            src: $src,
        };
        new.visit_regex($regex);
        return new.ran;
    };
}
Jonas Schievink [he/him] (Feb 10 2021 at 15:05, on Zulip):

try moving the impl out of the function

Riccardo D'Ambrosio (Feb 10 2021 at 15:06, on Zulip):

Right, impls outside of functions work, however, i can't really move this impl outside

Laurențiu (Feb 10 2021 at 15:07, on Zulip):

It may be fixed in the near future

Riccardo D'Ambrosio (Feb 10 2021 at 15:10, on Zulip):

I see, i was just wondering if this is a bug

Laurențiu (Feb 10 2021 at 15:10, on Zulip):

Local items are not supported very well in the latest release

Last update: Jul 29 2021 at 08:45UTC