Skip to content

Commit af3ed75

Browse files
godunkoreznikmm
authored andcommitted
Code refactoring...
... to share code of Text_Document between Ada and GPR servers.
1 parent 9c25a9d commit af3ed75

15 files changed

+1350
-1613
lines changed

source/ada/lsp-ada_completions-generic_assoc.adb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,13 +405,12 @@ package body LSP.Ada_Completions.Generic_Assoc is
405405
end if;
406406

407407
Prefix_Span :=
408-
Self.Document.To_LSP_Range
408+
Self.Document.To_A_Range
409409
(Langkit_Support.Slocs.Make_Range
410410
(Langkit_Support.Slocs.Start_Sloc
411411
(Get_Prefix_Node (Elem_Node, Column => Column).Sloc_Range),
412412
Sloc));
413-
Prefix := Self.Document.Get_Text_At
414-
(Prefix_Span.start, Prefix_Span.an_end);
413+
Prefix := Self.Document.Slice (Prefix_Span);
415414

416415
Parameters := Get_Parameters (Elem_Node, Prefixed);
417416
Using_Name := Has_Designator (Unnamed_Params);

source/ada/lsp-ada_documents-lal_diagnostics.adb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ package body LSP.Ada_Documents.LAL_Diagnostics is
4040
Self.Errors := Self.Get_Diagnostics (Context);
4141

4242
for J in Self.Errors.List'Range loop
43-
Item.a_range := Self.Document.To_LSP_Range
44-
(Self.Errors.List (J).Sloc_Range);
43+
Item.a_range :=
44+
Self.Document.To_A_Range (Self.Errors.List (J).Sloc_Range);
4545

46-
Item.message := VSS.Strings.Conversions.To_Virtual_String
47-
(Self.Errors.List (J).Message);
46+
Item.message :=
47+
VSS.Strings.Conversions.To_Virtual_String
48+
(Self.Errors.List (J).Message);
4849

4950
Errors.Append (Item);
5051
end loop;

0 commit comments

Comments
 (0)