aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Pullar-Strecker <[email protected]>2020-08-01 01:39:07 +0100
committerZac Pullar-Strecker <[email protected]>2020-08-01 01:39:07 +0100
commita7a00a87fd20a8b697a603d68e60e6ffbc59aac8 (patch)
tree27ebdeb6d3431d3c69ab06f1b30eb2b5a1484d38
parent7bd48a63f62ab3ffa1b86f8a550ede690ea8f9e8 (diff)
Improve namespace parsing comment
-rw-r--r--crates/ra_ide/src/hover.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs
index f6854a18d..784a1e77c 100644
--- a/crates/ra_ide/src/hover.rs
+++ b/crates/ra_ide/src/hover.rs
@@ -423,6 +423,12 @@ static MACROS: ([&str; 1], [&str; 1]) = (["macro"], ["!"]);
423 423
424impl Namespace { 424impl Namespace {
425 /// Extract the specified namespace from an intra-doc-link if one exists. 425 /// Extract the specified namespace from an intra-doc-link if one exists.
426 ///
427 /// # Examples
428 ///
429 /// * `struct MyStruct` -> `Namespace::Types`
430 /// * `panic!` -> `Namespace::Macros`
431 /// * `fn@from_intra_spec` -> `Namespace::Values`
426 fn from_intra_spec(s: &str) -> Option<Self> { 432 fn from_intra_spec(s: &str) -> Option<Self> {
427 [ 433 [
428 (Namespace::Types, (TYPES.0.iter(), TYPES.1.iter())), 434 (Namespace::Types, (TYPES.0.iter(), TYPES.1.iter())),
@@ -532,7 +538,7 @@ fn try_resolve_intra(
532 get_doc_url(db, &krate)? 538 get_doc_url(db, &krate)?
533 .join(&format!("{}/", krate.display_name(db)?)) 539 .join(&format!("{}/", krate.display_name(db)?))
534 .ok()? 540 .ok()?
535 .join(&path.segments.iter().map(|name| format!("{}", name)).join("/")) 541 .join(&path.segments.iter().map(|name| name.to_string()).join("/"))
536 .ok()? 542 .ok()?
537 .join(&get_symbol_filename(db, &Definition::ModuleDef(def))?) 543 .join(&get_symbol_filename(db, &Definition::ModuleDef(def))?)
538 .ok()? 544 .ok()?