Skip to content

It's too slow to get intellisence in just hello world level project #13135

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

Closed
tjx666 opened this issue Aug 28, 2022 · 8 comments
Closed

It's too slow to get intellisence in just hello world level project #13135

tjx666 opened this issue Aug 28, 2022 · 8 comments
Labels
C-support Category: support questions

Comments

@tjx666
Copy link

tjx666 commented Aug 28, 2022

Steps:

  1. git clone [email protected]:tjx666/study-rust.git
  2. open it in vscode in multi-root workspace mode
  3. open oop/src/main.rs
  4. in my computer, it costs about 30 seconds to get println autocomplete
Version: 1.71.0-insider (Universal)
Commit: 35b971c92d210face8c446a1c6f1e470ad2bcb54
Date: 2022-08-26T09:30:57.123Z
Electron: 19.0.12
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Darwin x64 21.6.0
Sandboxed: Yes
Rust-Analyzer: v0.4.1184
2022-08-28.22.02.31.mov
@lnicola
Copy link
Member

lnicola commented Aug 28, 2022

Can you commit and push oop? :-).

@tjx666
Copy link
Author

tjx666 commented Aug 28, 2022

Can you commit and push oop? :-).

Ok. I had commt.

@tjx666
Copy link
Author

tjx666 commented Aug 28, 2022

It's very strange: I just open oop folder, why this extension load all other folders.

@lnicola
Copy link
Member

lnicola commented Aug 28, 2022

Does it work better after the "Fetching metadata" message goes away? It takes 20 seconds or so.

It's very strange: I just open oop folder, why this extension load all other folders.

If I open oop, it loads fast for me. But if I open the whole Code workspace, it's pretty slow. I think we're mainly calling cargo metadata on each of the projects, we could probably do that in parallel.

@tjx666
Copy link
Author

tjx666 commented Aug 28, 2022

@lnicola The better solution maybe only load the oop workspace. In multi-root workspaces, one workspace should only be load when open the rust file in itself. Because workspaces had nothing relationship between each other.

@lnicola
Copy link
Member

lnicola commented Aug 28, 2022

Yeah, but we don't do that for some reason, I'm not sure why. Ideally, we'd only load oop and see if it depends on something else from the same workspace.

@flodiebold
Copy link
Member

I think that's closely related to #8622 / #7737. As I see it, we don't load projects lazily because 1. it's simpler implementation-wise, but also 2. find references can't work as expected if all projects aren't loaded eagerly. TBH I'm not sure the tradeoff is worth it, maybe we could make the behavior of find references with lazily loaded/unloaded projects clear to users somehow.

@flodiebold flodiebold added the C-support Category: support questions label Dec 21, 2022
@Veykril
Copy link
Member

Veykril commented Apr 7, 2024

Closing this as related issues have been mentioned / opened that capture the problem more precisely

@Veykril Veykril closed this as completed Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-support Category: support questions
Projects
None yet
Development

No branches or pull requests

4 participants