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
11091109 is
11101110 Previous : Token_Reference :=
11111111 (if Token = No_Token then No_Token
1112- else LSP.Utils.Previous_Non_Trivia (Token));
1112+ else Libadalang.Common.Previous (Token, Exclude_Trivia => True ));
11131113
11141114 begin
11151115 if Previous = No_Token then
11161116 return [];
11171117 end if ;
11181118
11191119 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);
11211122 end if ;
11221123
11231124 declare
Original file line number Diff line number Diff line change 1818with Ada.Strings.Unbounded ;
1919with System ;
2020
21+ with Libadalang.Common ;
2122with Libadalang.Lexer ;
2223with Libadalang.Sources ;
2324with Langkit_Support.Diagnostics ;
@@ -475,28 +476,6 @@ package body LSP.Utils is
475476 Column_Number_Formatters.Image (Node.Sloc_Range.Start_Column));
476477 end Node_Location_Image ;
477478
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-
500479 -- -----------------
501480 -- Span_To_Slice --
502481 -- -----------------
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ with LSP.Structures;
2929with Langkit_Support.Slocs ;
3030
3131with Libadalang.Analysis ;
32- with Libadalang.Common ;
3332
3433with Pp.Scanner ;
3534
@@ -108,12 +107,6 @@ package LSP.Utils is
108107 return VSS.Strings.Virtual_String;
109108 -- Return a string representation of the given value.
110109
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-
117110 function To_Range
118111 (Sloc : GPR2.Source_Reference.Object) return LSP.Structures.A_Range;
119112 -- Convert a GPR2 source location into a LSP range.
You can’t perform that action at this time.
0 commit comments