@@ -11,7 +11,7 @@ use ide_db::{defs::Definition, RootDatabase};
11
11
12
12
use hir:: {
13
13
db:: { DefDatabase , HirDatabase } ,
14
- Adt , AsName , AssocItem , Crate , Field , HasAttrs , ItemInNs , MethodOwner , ModuleDef ,
14
+ Adt , AsName , AssocItem , Crate , Field , HasAttrs , ItemInNs , MethodOwner , ModuleDef , AssocItemContainer , AsAssocItem
15
15
} ;
16
16
use ide_db:: {
17
17
defs:: { classify_name, classify_name_ref, Definition } ,
@@ -219,7 +219,7 @@ fn rewrite_url_link(db: &RootDatabase, def: ModuleDef, target: &str) -> Option<S
219
219
}
220
220
221
221
/// Retrieve a link to documentation for the given symbol.
222
- pub fn external_docs ( db : & RootDatabase , position : & FilePosition ) -> Option < DocumentationLink > {
222
+ pub ( crate ) fn external_docs ( db : & RootDatabase , position : & FilePosition ) -> Option < DocumentationLink > {
223
223
let sema = Semantics :: new ( db) ;
224
224
let file = sema. parse ( position. file_id ) . syntax ( ) . clone ( ) ;
225
225
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)
401
401
FieldOrAssocItem :: AssocItem ( assoc) => match assoc {
402
402
AssocItem :: Function ( function) => {
403
403
let is_trait_method =
404
- matches ! ( function. method_owner ( db) , Some ( MethodOwner :: Trait ( ..) ) ) ;
404
+ matches ! ( function. as_assoc_item ( db) . map ( |assoc| assoc . container ( db ) ) , Some ( AssocItemContainer :: Trait ( ..) ) ) ;
405
405
// This distinction may get more complicated when specialisation is available.
406
406
// Rustdoc makes this decision based on whether a method 'has defaultness'.
407
407
// Currently this is only the case for provided trait methods.
0 commit comments