Skip to content

Commit

Permalink
Avoid Ada extension features unsupported by GCC 14.
Browse files Browse the repository at this point in the history
Refs #1471
  • Loading branch information
reznikmm committed Oct 21, 2024
1 parent 7317796 commit 847b69d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
4 changes: 2 additions & 2 deletions source/ada/lsp-ada_driver.adb
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,8 @@ begin
& "ALS.OUT=no" & Ada.Characters.Latin_1.LF;
begin
W_Traces_File := Traces_File.Write_File;
W_Traces_File.Write (Default_Traces_File_Contents);
W_Traces_File.Close;
Write (W_Traces_File, Default_Traces_File_Contents);
Close (W_Traces_File);
end;
end if;
end if;
Expand Down
9 changes: 6 additions & 3 deletions source/ada/lsp-ada_handlers-open_als_log_file_commands.adb
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,18 @@ package body LSP.Ada_Handlers.Open_ALS_Log_File_Commands is
is
pragma Unreferenced (Response);

Log_File_Path : constant LSP.Structures.Virtual_String := Handler.Tracer.Location;
begin
Log_File_Path : constant LSP.Structures.Virtual_String :=
Handler.Tracer.Location;

Message : constant LSP.Structures.ShowDocumentParams :=
(uri => (Log_File_Path with null record),
takeFocus => LSP.Constants.True,
others => <>);

New_Id : constant LSP.Structures.Integer_Or_Virtual_String :=
Handler.Server.Allocate_Request_Id;
Handler.Server.Allocate_Request_Id;

begin
Handler.Sender.On_ShowDocument_Request (New_Id, Message);
end Execute;

Expand Down
26 changes: 14 additions & 12 deletions source/ada/lsp-ada_handlers-open_project_file_commands.adb
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,22 @@ package body LSP.Ada_Handlers.Open_Project_File_Commands is
pragma Unreferenced (Response);

Project_File : constant Virtual_File :=
Handler.Project_Status.Get_Project_File;
begin
if Project_File.Is_Regular_File then
URI : constant LSP.Structures.DocumentUri :=
Handler.To_URI (Project_File.Display_Full_Name);
LSP.Ada_Project_Loading.Get_Project_File (Handler.Project_Status);

URI : constant LSP.Structures.DocumentUri :=
(if Project_File.Is_Regular_File
then Handler.To_URI (Project_File.Display_Full_Name)
else "");

Message : constant LSP.Structures.ShowDocumentParams :=
(uri => (VSS.Strings.Virtual_String (URI) with null record),
takeFocus => LSP.Constants.True,
others => <>);
Message : constant LSP.Structures.ShowDocumentParams :=
(uri => (VSS.Strings.Virtual_String (URI) with null record),
takeFocus => LSP.Constants.True,
others => <>);

New_Id : constant LSP.Structures.Integer_Or_Virtual_String :=
Handler.Server.Allocate_Request_Id;
Handler.Sender.On_ShowDocument_Request (New_Id, Message);
begin
if Project_File.Is_Regular_File then
Handler.Sender.On_ShowDocument_Request
(Handler.Server.Allocate_Request_Id, Message);
else
Handler.Sender.On_ShowMessage_Notification (
(LSP.Enumerations.Error,
Expand Down

0 comments on commit 847b69d

Please sign in to comment.