Closed nitn3lav closed 6 months ago
Hey, thanks for submitting this. You're right that it env::var("PWD") is probably wrong, but I think CARGO_MANIFEST_DIR will be blank in cases when it's not called by a cargo command, e.g. anytime you run an ormlite
command.
I think it should be using current_dir
instead. Does that work for your situation?
It might make sense to have a cascade for exactly the Rust-analyzer situation you're encountering. CARGO_MANIFEST_DIR if it's set, otherwise fall back to current_dir()
.
current_dir()
seems to work, thanks!
Thank you!
When I use rust-analyzer in VS Code on macOS I get this error:
This occurs because
$PWD
is not set which leads toormlite
scanning the entire filesystem in order to generate a schema. IMHO it is reasonable to use$CARGO_MANIFEST_DIR
instead of$PWD