Skip to content
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

The main.rs file is not actually created after calling rust-playground #14

Open
zino23 opened this issue Jan 5, 2025 · 0 comments · May be fixed by #15
Open

The main.rs file is not actually created after calling rust-playground #14

zino23 opened this issue Jan 5, 2025 · 0 comments · May be fixed by #15

Comments

@zino23
Copy link

zino23 commented Jan 5, 2025

After executing rust-playground, only an emacs buffer is created for main.rs, not the physical file. This will make lsp server like rust-analyzer unable to start cause it expects "either src/lib.rs, src/main.rs, a [lib] section, or [[bin]] section must be present".

The full error is like this:

[stderr]  rust-analyzer failed to load workspace: Failed to load the project at /tmp/rust-playground/at-2025-01-05-153947/Cargo.toml: Failed to read Cargo metadata from Cargo.toml file /tmp/rust-playground/at-2025-01-05-153947/Cargo.toml, Some(Version { major: 1, minor: 76, patch: 0 }): Failed to run `cd "/tmp/rust-playground/at-2025-01-05-153947" && "cargo" "metadata" "--format-version" "1" "--manifest-path" "/tmp/rust-playground/at-2025-01-05-153947/Cargo.toml" "--filter-platform" "aarch64-apple-darwin"`: `cargo metadata` exited with an error: error: failed to parse manifest at `/tmp/rust-playground/at-2025-01-05-153947/Cargo.toml`
[stderr]  
[stderr]  Caused by:
[stderr]    no targets specified in the manifest
[stderr]    either src/lib.rs, src/main.rs, a [lib] section, or [[bin]] section must be present

Seems like we should save the buffer to make sure the corresponding file is sinked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant