Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ Add the following to your `settings.json`:
"Cargo.toml"
]
},
"rust-analyzer.check.invocationStrategy": "once",
"rust-analyzer.check.overrideCommand": [
"cargo-subspace",
"check", // You can also use "clippy" here
Expand All @@ -115,6 +116,7 @@ also be set via lspconfig.
```lua
["rust-analyzer"] = {
check = {
invocationStrategy = "once",
overrideCommand = {
"cargo-subspace",
"clippy",
Expand Down Expand Up @@ -149,6 +151,7 @@ These settings should be specified in `Settings --> LSP Client --> User Server S
"useWorkspace": false,
"initializationOptions": {
"check": {
"invocationStrategy": "once",
"overrideCommand": [
"cargo-subspace",
"clippy",
Expand Down
17 changes: 1 addition & 16 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,23 +217,8 @@ fn discover(ctx: &Context, discover_args: DiscoverArgs, manifest_path: FilePath<
let metadata = cmd.exec()?;
let project = compute_project_json(ctx, discover_args, metadata, manifest_path)?;

let root = ctx
.cargo()
.arg("locate-project")
.arg("--workspace")
.arg("--manifest-path")
.arg(manifest_path)
.arg("--message-format")
.arg("plain")
.output()?;
let buildfile: PathBuf = String::from_utf8(root.stdout)?.trim().into();
let output = DiscoverProjectData::Finished {
buildfile: Utf8PathBuf::from_path_buf(buildfile).map_err(|e| {
anyhow!(
"Manifest path `{}` contains non-UTF-8 characters",
e.display()
)
})?,
buildfile: manifest_path.to_path_buf(),
project,
};
let json = if ctx.is_tty {
Expand Down