-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
rust-analyzer
does not work with sing-file program
#19073
Comments
Do you have a Cargo project? |
it works with a cargo.toml, but it does not work without that. it should work according to #12310 (comment) |
No it should not. Very basic features work, autocomplete atc. do not. |
No. Nothing of the features works. the rust-analyzer should work like all other language servers that work for single file program, to be friendly to write small programs, like small tests |
Parsing etc. should work (I don't know the set of features that work exactly, but anything requiring semantic information is not there). rust-analyzer depends on Cargo, and it's probably not going to change. Cargo script will make this better though. |
this depends on maybe could add a feature to quickly switch to a dummy cargo.toml for situation like quick experiments, startups, and small single file programs, in the pannel from the bottom at vscode toolbars |
Cargo script will handle that, once stabilized. |
Thanks but the #!cargo
//! ```cargo
//! ```
fn main(){
prin
}
|
To support cargo scripts you currently need to point rust-analyzer to the rust file via the |
rust-analyzer version: rust-analyzer version: 0.3.2284-standalone (1f86729 2025-01-28) [c:\Users\user.vscode\extensions\rust-lang.rust-analyzer-0.3.2284-win32-x64\server\rust-analyzer.exe]
rustc version: rustc 1.84.0 (9fc6b4312 2025-01-07)
editor or extension: vscode 1.95.3
relevant settings: not set
repository link (if public, optional):
code snippet to reproduce:
vscode rust analyzer output
The text was updated successfully, but these errors were encountered: