@@ -10,7 +10,7 @@ use ide_db::{
1010 documentation:: Documentation ,
1111 famous_defs:: FamousDefs ,
1212} ;
13- use syntax:: { AstNode , SyntaxKind :: * , SyntaxNode , SyntaxToken , T , TextRange } ;
13+ use syntax:: { AstNode , SyntaxNode , SyntaxToken , T , TextRange } ;
1414
1515use crate :: navigation_target:: UpmappingResult ;
1616use crate :: {
@@ -136,12 +136,12 @@ fn documentation_for_definition(
136136}
137137
138138// FIXME: This is a weird function
139- fn get_definitions (
140- sema : & Semantics < ' _ , RootDatabase > ,
139+ fn get_definitions < ' db > (
140+ sema : & Semantics < ' db , RootDatabase > ,
141141 token : SyntaxToken ,
142- ) -> Option < ArrayVec < Definition , 2 > > {
142+ ) -> Option < ArrayVec < ( Definition , Option < hir :: GenericSubstitution < ' db > > ) , 2 > > {
143143 for token in sema. descend_into_macros_exact ( token) {
144- let def = IdentClass :: classify_token ( sema, & token) . map ( IdentClass :: definitions_no_ops ) ;
144+ let def = IdentClass :: classify_token ( sema, & token) . map ( IdentClass :: definitions ) ;
145145 if let Some ( defs) = def
146146 && !defs. is_empty ( )
147147 {
@@ -225,12 +225,6 @@ impl StaticIndex<'_> {
225225 show_drop_glue : true ,
226226 minicore : MiniCore :: default ( ) ,
227227 } ;
228- let tokens = tokens. filter ( |token| {
229- matches ! (
230- token. kind( ) ,
231- IDENT | INT_NUMBER | LIFETIME_IDENT | T ![ self ] | T ![ super ] | T ![ crate ] | T ![ Self ]
232- )
233- } ) ;
234228 let mut result = StaticIndexedFile { file_id, inlay_hints, folds, tokens : vec ! [ ] } ;
235229
236230 let mut add_token = |def : Definition , range : TextRange , scope_node : & SyntaxNode | {
@@ -290,9 +284,9 @@ impl StaticIndex<'_> {
290284 let range = token. text_range ( ) ;
291285 let node = token. parent ( ) . unwrap ( ) ;
292286 match hir:: attach_db ( self . db , || get_definitions ( & sema, token. clone ( ) ) ) {
293- Some ( it ) => {
294- for i in it {
295- add_token ( i , range, & node) ;
287+ Some ( defs ) => {
288+ for ( def , _ ) in defs {
289+ add_token ( def , range, & node) ;
296290 }
297291 }
298292 None => continue ,
0 commit comments