aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide/src')
-rw-r--r--crates/ide/src/doc_links.rs8
-rw-r--r--crates/ide/src/lib.rs2
2 files changed, 6 insertions, 4 deletions
diff --git a/crates/ide/src/doc_links.rs b/crates/ide/src/doc_links.rs
index de10406bc..1f08d7810 100644
--- a/crates/ide/src/doc_links.rs
+++ b/crates/ide/src/doc_links.rs
@@ -438,10 +438,10 @@ fn get_symbol_fragment(db: &dyn HirDatabase, field_or_assoc: &FieldOrAssocItem)
438 FieldOrAssocItem::Field(field) => format!("#structfield.{}", field.name(db)), 438 FieldOrAssocItem::Field(field) => format!("#structfield.{}", field.name(db)),
439 FieldOrAssocItem::AssocItem(assoc) => match assoc { 439 FieldOrAssocItem::AssocItem(assoc) => match assoc {
440 AssocItem::Function(function) => { 440 AssocItem::Function(function) => {
441 let is_trait_method = matches!( 441 let is_trait_method = function
442 function.as_assoc_item(db).map(|assoc| assoc.container(db)), 442 .as_assoc_item(db)
443 Some(AssocItemContainer::Trait(..)) 443 .and_then(|assoc| assoc.containing_trait(db))
444 ); 444 .is_some();
445 // This distinction may get more complicated when specialization is available. 445 // This distinction may get more complicated when specialization is available.
446 // Rustdoc makes this decision based on whether a method 'has defaultness'. 446 // Rustdoc makes this decision based on whether a method 'has defaultness'.
447 // Currently this is only the case for provided trait methods. 447 // Currently this is only the case for provided trait methods.
diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs
index b2b7178d4..3abbb14c6 100644
--- a/crates/ide/src/lib.rs
+++ b/crates/ide/src/lib.rs
@@ -478,6 +478,7 @@ impl Analysis {
478 position: FilePosition, 478 position: FilePosition,
479 full_import_path: &str, 479 full_import_path: &str,
480 imported_name: String, 480 imported_name: String,
481 import_for_trait_assoc_item: bool,
481 ) -> Cancelable<Vec<TextEdit>> { 482 ) -> Cancelable<Vec<TextEdit>> {
482 Ok(self 483 Ok(self
483 .with_db(|db| { 484 .with_db(|db| {
@@ -487,6 +488,7 @@ impl Analysis {
487 position, 488 position,
488 full_import_path, 489 full_import_path,
489 imported_name, 490 imported_name,
491 import_for_trait_assoc_item,
490 ) 492 )
491 })? 493 })?
492 .unwrap_or_default()) 494 .unwrap_or_default())