Skip to content

Commit f487195

Browse files
committed
Avoid Ada extension features unsupported by GCC 14.
Refs #1471
1 parent 13959f6 commit f487195

File tree

3 files changed

+22
-17
lines changed

3 files changed

+22
-17
lines changed

source/ada/lsp-ada_driver.adb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,8 +460,8 @@ begin
460460
& "ALS.OUT=no" & Ada.Characters.Latin_1.LF;
461461
begin
462462
W_Traces_File := Traces_File.Write_File;
463-
W_Traces_File.Write (Default_Traces_File_Contents);
464-
W_Traces_File.Close;
463+
Write (W_Traces_File, Default_Traces_File_Contents);
464+
Close (W_Traces_File);
465465
end;
466466
end if;
467467
end if;

source/ada/lsp-ada_handlers-open_als_log_file_commands.adb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,18 @@ package body LSP.Ada_Handlers.Open_ALS_Log_File_Commands is
4545
is
4646
pragma Unreferenced (Response);
4747

48-
Log_File_Path : constant LSP.Structures.Virtual_String := Handler.Tracer.Location;
49-
begin
48+
Log_File_Path : constant LSP.Structures.Virtual_String :=
49+
Handler.Tracer.Location;
50+
5051
Message : constant LSP.Structures.ShowDocumentParams :=
5152
(uri => (Log_File_Path with null record),
5253
takeFocus => LSP.Constants.True,
5354
others => <>);
5455

5556
New_Id : constant LSP.Structures.Integer_Or_Virtual_String :=
56-
Handler.Server.Allocate_Request_Id;
57+
Handler.Server.Allocate_Request_Id;
58+
59+
begin
5760
Handler.Sender.On_ShowDocument_Request (New_Id, Message);
5861
end Execute;
5962

source/ada/lsp-ada_handlers-open_project_file_commands.adb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,22 @@ package body LSP.Ada_Handlers.Open_Project_File_Commands is
4848
pragma Unreferenced (Response);
4949

5050
Project_File : constant Virtual_File :=
51-
Handler.Project_Status.Get_Project_File;
52-
begin
53-
if Project_File.Is_Regular_File then
54-
URI : constant LSP.Structures.DocumentUri :=
55-
Handler.To_URI (Project_File.Display_Full_Name);
51+
LSP.Ada_Project_Loading.Get_Project_File (Handler.Project_Status);
52+
53+
URI : constant LSP.Structures.DocumentUri :=
54+
(if Project_File.Is_Regular_File
55+
then Handler.To_URI (Project_File.Display_Full_Name)
56+
else "");
5657

57-
Message : constant LSP.Structures.ShowDocumentParams :=
58-
(uri => (VSS.Strings.Virtual_String (URI) with null record),
59-
takeFocus => LSP.Constants.True,
60-
others => <>);
58+
Message : constant LSP.Structures.ShowDocumentParams :=
59+
(uri => (VSS.Strings.Virtual_String (URI) with null record),
60+
takeFocus => LSP.Constants.True,
61+
others => <>);
6162

62-
New_Id : constant LSP.Structures.Integer_Or_Virtual_String :=
63-
Handler.Server.Allocate_Request_Id;
64-
Handler.Sender.On_ShowDocument_Request (New_Id, Message);
63+
begin
64+
if Project_File.Is_Regular_File then
65+
Handler.Sender.On_ShowDocument_Request
66+
(Handler.Server.Allocate_Request_Id, Message);
6567
else
6668
Handler.Sender.On_ShowMessage_Notification (
6769
(LSP.Enumerations.Error,

0 commit comments

Comments
 (0)