⬆️ rust-analyzer

This commit is contained in:
Laurențiu Nicola 2022-08-23 10:05:52 +03:00
parent 134701885d
commit 31519bb394
83 changed files with 2092 additions and 626 deletions

View file

@ -20,7 +20,7 @@ impl RootDatabase {
pub fn apply_change(&mut self, change: Change) {
let _p = profile::span("RootDatabase::apply_change");
self.request_cancellation();
tracing::info!("apply_change {:?}", change);
tracing::trace!("apply_change {:?}", change);
if let Some(roots) = &change.roots {
let mut local_roots = FxHashSet::default();
let mut library_roots = FxHashSet::default();

View file

@ -82,7 +82,7 @@ impl Definition {
}
/// Textual range of the identifier which will change when renaming this
/// `Definition`. Note that some definitions, like buitin types, can't be
/// `Definition`. Note that some definitions, like builtin types, can't be
/// renamed.
pub fn range_for_rename(self, sema: &Semantics<'_, RootDatabase>) -> Option<FileRange> {
let res = match self {

View file

@ -402,7 +402,9 @@ impl<'a> FindUsages<'a> {
.or_else(|| ty.as_builtin().map(|builtin| builtin.name()))
})
};
self.def.name(sema.db).or_else(self_kw_refs).map(|it| it.to_smol_str())
// We need to unescape the name in case it is written without "r#" in earlier
// editions of Rust where it isn't a keyword.
self.def.name(sema.db).or_else(self_kw_refs).map(|it| it.unescaped().to_smol_str())
}
};
let name = match &name {