Skip to content

Commit c3ef688

Browse files
UA06-031: Don't check for tokens in Is_End_Label filter
Since we are only trying to detect end name nodes. This allows to have keyword completion after 'end', for instance in 'end loop'.
1 parent ecca102 commit c3ef688

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

source/ada/lsp-ada_completions-filters.adb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,6 @@ package body LSP.Ada_Completions.Filters is
4545
if not Self.Is_End_Label.Is_Set then
4646
declare
4747
use all type Libadalang.Common.Ada_Node_Kind_Type;
48-
use all type Libadalang.Common.Token_Kind;
49-
50-
Prev_Token : constant Libadalang.Common.Token_Reference :=
51-
Libadalang.Common.Previous (Self.Token, Exclude_Trivia => True);
52-
53-
Prev_Token_Kind : constant Libadalang.Common.Token_Kind :=
54-
Kind (Prev_Token);
5548

5649
Parent : Libadalang.Analysis.Ada_Node :=
5750
(if Self.Node.Is_Null then Self.Node else Self.Node.Parent);
@@ -74,8 +67,7 @@ package body LSP.Ada_Completions.Filters is
7467

7568
Self.Is_End_Label :=
7669
(True,
77-
Prev_Token_Kind = Ada_End or else
78-
(not Parent.Is_Null and then Parent.Kind = Ada_End_Name));
70+
not Parent.Is_Null and then Parent.Kind = Ada_End_Name);
7971
end;
8072
end if;
8173

0 commit comments

Comments
 (0)