Open Cargo.toml opens more specific manifest
This commit is contained in:
@@ -1342,13 +1342,9 @@ pub(crate) fn handle_open_cargo_toml(
|
||||
None => return Ok(None),
|
||||
};
|
||||
|
||||
let cargo_toml_path = cargo_spec.workspace_root.join("Cargo.toml");
|
||||
if !cargo_toml_path.exists() {
|
||||
return Ok(None);
|
||||
}
|
||||
let cargo_toml_url = to_proto::url_from_abs_path(&cargo_toml_path);
|
||||
let cargo_toml_location = Location::new(cargo_toml_url, Range::default());
|
||||
let res = lsp_types::GotoDefinitionResponse::from(cargo_toml_location);
|
||||
let cargo_toml_url = to_proto::url_from_abs_path(&cargo_spec.cargo_toml);
|
||||
let res: lsp_types::GotoDefinitionResponse =
|
||||
Location::new(cargo_toml_url, Range::default()).into();
|
||||
Ok(Some(res))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user