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
6 changes: 6 additions & 0 deletions crates/project-model/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ impl ProjectManifest {
if path.file_name().unwrap_or_default() == "rust-project.json" {
return Ok(ProjectManifest::ProjectJson(path));
}
if path.file_name().unwrap_or_default() == ".rust-project.json" {
return Ok(ProjectManifest::ProjectJson(path));
}
if path.file_name().unwrap_or_default() == "Cargo.toml" {
return Ok(ProjectManifest::CargoToml(path));
}
Expand All @@ -94,6 +97,9 @@ impl ProjectManifest {
if let Some(project_json) = find_in_parent_dirs(path, "rust-project.json") {
return Ok(vec![ProjectManifest::ProjectJson(project_json)]);
}
if let Some(project_json) = find_in_parent_dirs(path, ".rust-project.json") {
return Ok(vec![ProjectManifest::ProjectJson(project_json)]);
}
return find_cargo_toml(path)
.map(|paths| paths.into_iter().map(ProjectManifest::CargoToml).collect());

Expand Down
2 changes: 1 addition & 1 deletion crates/rust-analyzer/tests/slow-tests/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ fn test_missing_module_code_action_in_json_project() {

let code = format!(
r#"
//- /rust-project.json
//- /.rust-project.json
{project}

//- /src/lib.rs
Expand Down
8 changes: 7 additions & 1 deletion editors/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@
"workspaceContains:Cargo.toml",
"workspaceContains:*/Cargo.toml",
"workspaceContains:rust-project.json",
"workspaceContains:*/rust-project.json"
"workspaceContains:*/rust-project.json",
"workspaceContains:.rust-project.json",
"workspaceContains:*/.rust-project.json"
],
"main": "./out/main",
"contributes": {
Expand Down Expand Up @@ -3211,6 +3213,10 @@
{
"fileMatch": "rust-project.json",
"url": "https://json.schemastore.org/rust-project.json"
},
{
"fileMatch": ".rust-project.json",
"url": "https://json.schemastore.org/rust-project.json"
}
],
"walkthroughs": [
Expand Down