rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

Incorrect warnings while RA is still loading

Open RalfJung opened this issue 1 year ago • 9 comments

When opening this file, RA briefly shows an incorrect warning:

Image

RA version: rust-analyzer version: 0.3.2121-standalone [/home/r/.vscode-oss/extensions/rust-lang.rust-analyzer-0.3.2121-linux-x64/server/rust-analyzer]

Settings:

    "rust-analyzer.lens.enable": false,
    "rust-analyzer.cachePriming.enable": false,
    "rust-analyzer.cargo.buildScripts.useRustcWrapper": false, // https://github.com/rust-lang/rust-analyzer/issues/14722
    "rust-analyzer.diagnostics.disabled": [
        "unlinked-file",
        "macro-error" // trouble with the xshell `cmd!` macro
    ],

RalfJung avatar Sep 26 '24 07:09 RalfJung

I believe this is due to us loading the project before loading the standard libraries. We shouldn't compute semantic diagnostics at this loading stage (only parse diagnostics).

Veykril avatar Sep 26 '24 07:09 Veykril

I also tend to get the "file not included in module tree" error.

oriongonza avatar Sep 27 '24 16:09 oriongonza

That is related but not quite the same. But you are right in that we should surpress those as well until the project is loaded

Veykril avatar Sep 27 '24 19:09 Veykril

I also tend to get the "file not included in module tree" error.

me too...The program can be run normally, but the prompt is a sad state....😶😶 Even if restart the service

Image Image

RSS1102 avatar Sep 29 '24 11:09 RSS1102

@RSS1102 Briefly, or constantly? This issue is about errors/warnings that are shown because the project is not fully loaded and disappear when it finishes loading.

ChayimFriedman2 avatar Sep 29 '24 12:09 ChayimFriedman2

@RSS1102 Briefly, or constantly? This issue is about errors/warnings that are shown because the project is not fully loaded and disappear when it finishes loading.

🥲🥲🥲After many modifications, I think it should be a problem with the file case. After my investigation: At first my file was named: window_Menu.rs. I changed the file name to window_menu.rs, and it prompted unlink-file, and asked me to create a pub mod window_Menu. (No matter I restarted the rust-analyzer server, restarted vscode, or even restarted the computer, it didn't work.) When I changed the file name to a different windows_menu.rs (there is an extra s), it worked.


It seems that the file name is not case sensitive.

RSS1102 avatar Sep 29 '24 12:09 RSS1102

@RSS1102 On Windows it is case insensitive, on Linux it is case sensitive (not sure about MacOS). I believe there is a way to rename case in Windows, but I think VSCode does not respect that.

ChayimFriedman2 avatar Sep 29 '24 13:09 ChayimFriedman2

@RSS1102 On Windows it is case insensitive, on Linux it is case sensitive (not sure about MacOS). I believe there is a way to rename case in Windows, but I think VSCode does not respect that.

I think so, maybe there are other methods that need to be further explored.🥹🥹

RSS1102 avatar Sep 29 '24 14:09 RSS1102

@RSS1102 I think you are having a different issue. Please only post in an existing issue when you are sure it is the same. Otherwise, open a new issue, and reference the potential old issues.

RalfJung avatar Sep 29 '24 16:09 RalfJung