Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Must reload VSCode window after adding lib.rs to binary project to resolve use #715

Closed
vjancik opened this issue Dec 11, 2019 · 6 comments
Closed

Comments

@vjancik
Copy link

vjancik commented Dec 11, 2019

Adding the default lib.rs file in a binary project and importing from it with use from main.rs reports an unresolved import error from RLS.

Steps to reproduce

  1. cargo init proj_name
  2. Open VSCode in folder proj_name
  3. open main.rs (RLS initializes)
  4. add lib.rs (optionally add a public test function in it)
  5. add use proj_name::* (or pub fn name) to main.rs

What happens

RLS reports unresolved import 'proj_name', while cargo build passes without warning.
Must Reload Window in VSCode to resolve the reported error.

What should happen

The import to the project library is resolved. The new file is recognized or lib.rs existence is checked on use <crate name>

Versions

Rust & rls: 1.39.0 & 1.39.0 (80a1d34)
VSCode RLS extension: 0.7.0
Platform Win 10 + WSL2 (RLS on Ubuntu 18.04)

@vjancik
Copy link
Author

vjancik commented Dec 12, 2019

Failed to reproduce on rls nightly-2019-12-12.

@damccull
Copy link

Is this fixed in 0.7.0 or will we need to wait for another update? I'm still experiencing this issue.

@iron-rain
Copy link

Still experiencing issue in v0.7.8, reload still corrects issue.

@AndyXia-6
Copy link

Same here, reloading fixes the issue.

@Lab-Brat
Copy link

Bug still exists, however reloading helps.

@lnicola
Copy link
Member

lnicola commented Jun 14, 2022

@Lab-Brat this extension is deprecated, you should use https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants