aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ide/src/doc_links.rs6
1 files changed, 3 insertions, 3 deletions
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};
11 11
12use hir::{ 12use hir::{
13 db::{DefDatabase, HirDatabase}, 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};
16use ide_db::{ 16use ide_db::{
17 defs::{classify_name, classify_name_ref, Definition}, 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/// Retrieve a link to documentation for the given symbol. 221/// Retrieve a link to documentation for the given symbol.
222pub fn external_docs(db: &RootDatabase, position: &FilePosition) -> Option<DocumentationLink> { 222pub(crate) fn external_docs(db: &RootDatabase, position: &FilePosition) -> Option<DocumentationLink> {
223 let sema = Semantics::new(db); 223 let sema = Semantics::new(db);
224 let file = sema.parse(position.file_id).syntax().clone(); 224 let file = sema.parse(position.file_id).syntax().clone();
225 let token = pick_best(file.token_at_offset(position.offset))?; 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 FieldOrAssocItem::AssocItem(assoc) => match assoc { 401 FieldOrAssocItem::AssocItem(assoc) => match assoc {
402 AssocItem::Function(function) => { 402 AssocItem::Function(function) => {
403 let is_trait_method = 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 // This distinction may get more complicated when specialisation is available. 405 // This distinction may get more complicated when specialisation is available.
406 // Rustdoc makes this decision based on whether a method 'has defaultness'. 406 // Rustdoc makes this decision based on whether a method 'has defaultness'.
407 // Currently this is only the case for provided trait methods. 407 // Currently this is only the case for provided trait methods.