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
|
@ -8,7 +8,7 @@ use std::mem;
|
|||
|
||||
use base_db::{salsa::Database, FileId, FileRange, SourceDatabase, SourceDatabaseExt};
|
||||
use hir::{
|
||||
AsAssocItem, DefWithBody, DescendPreference, HasAttrs, HasSource, HirFileIdExt, InFile,
|
||||
sym, AsAssocItem, DefWithBody, DescendPreference, HasAttrs, HasSource, HirFileIdExt, InFile,
|
||||
InRealFile, ModuleSource, PathResolution, Semantics, Visibility,
|
||||
};
|
||||
use memchr::memmem::Finder;
|
||||
|
@ -333,7 +333,7 @@ impl Definition {
|
|||
if let Definition::Macro(macro_def) = self {
|
||||
return match macro_def.kind(db) {
|
||||
hir::MacroKind::Declarative => {
|
||||
if macro_def.attrs(db).by_key("macro_export").exists() {
|
||||
if macro_def.attrs(db).by_key(&sym::macro_export).exists() {
|
||||
SearchScope::reverse_dependencies(db, module.krate())
|
||||
} else {
|
||||
SearchScope::krate(db, module.krate())
|
||||
|
@ -456,7 +456,7 @@ impl<'a> FindUsages<'a> {
|
|||
module
|
||||
.krate()
|
||||
.display_name(self.sema.db)
|
||||
.map(|crate_name| crate_name.crate_name().as_smol_str().clone())
|
||||
.map(|crate_name| crate_name.crate_name().symbol().as_str().into())
|
||||
}
|
||||
_ => {
|
||||
let self_kw_refs = || {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue