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

Completion error: "- Could not match expr node type" #323

Open
bruno-medeiros opened this issue Aug 3, 2015 · 2 comments
Open

Completion error: "- Could not match expr node type" #323

bruno-medeiros opened this issue Aug 3, 2015 · 2 comments

Comments

@bruno-medeiros
Copy link

Racer outputs this error:

PREFIX 46,46,
- Could not match expr node type: ExprMac(Spanned { node: MacInvocTT(path(vec), [TtToken(Span { lo: BytePos(34), hi: BytePos(45), expn_id: ExpnId(4294967295) }, Ident(Philosopher#0, ModName)), TtToken(Span { lo: BytePos(45), hi: BytePos(47), expn_id: ExpnId(4294967295) }, ModSep), TtToken(Span { lo: BytePos(47), hi: BytePos(50), expn_id: ExpnId(4294967295) }, Ident(new#0, Plain)), TtDelimited(Span { lo: BytePos(50), hi: BytePos(68), expn_id: ExpnId(4294967295) }, Delimited { delim: Paren, open_span: Span { lo: BytePos(50), hi: BytePos(51), expn_id: ExpnId(4294967295) }, tts: [TtToken(Span { lo: BytePos(51), hi: BytePos(67), expn_id: ExpnId(4294967295) }, Literal(Str_(              (64)), None))], close_span: Span { lo: BytePos(67), hi: BytePos(68), expn_id: ExpnId(4294967295) } }), TtToken(Span { lo: BytePos(68), hi: BytePos(69), expn_id: ExpnId(4294967295) }, Comma), TtToken(Span { lo: BytePos(79), hi: BytePos(90), expn_id: ExpnId(4294967295) }, Ident(Philosopher#0, ModName)), TtToken(Span { lo: BytePos(90), hi: BytePos(92), expn_id: ExpnId(4294967295) }, ModSep), TtToken(Span { lo: BytePos(92), hi: BytePos(95), expn_id: ExpnId(4294967295) }, Ident(new#0, Plain)), TtDelimited(Span { lo: BytePos(95), hi: BytePos(113), expn_id: ExpnId(4294967295) }, Delimited { delim: Paren, open_span: Span { lo: BytePos(95), hi: BytePos(96), expn_id: ExpnId(4294967295) }, tts: [TtToken(Span { lo: BytePos(96), hi: BytePos(112), expn_id: ExpnId(4294967295) }, Literal(Str_(              (64)), None))], close_span: Span { lo: BytePos(112), hi: BytePos(113), expn_id: ExpnId(4294967295) } }), TtToken(Span { lo: BytePos(113), hi: BytePos(114), expn_id: ExpnId(4294967295) }, Comma), TtToken(Span { lo: BytePos(124), hi: BytePos(135), expn_id: ExpnId(4294967295) }, Ident(Philosopher#0, ModName)), TtToken(Span { lo: BytePos(135), hi: BytePos(137), expn_id: ExpnId(4294967295) }, ModSep), TtToken(Span { lo: BytePos(137), hi: BytePos(140), expn_id: ExpnId(4294967295) }, Ident(new#0, Plain)), TtDelimited(Span { lo: BytePos(140), hi: BytePos(153), expn_id: ExpnId(4294967295) }, Delimited { delim: Paren, open_span: Span { lo: BytePos(140), hi: BytePos(141), expn_id: ExpnId(4294967295) }, tts: [TtToken(Span { lo: BytePos(141), hi: BytePos(152), expn_id: ExpnId(4294967295) }, Literal(Str_(         (65)), None))], close_span: Span { lo: BytePos(152), hi: BytePos(153), expn_id: ExpnId(4294967295) } }), TtToken(Span { lo: BytePos(153), hi: BytePos(154), expn_id: ExpnId(4294967295) }, Comma), TtToken(Span { lo: BytePos(164), hi: BytePos(175), expn_id: ExpnId(4294967295) }, Ident(Philosopher#0, ModName)), TtToken(Span { lo: BytePos(175), hi: BytePos(177), expn_id: ExpnId(4294967295) }, ModSep), TtToken(Span { lo: BytePos(177), hi: BytePos(180), expn_id: ExpnId(4294967295) }, Ident(new#0, Plain)), TtDelimited(Span { lo: BytePos(180), hi: BytePos(203), expn_id: ExpnId(4294967295) }, Delimited { delim: Paren, open_span: Span { lo: BytePos(180), hi: BytePos(181), expn_id: ExpnId(4294967295) }, tts: [TtToken(Span { lo: BytePos(181), hi: BytePos(202), expn_id: ExpnId(4294967295) }, Literal(Str_(                   (66)), None))], close_span: Span { lo: BytePos(202), hi: BytePos(203), expn_id: ExpnId(4294967295) } }), TtToken(Span { lo: BytePos(203), hi: BytePos(204), expn_id: ExpnId(4294967295) }, Comma), TtToken(Span { lo: BytePos(214), hi: BytePos(225), expn_id: ExpnId(4294967295) }, Ident(Philosopher#0, ModName)), TtToken(Span { lo: BytePos(225), hi: BytePos(227), expn_id: ExpnId(4294967295) }, ModSep), TtToken(Span { lo: BytePos(227), hi: BytePos(230), expn_id: ExpnId(4294967295) }, Ident(new#0, Plain)), TtDelimited(Span { lo: BytePos(230), hi: BytePos(249), expn_id: ExpnId(4294967295) }, Delimited { delim: Paren, open_span: Span { lo: BytePos(230), hi: BytePos(231), expn_id: ExpnId(4294967295) }, tts: [TtToken(Span { lo: BytePos(231), hi: BytePos(248), expn_id: ExpnId(4294967295) }, Literal(Str_(               (67)), None))], close_span: Span { lo: BytePos(248), hi: BytePos(249), expn_id: ExpnId(4294967295) } })], 0), span: Span { lo: BytePos(19), hi: BytePos(256), expn_id: ExpnId(4294967295) } }, Bracket)
END

With the following source:

use std::thread;
struct Philosopher { name : String }
impl Philosopher {
    fn new(name: &str) -> Philosopher {
        Philosopher { name: name.to_string() }
    }
    fn eat(&self) {
        println!("{} started eating.", self.name);
        thread::sleep_ms(1000);
        println!("{} is done eating.", self.name);
    }
}

fn main()
{
    let philosephers = vec![
        Philosopher::new("Baruch Spinoza"),
        Philosopher::new("Gilles Deleuze"),
        Philosopher::new("Karl Marx"),
        Philosopher::new("Friedrich Nietzsche"),
        Philosopher::new("Michel Foucault")
    ];

    let thread_handles: Vec<_> = philosephers.into_iter().

    for p in &philosephers {
        p.eat();
    }
}

When racer complete-with-snippet 24 46 is invoked in such file (the point right after Vec<_> = philosephers.)

@bruno-medeiros bruno-medeiros changed the title "- Could not match expr node type" Completion error: "- Could not match expr node type" Aug 3, 2015
@phildawes
Copy link
Collaborator

Hi Bruno, I'm afraid this is because racer isn't currently able to handle
macros.

On Mon, Aug 3, 2015 at 6:35 PM, Bruno Medeiros [email protected]
wrote:

Racer outputs this error:

PREFIX 46,46,

  • Could not match expr node type: ExprMac(Spanned { node: MacInvocTT(path(vec), [TtToken(Span { lo: BytePos(34), hi: BytePos(45), expn_id: ExpnId(4294967295) }, Ident(Philosopher#0, ModName)), TtToken(Span { lo: BytePos(45), hi: BytePos(47), expn_id: ExpnId(4294967295) }, ModSep), TtToken(Span { lo: BytePos(47), hi: BytePos(50), expn_id: ExpnId(4294967295) }, Ident(new#0, Plain)), TtDelimited(Span { lo: BytePos(50), hi: BytePos(68), expn_id: ExpnId(4294967295) }, Delimited { delim: Paren, open_span: Span { lo: BytePos(50), hi: BytePos(51), expn_id: ExpnId(4294967295) }, tts: [TtToken(Span { lo: BytePos(51), hi: BytePos(67), expn_id: ExpnId(4294967295) }, Literal(Str_( (64)), None))], close_span: Span { lo: BytePos(67), hi: BytePos(68), expn_id: ExpnId(4294967295) } }), TtToken(Span { lo: BytePos(68), hi: BytePos(69), expn_id: ExpnId(4294967295) }, Comma), TtToken(Span { lo: BytePos(79), hi: BytePos(90), expn_id: ExpnId(4294967295) }, Ident(Philosopher#0, ModName)
    ), TtTok
    en(Span { lo: BytePos(90), hi: BytePos(92), expn_id: ExpnId(4294967295) }, ModSep), TtToken(Span { lo: BytePos(92), hi: BytePos(95), expn_id: ExpnId(4294967295) }, Ident(new#0, Plain)), TtDelimited(Span { lo: BytePos(95), hi: BytePos(113), expn_id: ExpnId(4294967295) }, Delimited { delim: Paren, open_span: Span { lo: BytePos(95), hi: BytePos(96), expn_id: ExpnId(4294967295) }, tts: [TtToken(Span { lo: BytePos(96), hi: BytePos(112), expn_id: ExpnId(4294967295) }, Literal(Str_( (64)), None))], close_span: Span { lo: BytePos(112), hi: BytePos(113), expn_id: ExpnId(4294967295) } }), TtToken(Span { lo: BytePos(113), hi: BytePos(114), expn_id: ExpnId(4294967295) }, Comma), TtToken(Span { lo: BytePos(124), hi: BytePos(135), expn_id: ExpnId(4294967295) }, Ident(Philosopher#0, ModName)), TtToken(Span { lo: BytePos(135), hi: BytePos(137), expn_id: ExpnId(4294967295) }, ModSep), TtToken(Span { lo: BytePos(137), hi: BytePos(140), expn_id: ExpnId(4294967295) }, Ident(new#0,
    Plain)),
    TtDelimited(Span { lo: BytePos(140), hi: BytePos(153), expn_id: ExpnId(4294967295) }, Delimited { delim: Paren, open_span: Span { lo: BytePos(140), hi: BytePos(141), expn_id: ExpnId(4294967295) }, tts: [TtToken(Span { lo: BytePos(141), hi: BytePos(152), expn_id: ExpnId(4294967295) }, Literal(Str_( (65)), None))], close_span: Span { lo: BytePos(152), hi: BytePos(153), expn_id: ExpnId(4294967295) } }), TtToken(Span { lo: BytePos(153), hi: BytePos(154), expn_id: ExpnId(4294967295) }, Comma), TtToken(Span { lo: BytePos(164), hi: BytePos(175), expn_id: ExpnId(4294967295) }, Ident(Philosopher#0, ModName)), TtToken(Span { lo: BytePos(175), hi: BytePos(177), expn_id: ExpnId(4294967295) }, ModSep), TtToken(Span { lo: BytePos(177), hi: BytePos(180), expn_id: ExpnId(4294967295) }, Ident(new#0, Plain)), TtDelimited(Span { lo: BytePos(180), hi: BytePos(203), expn_id: ExpnId(4294967295) }, Delimited { delim: Paren, open_span: Span { lo: BytePos(180), hi: BytePos(181), expn_id: Ex
    pnId(429
    4967295) }, tts: [TtToken(Span { lo: BytePos(181), hi: BytePos(202), expn_id: ExpnId(4294967295) }, Literal(Str_( (66)), None))], close_span: Span { lo: BytePos(202), hi: BytePos(203), expn_id: ExpnId(4294967295) } }), TtToken(Span { lo: BytePos(203), hi: BytePos(204), expn_id: ExpnId(4294967295) }, Comma), TtToken(Span { lo: BytePos(214), hi: BytePos(225), expn_id: ExpnId(4294967295) }, Ident(Philosopher#0, ModName)), TtToken(Span { lo: BytePos(225), hi: BytePos(227), expn_id: ExpnId(4294967295) }, ModSep), TtToken(Span { lo: BytePos(227), hi: BytePos(230), expn_id: ExpnId(4294967295) }, Ident(new#0, Plain)), TtDelimited(Span { lo: BytePos(230), hi: BytePos(249), expn_id: ExpnId(4294967295) }, Delimited { delim: Paren, open_span: Span { lo: BytePos(230), hi: BytePos(231), expn_id: ExpnId(4294967295) }, tts: [TtToken(Span { lo: BytePos(231), hi: BytePos(248), expn_id: ExpnId(4294967295) }, Literal(Str_( (67)), None))], close_span: Span { lo: B
    ytePos(2
    48), hi: BytePos(249), expn_id: ExpnId(4294967295) } })], 0), span: Span { lo: BytePos(19), hi: BytePos(256), expn_id: ExpnId(4294967295) } }, Bracket)
    END

With the following source:

use std::thread;struct Philosopher { name : String }impl Philosopher {
fn new(name: &str) -> Philosopher {
Philosopher { name: name.to_string() }
}
fn eat(&self) {
println!("{} started eating.", self.name);
thread::sleep_ms(1000);
println!("{} is done eating.", self.name);
}
}
fn main()
{
let philosephers = vec![
Philosopher::new("Baruch Spinoza"),
Philosopher::new("Gilles Deleuze"),
Philosopher::new("Karl Marx"),
Philosopher::new("Friedrich Nietzsche"),
Philosopher::new("Michel Foucault")
];

let thread_handles: Vec<_> = philosephers.into_iter().

for p in &philosephers {
    p.eat();
}

}

When racer complete-with-snippet 24 46 is invoked in such file (the point
right after Vec<_> = philosephers.)


Reply to this email directly or view it on GitHub
#323.

@bruno-medeiros
Copy link
Author

Fair enough, any chance Racer could get a cleaner error output syntax though? It would make it easier for the IDE to know if it is just a Racer limitation, or an actual bug.

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

2 participants