Skip to content

Commit 3ba7f9e

Browse files
committed
Merge branch 'topic/prepend' into 'master'
Make append_to_env prepend a new value See merge request eng/ide/ada_language_server!1144
2 parents 75860e1 + bf95c5e commit 3ba7f9e

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

source/tester/tester-tests.adb

+12-12
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ package body Tester.Tests is
3939
Max_Wait : constant := 16.0;
4040
-- Max number of seconds to wait on a given snippet
4141

42-
type Command_Kind is (Start, Stop, Send, Shell, Append_To_Env, Comment);
42+
type Command_Kind is (Start, Stop, Send, Shell, Prepend_To_Env, Comment);
4343

44-
procedure Do_Append_To_Env
44+
procedure Do_Prepend_To_Env
4545
(Self : in out Test'Class;
4646
Command : GNATCOLL.JSON.JSON_Value);
47-
-- Implementation of `append_to_env` command
47+
-- Implementation of `prepend_to_env` command
4848

4949
procedure Do_Start
5050
(Self : in out Test'Class;
@@ -167,11 +167,11 @@ package body Tester.Tests is
167167
GNAT.OS_Lib.OS_Exit (1);
168168
end Do_Abort;
169169

170-
----------------------
171-
-- Do_Append_To_Env --
172-
----------------------
170+
-----------------------
171+
-- Do_Prepend_To_Env --
172+
-----------------------
173173

174-
procedure Do_Append_To_Env
174+
procedure Do_Prepend_To_Env
175175
(Self : in out Test'Class;
176176
Command : GNATCOLL.JSON.JSON_Value)
177177
is
@@ -186,16 +186,16 @@ package body Tester.Tests is
186186
if Self.Environment.Contains (Name) then
187187
Self.Environment.Insert
188188
(Name,
189-
Self.Environment.Value (Name)
189+
Value.Get
190190
& GNAT.OS_Lib.Path_Separator &
191-
Value.Get);
191+
Self.Environment.Value (Name));
192192
else
193193
Self.Environment.Insert (Name, Value.Get);
194194
end if;
195195
end On_Key;
196196
begin
197197
Command.Map_JSON_Object (On_Key'Access);
198-
end Do_Append_To_Env;
198+
end Do_Prepend_To_Env;
199199

200200
-------------
201201
-- Do_Fail --
@@ -926,8 +926,8 @@ package body Tester.Tests is
926926
Self.Do_Stop (Value);
927927
when Send =>
928928
Self.Do_Send (Value);
929-
when Append_To_Env =>
930-
Self.Do_Append_To_Env (Value);
929+
when Prepend_To_Env =>
930+
Self.Do_Prepend_To_Env (Value);
931931
when Shell =>
932932
Self.Do_Shell (Value);
933933
when Comment =>

testsuite/ada_lsp/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Table of Contents
1313
* [Command `stop`](#command-stop)
1414
* [Command `send`](#command-send)
1515
* [Command `shell`](#command-shell)
16-
* [Command `append_to_env`](#command-append_to_env)
16+
* [Command `prepend_to_env`](#command-prepend_to_env)
1717
* [Command `comment`](#command-comment)
1818
* [Execution timeouts](#execution-timeouts)
1919
* [JSON file preprocessing](#json-file-preprocessing)
@@ -130,15 +130,15 @@ The primary purpose is to launch a Python like this:
130130

131131
"shell": ["${PYTHON}", "${DIR}/makelink.py" ]
132132

133-
### Command `append_to_env`
133+
### Command `prepend_to_env`
134134

135135
Property value - an object, where keys are environment variable
136-
to change and a string value to be appended.
136+
to change and a string value to be prepended.
137137

138138
This command modifies environment for child processes.
139139
The primary purpose is to change `PATH` like this:
140140

141-
"append_to_env": { "PATH": "${DIR}" }
141+
"prepend_to_env": { "PATH": "${DIR}" }
142142

143143
### Command `comment`
144144

0 commit comments

Comments
 (0)