File tree Expand file tree Collapse file tree 3 files changed +4
-31
lines changed Expand file tree Collapse file tree 3 files changed +4
-31
lines changed Original file line number Diff line number Diff line change @@ -1109,15 +1109,16 @@ package body LSP.Ada_Documents is
1109
1109
is
1110
1110
Previous : Token_Reference :=
1111
1111
(if Token = No_Token then No_Token
1112
- else LSP.Utils.Previous_Non_Trivia (Token));
1112
+ else Libadalang.Common.Previous (Token, Exclude_Trivia => True ));
1113
1113
1114
1114
begin
1115
1115
if Previous = No_Token then
1116
1116
return [];
1117
1117
end if ;
1118
1118
1119
1119
if Kind (Data (Previous)) in Ada_Comma | Ada_Dot then
1120
- Previous := LSP.Utils.Previous_Non_Trivia (Previous);
1120
+ Previous :=
1121
+ Libadalang.Common.Previous (Previous, Exclude_Trivia => True);
1121
1122
end if ;
1122
1123
1123
1124
declare
Original file line number Diff line number Diff line change 18
18
with Ada.Strings.Unbounded ;
19
19
with System ;
20
20
21
+ with Libadalang.Common ;
21
22
with Libadalang.Lexer ;
22
23
with Libadalang.Sources ;
23
24
with Langkit_Support.Diagnostics ;
@@ -475,28 +476,6 @@ package body LSP.Utils is
475
476
Column_Number_Formatters.Image (Node.Sloc_Range.Start_Column));
476
477
end Node_Location_Image ;
477
478
478
- -- -----------------------
479
- -- Previous_Non_Trivia --
480
- -- -----------------------
481
-
482
- function Previous_Non_Trivia
483
- (Token : Libadalang.Common.Token_Reference)
484
- return Libadalang.Common.Token_Reference
485
- is
486
- use Libadalang.Common;
487
-
488
- begin
489
- return
490
- Result : Token_Reference :=
491
- (if Token = No_Token then No_Token else Previous (Token))
492
- do
493
- while Result /= No_Token and then Libadalang.Common.Is_Trivia (Result)
494
- loop
495
- Result := Previous (Result);
496
- end loop ;
497
- end return ;
498
- end Previous_Non_Trivia ;
499
-
500
479
-- -----------------
501
480
-- Span_To_Slice --
502
481
-- -----------------
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ with LSP.Structures;
29
29
with Langkit_Support.Slocs ;
30
30
31
31
with Libadalang.Analysis ;
32
- with Libadalang.Common ;
33
32
34
33
with Pp.Scanner ;
35
34
@@ -108,12 +107,6 @@ package LSP.Utils is
108
107
return VSS.Strings.Virtual_String;
109
108
-- Return a string representation of the given value.
110
109
111
- function Previous_Non_Trivia
112
- (Token : Libadalang.Common.Token_Reference)
113
- return Libadalang.Common.Token_Reference;
114
- -- Gets the previous Token_Reference relative to Token that is not a
115
- -- whitespace nor a comment.
116
-
117
110
function To_Range
118
111
(Sloc : GPR2.Source_Reference.Object) return LSP.Structures.A_Range;
119
112
-- Convert a GPR2 source location into a LSP range.
You can’t perform that action at this time.
0 commit comments