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

use keyword notification and quick fix #3837

Open
Tony-Proum opened this issue May 13, 2019 · 4 comments
Open

use keyword notification and quick fix #3837

Tony-Proum opened this issue May 13, 2019 · 4 comments
Labels
improvement subsystem::code insight General label for issues related to code understanding: highlighting, completion, annotation, etc.

Comments

@Tony-Proum
Copy link

Environment

  • Intellij-Rust plugin version: v0.2.97.2123-191
  • Rust toolchain version: rustup 1.18.2 (a0bf3c9cb 2019-05-02)
  • IDE name and version: IntelliJ IDEA 2019.1.2 (Ultimate Edition) IU-191.7141.44
  • Operating system: Fedora

Problem description

Writing a .rs file, I try to use a crate that is not present in deps of the current project and I don't have any notification that this import will fail until I'd compiled the code.

Steps to reproduce

create a new file and tip use serde;
There is no visual notification or helper but, when I run cargo build this error message will be displayed :

error[E0432]: unresolved import `serde`
 --> cli/src/project/github.rs:1:5
  |
1 | use serde;
  |     ^^^^^ no `serde` in the root

I think that it could be a good thing to have quick feedback in this case

@Kobzol Kobzol added improvement subsystem::code insight General label for issues related to code understanding: highlighting, completion, annotation, etc. labels May 26, 2020
@Kobzol
Copy link
Member

Kobzol commented May 26, 2020

@vlad20012 I suppose that this has been historically disabled to avoid a lot of false positives. Now that there is an advanced macro expansion engine and modules generated by macros/build scripts are taken into account, maybe we can start emitting this error?

@Kobzol
Copy link
Member

Kobzol commented Dec 14, 2020

@vlad20012 is it worth it to try it or do you think that there will still be too many false positives?

@vlad20012
Copy link
Member

vlad20012 commented Dec 14, 2020

build.rs is not evaluated by default, the new name resolution engine is in experimental status, and the work on proc macro is not started yet (but I'm going!), and cfg is not fully supported (but I'm on the finish line, I guess). These items block the unresolved reference inspection from being enabled by default.

@vlad20012
Copy link
Member

build.rs and proc macro, in their turn, are partially blocked on #6104 and rust-lang/cargo#7178 (see #1786 (comment))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement subsystem::code insight General label for issues related to code understanding: highlighting, completion, annotation, etc.
Projects
None yet
Development

No branches or pull requests

3 participants