Skip to content

Commit

Permalink
Code refactoring...
Browse files Browse the repository at this point in the history
... to share code of Text_Document between Ada and GPR servers.
  • Loading branch information
godunko authored and reznikmm committed Oct 2, 2023
1 parent 9c25a9d commit af3ed75
Show file tree
Hide file tree
Showing 15 changed files with 1,350 additions and 1,613 deletions.
5 changes: 2 additions & 3 deletions source/ada/lsp-ada_completions-generic_assoc.adb
Original file line number Diff line number Diff line change
Expand Up @@ -405,13 +405,12 @@ package body LSP.Ada_Completions.Generic_Assoc is
end if;

Prefix_Span :=
Self.Document.To_LSP_Range
Self.Document.To_A_Range
(Langkit_Support.Slocs.Make_Range
(Langkit_Support.Slocs.Start_Sloc
(Get_Prefix_Node (Elem_Node, Column => Column).Sloc_Range),
Sloc));
Prefix := Self.Document.Get_Text_At
(Prefix_Span.start, Prefix_Span.an_end);
Prefix := Self.Document.Slice (Prefix_Span);

Parameters := Get_Parameters (Elem_Node, Prefixed);
Using_Name := Has_Designator (Unnamed_Params);
Expand Down
9 changes: 5 additions & 4 deletions source/ada/lsp-ada_documents-lal_diagnostics.adb
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ package body LSP.Ada_Documents.LAL_Diagnostics is
Self.Errors := Self.Get_Diagnostics (Context);

for J in Self.Errors.List'Range loop
Item.a_range := Self.Document.To_LSP_Range
(Self.Errors.List (J).Sloc_Range);
Item.a_range :=
Self.Document.To_A_Range (Self.Errors.List (J).Sloc_Range);

Item.message := VSS.Strings.Conversions.To_Virtual_String
(Self.Errors.List (J).Message);
Item.message :=
VSS.Strings.Conversions.To_Virtual_String
(Self.Errors.List (J).Message);

Errors.Append (Item);
end loop;
Expand Down
Loading

0 comments on commit af3ed75

Please sign in to comment.