Intellij Rust Plugin Incorrect 'Unresolved Reference' Errors

Viewed 244

I'm trying out building desktop apps in rust, with the OrbTK framework. However, my IntelliJ can't find certain declarations in the orbtk crate. I'm just running the basic example on OrbTK's github page:

extern crate orbtk;

use orbtk::prelude::*;

fn main() {
    Application::new()
        .window(|ctx| {
            Window::new()
                .title("Hello, world!")
                .position((100.0, 100.0))
                .size(420.0, 730.0)
                .child(TextBlock::new().text("Hello, world!").build(ctx))
                .build(ctx)
        })
        .run();
}

The code runs fine, but IntelliJ is giving me an error, saying that Window and TextBlock does not exist. This is very hard to work with, since I can't tell when there is actually an error, and I can't autocomplete and check what methods are available on these structs.

So far, I have tried restarting my IDE several times, reinstalling the IntelliJ rust plugin, trying different versions of OrbTK, but none of these seemed to work. Also, this has never happened to me with any crate other than orbtk, so I have no idea if this problem is coming from IntelliJ, cargo, or otherwise.

Has anyone experienced a similar issue, or have any ideas for a solution? I would be grateful for any input. Thanks :)

0 Answers
Related