Skip to content

Commit 641aef7

Browse files
author
Philippe Gil
committed
Merge branch 'topic/gil-1340-bad-outline-on-case-when-when' into 'master'
Fix invalid GPR case outline Closes #1340 See merge request eng/ide/ada_language_server!1555
2 parents 7b861b8 + cf94ac3 commit 641aef7

File tree

3 files changed

+916
-1
lines changed

3 files changed

+916
-1
lines changed

source/gpr/lsp-gpr_files.adb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,10 @@ package body LSP.GPR_Files is
505505

506506
New_Symbol : Symbol :=
507507
(New_Id,
508-
Current_Symbol.Id,
508+
(if Kind = K_When
509+
and then Current_Symbol.Kind = K_When
510+
then Current_Symbol.Parent_Id
511+
else Current_Symbol.Id),
509512
Token.Ref,
510513
Kind,
511514
To_Valid_Name (Name),
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
project Case_Support is
2+
A := "";
3+
case A is
4+
when "a" =>
5+
B := "";
6+
when others =>
7+
C := "";
8+
case A is
9+
when "a" =>
10+
D := "";
11+
when others =>
12+
E := "";
13+
end case;
14+
F := "";
15+
end case;
16+
G := "";
17+
case G is
18+
when "" =>
19+
H := "";
20+
-- testing auto case/when closing on package declaration
21+
package Compiler is
22+
I := "";
23+
case H is
24+
when "" =>
25+
J := "";
26+
case J is
27+
-- testing auto case closing on package declaration
28+
package Linker is
29+
K := "";
30+
-- testing package auto closing on package declaration
31+
package Builder is
32+
L := "";
33+
-- testing package auto closing on type declaration
34+
type T1 is ("a");
35+
M := "";
36+
case M is
37+
when "" =>
38+
N := "";
39+
-- testing case auto closing on type declaration
40+
type T2 is ("");
41+
O := "";
42+
end Case_Support;

0 commit comments

Comments
 (0)