Merge pull request #19942 from ChayimFriedman2/faux

fix: Fix completion with some attribute macros
This commit is contained in:
Lukas Wirth 2025-06-12 05:44:34 +00:00 committed by GitHub
commit 2095af26ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 26 additions and 28 deletions

View file

@ -25,7 +25,6 @@ use hir_expand::{
builtin::{BuiltinFnLikeExpander, EagerExpander},
db::ExpandDatabase,
files::{FileRangeWrapper, HirFileRange, InRealFile},
inert_attr_macro::find_builtin_attr_idx,
mod_path::{ModPath, PathKind},
name::AsName,
};
@ -969,13 +968,6 @@ impl<'db> SemanticsImpl<'db> {
let Some(item) = ast::Item::cast(ancestor) else {
return false;
};
// Optimization to skip the semantic check.
if item.attrs().all(|attr| {
attr.simple_name()
.is_some_and(|attr| find_builtin_attr_idx(&Symbol::intern(&attr)).is_some())
}) {
return false;
}
self.with_ctx(|ctx| {
if ctx.item_to_macro_call(token.with_value(&item)).is_some() {
return true;