@@ -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 , 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 {
@@ -226,12 +226,6 @@ impl StaticIndex<'_> {
226226 show_drop_glue : true ,
227227 minicore : MiniCore :: default ( ) ,
228228 } ;
229- let tokens = tokens. filter ( |token| {
230- matches ! (
231- token. kind( ) ,
232- IDENT | INT_NUMBER | LIFETIME_IDENT | T ![ self ] | T ![ super ] | T ![ crate ] | T ![ Self ]
233- )
234- } ) ;
235229 let mut result = StaticIndexedFile { file_id, inlay_hints, folds, tokens : vec ! [ ] } ;
236230
237231 let mut add_token = |def : Definition , range : TextRange , scope_node : & SyntaxNode | {
@@ -291,9 +285,9 @@ impl StaticIndex<'_> {
291285 let range = token. text_range ( ) ;
292286 let node = token. parent ( ) . unwrap ( ) ;
293287 match hir:: attach_db ( self . db , || get_definitions ( & sema, token. clone ( ) ) ) {
294- Some ( it ) => {
295- for i in it {
296- add_token ( i , range, & node) ;
288+ Some ( defs ) => {
289+ for ( def , _ ) in defs {
290+ add_token ( def , range, & node) ;
297291 }
298292 }
299293 None => continue ,
0 commit comments