I'm new to rust, and trying making a small app for practicing, but every time i create a new module with file
unme.rs, and refer to it with
mod unme in root, while vscode and rust-analyzer in rustup are fine, RA extension keep displaying
file not included in module tree rust-analyzer (unlinked-file) and blocking another work like code hinting.
It drives me nut, i try all i can think, do dry build with Cargo, change to old file path style..etc, it's still yelling at me. And even more strange, somehow the extension depicts both uppercase and snake case in file name, lead to it forces to have both name its root file, in my case is it needs to see
I don't know me or something happend with RA extentsion, either, but i kinda stress. Maybe put everything in
root is recommended ?!
oh and for the second part here it is
The name in
mod should be lowercase, same as the file name. There should be no reason to capitalize it. Remove the other
Also, make sure you save the file
main.rs after adding
mod unme; so that it takes effect.
Once you've done those, what do you see?
Hi, yes, normal way it should like you said, but problem is RA extension, it doesn't recognize module name and blocking that module from vscode, like i say above, if i delete the uppercase one then extension can't see that module, tho Cargo can still build and run fine, and therefore issue the
unlinked-file and that file complete treats as text file in vscode, let alone
Did you previously create the file with a capitalized file name,
Unme.rs? I'm thinking this might be a case-insensitive file system issue.
Have you tried restarting VS Code?
nope, i'm following convention in rust book, and create everything normal, but it still issues, and i even try restart vscode, delete whole folder and run
Cargo new but extension still yells at me
btw i moves to sublime text now, and everything works seamlessly fine, just change IDE i guess. Tbh if someone get into situation like me, just ditch vscode