From d2c68809ea3243ca68811e9b2e0f1592e2dc33fe Mon Sep 17 00:00:00 2001 From: Zac Pullar-Strecker Date: Thu, 8 Oct 2020 14:54:44 +1300 Subject: Changes from review --- crates/ide/src/doc_links.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates') diff --git a/crates/ide/src/doc_links.rs b/crates/ide/src/doc_links.rs index 34dc122a8..6b2ecf725 100644 --- a/crates/ide/src/doc_links.rs +++ b/crates/ide/src/doc_links.rs @@ -11,7 +11,7 @@ use ide_db::{defs::Definition, RootDatabase}; use hir::{ db::{DefDatabase, HirDatabase}, - Adt, AsName, AssocItem, Crate, Field, HasAttrs, ItemInNs, MethodOwner, ModuleDef, + Adt, AsName, AssocItem, Crate, Field, HasAttrs, ItemInNs, MethodOwner, ModuleDef, AssocItemContainer, AsAssocItem }; use ide_db::{ defs::{classify_name, classify_name_ref, Definition}, @@ -219,7 +219,7 @@ fn rewrite_url_link(db: &RootDatabase, def: ModuleDef, target: &str) -> Option Option { +pub(crate) fn external_docs(db: &RootDatabase, position: &FilePosition) -> Option { let sema = Semantics::new(db); let file = sema.parse(position.file_id).syntax().clone(); let token = pick_best(file.token_at_offset(position.offset))?; @@ -401,7 +401,7 @@ fn get_symbol_fragment(db: &dyn HirDatabase, field_or_assoc: &FieldOrAssocItem) FieldOrAssocItem::AssocItem(assoc) => match assoc { AssocItem::Function(function) => { let is_trait_method = - matches!(function.method_owner(db), Some(MethodOwner::Trait(..))); + matches!(function.as_assoc_item(db).map(|assoc| assoc.container(db)), Some(AssocItemContainer::Trait(..))); // This distinction may get more complicated when specialisation is available. // Rustdoc makes this decision based on whether a method 'has defaultness'. // Currently this is only the case for provided trait methods. -- cgit v1.2.3