mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
More symbol usage
This commit is contained in:
parent
c30bdfcc84
commit
df5f1777b8
50 changed files with 388 additions and 303 deletions
|
@ -11,7 +11,8 @@ use stdx::format_to;
|
|||
use url::Url;
|
||||
|
||||
use hir::{
|
||||
db::HirDatabase, Adt, AsAssocItem, AssocItem, AssocItemContainer, DescendPreference, HasAttrs,
|
||||
db::HirDatabase, sym, Adt, AsAssocItem, AssocItem, AssocItemContainer, DescendPreference,
|
||||
HasAttrs,
|
||||
};
|
||||
use ide_db::{
|
||||
base_db::{CrateOrigin, LangCrateOrigin, ReleaseChannel, SourceDatabase},
|
||||
|
@ -593,12 +594,14 @@ fn filename_and_frag_for_def(
|
|||
},
|
||||
Definition::Module(m) => match m.name(db) {
|
||||
// `#[doc(keyword = "...")]` is internal used only by rust compiler
|
||||
Some(name) => match m.attrs(db).by_key("doc").find_string_value_in_tt("keyword") {
|
||||
Some(kw) => {
|
||||
format!("keyword.{}.html", kw.trim_matches('"'))
|
||||
Some(name) => {
|
||||
match m.attrs(db).by_key(&sym::doc).find_string_value_in_tt(&sym::keyword) {
|
||||
Some(kw) => {
|
||||
format!("keyword.{}.html", kw)
|
||||
}
|
||||
None => format!("{}/index.html", name.display(db.upcast())),
|
||||
}
|
||||
None => format!("{}/index.html", name.display(db.upcast())),
|
||||
},
|
||||
}
|
||||
None => String::from("index.html"),
|
||||
},
|
||||
Definition::Trait(t) => format!("trait.{}.html", t.name(db).display(db.upcast())),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue