Skip to content

Commit 2897960

Browse files
committed
Merge branch 'topic/fix_bugbox' into 'master'
Rewrite code to avoid GNAT bug box. See merge request eng/ide/ada_language_server!1576
2 parents 3af8181 + 6642c60 commit 2897960

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

source/ada/lsp-ada_execute_command.adb

+12-4
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,18 @@ package body LSP.Ada_Execute_Command is
8282
else Ada.Tags.Internal_Tag
8383
(VSS.Strings.Conversions.To_UTF_8_String (Params.command)));
8484

85-
Command : constant Command_Access :=
86-
(if Tag = Ada.Tags.No_Tag then null
87-
else new LSP.Ada_Commands.Command'Class'
88-
(Create_Command (Tag, Params.arguments'Unrestricted_Access)));
85+
function Command return Command_Access;
86+
-- Construct corresponding command for known Tag or return null
87+
88+
function Command return Command_Access is
89+
Result : Command_Access;
90+
begin
91+
if Tag /= Ada.Tags.No_Tag then
92+
Result := new LSP.Ada_Commands.Command'Class'
93+
(Create_Command (Tag, Params.arguments'Unrestricted_Access));
94+
end if;
95+
return Result;
96+
end Command;
8997

9098
Result : constant LSP.Server_Jobs.Server_Job_Access :=
9199
new Ada_Execute_Command_Job'

0 commit comments

Comments
 (0)