Skip to content

Commit 54fc989

Browse files
committed
consts with inners??
1 parent 492b169 commit 54fc989

File tree

2 files changed

+82
-2
lines changed

2 files changed

+82
-2
lines changed

crates/ide_db/src/symbol_index.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,18 @@ mod a_mod {
765765
struct StructInModA;
766766
}
767767
768+
const _: () = {
769+
struct StructInUnnamedConst;
770+
771+
()
772+
};
773+
774+
const CONST_WITH_INNER: () = {
775+
struct StructInNamedConst;
776+
777+
()
778+
};
779+
768780
mod b_mod;
769781
770782
//- /b_mod.rs

crates/ide_db/src/test_data/test_symbol_index_collection.txt

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,28 @@
254254
kind: Module,
255255
container_name: None,
256256
},
257+
FileSymbol {
258+
name: "CONST_WITH_INNER",
259+
loc: DeclarationLocation {
260+
hir_file_id: HirFileId(
261+
FileId(
262+
FileId(
263+
0,
264+
),
265+
),
266+
),
267+
ptr: SyntaxNodePtr {
268+
range: 520..592,
269+
kind: CONST,
270+
},
271+
name_ptr: SyntaxNodePtr {
272+
range: 526..542,
273+
kind: NAME,
274+
},
275+
},
276+
kind: Const,
277+
container_name: None,
278+
},
257279
FileSymbol {
258280
name: "b_mod",
259281
loc: DeclarationLocation {
@@ -265,11 +287,11 @@
265287
),
266288
),
267289
ptr: SyntaxNodePtr {
268-
range: 459..469,
290+
range: 594..604,
269291
kind: MODULE,
270292
},
271293
name_ptr: SyntaxNodePtr {
272-
range: 463..468,
294+
range: 598..603,
273295
kind: NAME,
274296
},
275297
},
@@ -364,6 +386,52 @@
364386
kind: Macro,
365387
container_name: None,
366388
},
389+
FileSymbol {
390+
name: "StructInUnnamedConst",
391+
loc: DeclarationLocation {
392+
hir_file_id: HirFileId(
393+
FileId(
394+
FileId(
395+
0,
396+
),
397+
),
398+
),
399+
ptr: SyntaxNodePtr {
400+
range: 479..507,
401+
kind: STRUCT,
402+
},
403+
name_ptr: SyntaxNodePtr {
404+
range: 486..506,
405+
kind: NAME,
406+
},
407+
},
408+
kind: Struct,
409+
container_name: None,
410+
},
411+
FileSymbol {
412+
name: "StructInNamedConst",
413+
loc: DeclarationLocation {
414+
hir_file_id: HirFileId(
415+
FileId(
416+
FileId(
417+
0,
418+
),
419+
),
420+
),
421+
ptr: SyntaxNodePtr {
422+
range: 555..581,
423+
kind: STRUCT,
424+
},
425+
name_ptr: SyntaxNodePtr {
426+
range: 562..580,
427+
kind: NAME,
428+
},
429+
},
430+
kind: Struct,
431+
container_name: Some(
432+
"CONST_WITH_INNER",
433+
),
434+
},
367435
FileSymbol {
368436
name: "StructInFn",
369437
loc: DeclarationLocation {

0 commit comments

Comments
 (0)