about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--crates/ide/src/syntax_highlighting/highlight.rs20
-rw-r--r--crates/proc_macro_srv/src/abis/abi_1_47/rustc_server.rs9
-rw-r--r--crates/proc_macro_srv/src/abis/abi_1_54/rustc_server.rs9
-rw-r--r--crates/proc_macro_srv/src/abis/abi_1_56/rustc_server.rs9
-rw-r--r--crates/proc_macro_srv/src/abis/abi_1_58/rustc_server.rs9
5 files changed, 8 insertions, 48 deletions
diff --git a/crates/ide/src/syntax_highlighting/highlight.rs b/crates/ide/src/syntax_highlighting/highlight.rs
index 84732aef549..c869db3b8b7 100644
--- a/crates/ide/src/syntax_highlighting/highlight.rs
+++ b/crates/ide/src/syntax_highlighting/highlight.rs
@@ -234,15 +234,6 @@ fn highlight_name_ref(
         None if syntactic_name_ref_highlighting => {
             return highlight_name_ref_by_syntax(name_ref, sema, krate)
         }
-        // FIXME: Workaround for https://github.com/rust-analyzer/rust-analyzer/issues/10708
-        //
-        // Some popular proc macros (namely async_trait) will rewrite `self` in such a way that it no
-        // longer resolves via NameRefClass. If we can't be resolved, but we know we're a self token,
-        // within a function with a self param, pretend to still be `self`, rather than
-        // an unresolved reference.
-        None if name_ref.self_token().is_some() && is_in_fn_with_self_param(&name_ref) => {
-            return SymbolKind::SelfParam.into()
-        }
         // FIXME: This is required for helper attributes used by proc-macros, as those do not map down
         // to anything when used.
         // We can fix this for derive attributes since derive helpers are recorded, but not for
@@ -712,14 +703,3 @@ fn parents_match(mut node: NodeOrToken<SyntaxNode, SyntaxToken>, mut kinds: &[Sy
 fn parent_matches<N: AstNode>(token: &SyntaxToken) -> bool {
     token.parent().map_or(false, |it| N::can_cast(it.kind()))
 }
-
-fn is_in_fn_with_self_param(node: &ast::NameRef) -> bool {
-    node.syntax()
-        .ancestors()
-        .find_map(ast::Item::cast)
-        .and_then(|item| match item {
-            ast::Item::Fn(fn_) => fn_.param_list()?.self_param(),
-            _ => None,
-        })
-        .is_some()
-}
diff --git a/crates/proc_macro_srv/src/abis/abi_1_47/rustc_server.rs b/crates/proc_macro_srv/src/abis/abi_1_47/rustc_server.rs
index d3d021d808f..1ef137029d1 100644
--- a/crates/proc_macro_srv/src/abis/abi_1_47/rustc_server.rs
+++ b/crates/proc_macro_srv/src/abis/abi_1_47/rustc_server.rs
@@ -463,13 +463,8 @@ impl server::Punct for Rustc {
 }
 
 impl server::Ident for Rustc {
-    fn new(&mut self, string: &str, _span: Self::Span, _is_raw: bool) -> Self::Ident {
-        IdentId(
-            self.ident_interner.intern(&IdentData(tt::Ident {
-                text: string.into(),
-                id: tt::TokenId::unspecified(),
-            })),
-        )
+    fn new(&mut self, string: &str, span: Self::Span, _is_raw: bool) -> Self::Ident {
+        IdentId(self.ident_interner.intern(&IdentData(tt::Ident { text: string.into(), id: span })))
     }
 
     fn span(&mut self, ident: Self::Ident) -> Self::Span {
diff --git a/crates/proc_macro_srv/src/abis/abi_1_54/rustc_server.rs b/crates/proc_macro_srv/src/abis/abi_1_54/rustc_server.rs
index 6105238d0b2..3904cb8f3ea 100644
--- a/crates/proc_macro_srv/src/abis/abi_1_54/rustc_server.rs
+++ b/crates/proc_macro_srv/src/abis/abi_1_54/rustc_server.rs
@@ -463,13 +463,8 @@ impl server::Punct for Rustc {
 }
 
 impl server::Ident for Rustc {
-    fn new(&mut self, string: &str, _span: Self::Span, _is_raw: bool) -> Self::Ident {
-        IdentId(
-            self.ident_interner.intern(&IdentData(tt::Ident {
-                text: string.into(),
-                id: tt::TokenId::unspecified(),
-            })),
-        )
+    fn new(&mut self, string: &str, span: Self::Span, _is_raw: bool) -> Self::Ident {
+        IdentId(self.ident_interner.intern(&IdentData(tt::Ident { text: string.into(), id: span })))
     }
 
     fn span(&mut self, ident: Self::Ident) -> Self::Span {
diff --git a/crates/proc_macro_srv/src/abis/abi_1_56/rustc_server.rs b/crates/proc_macro_srv/src/abis/abi_1_56/rustc_server.rs
index 1cebc289f8a..cf797752310 100644
--- a/crates/proc_macro_srv/src/abis/abi_1_56/rustc_server.rs
+++ b/crates/proc_macro_srv/src/abis/abi_1_56/rustc_server.rs
@@ -464,13 +464,8 @@ impl server::Punct for Rustc {
 }
 
 impl server::Ident for Rustc {
-    fn new(&mut self, string: &str, _span: Self::Span, _is_raw: bool) -> Self::Ident {
-        IdentId(
-            self.ident_interner.intern(&IdentData(tt::Ident {
-                text: string.into(),
-                id: tt::TokenId::unspecified(),
-            })),
-        )
+    fn new(&mut self, string: &str, span: Self::Span, _is_raw: bool) -> Self::Ident {
+        IdentId(self.ident_interner.intern(&IdentData(tt::Ident { text: string.into(), id: span })))
     }
 
     fn span(&mut self, ident: Self::Ident) -> Self::Span {
diff --git a/crates/proc_macro_srv/src/abis/abi_1_58/rustc_server.rs b/crates/proc_macro_srv/src/abis/abi_1_58/rustc_server.rs
index 31f3223acdc..5c3f4da0014 100644
--- a/crates/proc_macro_srv/src/abis/abi_1_58/rustc_server.rs
+++ b/crates/proc_macro_srv/src/abis/abi_1_58/rustc_server.rs
@@ -468,13 +468,8 @@ impl server::Punct for Rustc {
 }
 
 impl server::Ident for Rustc {
-    fn new(&mut self, string: &str, _span: Self::Span, _is_raw: bool) -> Self::Ident {
-        IdentId(
-            self.ident_interner.intern(&IdentData(tt::Ident {
-                text: string.into(),
-                id: tt::TokenId::unspecified(),
-            })),
-        )
+    fn new(&mut self, string: &str, span: Self::Span, _is_raw: bool) -> Self::Ident {
+        IdentId(self.ident_interner.intern(&IdentData(tt::Ident { text: string.into(), id: span })))
     }
 
     fn span(&mut self, ident: Self::Ident) -> Self::Span {