diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_ide/src/hover.rs | 8 |
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 | ||
424 | impl Namespace { | 424 | impl 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()? |