Skip to content

Commit f3fbf20

Browse files
committed
fix(debugger): corrected start debuggin in internalConsole
1 parent 4c65673 commit f3fbf20

File tree

5 files changed

+19
-10
lines changed

5 files changed

+19
-10
lines changed

Diff for: package.json

+5
Original file line numberDiff line numberDiff line change
@@ -1250,6 +1250,11 @@
12501250
"markdownDescription": "Specifies the tags that should be excluded in test run. Corresponds to the `--excluded tag *` option of __robot__."
12511251
},
12521252
"launcherArgs": {
1253+
"type": "array",
1254+
"description": "Command line arguments passed to launcher.",
1255+
"default": []
1256+
},
1257+
"launcherExtraArgs": {
12531258
"type": "array",
12541259
"description": "Extra command line arguments passed to launcher.",
12551260
"default": []

Diff for: packages/debugger/src/robotcode/debugger/debugger.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ def start_output_group(self, name: str, attributes: Dict[str, Any], type: Option
756756
OutputEvent(
757757
body=OutputEventBody(
758758
output=f"\u001b[38;5;14m{(type + ' ') if type else ''}\u001b[0m{name}\n",
759-
category=OutputCategory.CONSOLE,
759+
category="OutputCategory.CONSOLE",
760760
group=OutputGroup.START,
761761
source=Source(path=str(self.map_path_to_client(source))) if source else None,
762762
line=line_no if source is not None else None,
@@ -778,7 +778,8 @@ def end_output_group(self, name: str, attributes: Dict[str, Any], type: Optional
778778
category=OutputCategory.CONSOLE,
779779
group=OutputGroup.END,
780780
source=Source(path=str(self.map_path_to_client(source))) if source else None,
781-
line=line_no,
781+
line=line_no if source is not None else None,
782+
column=0 if source is not None else None,
782783
)
783784
),
784785
)

Diff for: packages/debugger/src/robotcode/debugger/launcher/server.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ async def _launch(
298298
run_env.update(env)
299299

300300
await asyncio.get_event_loop().subprocess_exec(
301-
lambda: OutputProtocol(self), *run_args, cwd=cwd, env=run_env
301+
lambda: OutputProtocol(self), *robotcode_run_args, *run_args, cwd=cwd, env=run_env
302302
)
303303

304304
else:

Diff for: packages/debugger/src/robotcode/debugger/server.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import asyncio
22
import os
3+
import signal
34
import threading
45
from typing import Any, Callable, Dict, List, Literal, Optional, Union
56

@@ -215,6 +216,7 @@ def initialized(self) -> None:
215216

216217
@_logger.call
217218
def exit(self, exit_code: int) -> None:
219+
218220
with self._exited_lock:
219221
self.send_event(ExitedEvent(body=ExitedEventBody(exit_code=exit_code)))
220222
self._exited = True
@@ -232,8 +234,6 @@ async def _terminate(
232234
*args: Any,
233235
**kwargs: Any,
234236
) -> None:
235-
import signal
236-
237237
if not self._sigint_signaled:
238238
self._logger.info("Send SIGINT to process")
239239
signal.raise_signal(signal.SIGINT)

Diff for: vscode-client/debugmanager.ts

+8-5
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ class RobotCodeDebugConfigurationProvider implements vscode.DebugConfigurationPr
180180
debugConfiguration.attachPython = false;
181181
}
182182

183+
debugConfiguration.console =
184+
(debugConfiguration?.console as string | undefined) ?? config.get<string>("debug.defaultConsole");
185+
183186
if (debugConfiguration.attachPython && !config.get<boolean>("debug.useExternalDebugpy")) {
184187
const debugpyPath = await this.pythonManager.getDebuggerPackagePath();
185188

@@ -233,7 +236,11 @@ class RobotCodeDebugAdapterDescriptorFactory implements vscode.DebugAdapterDescr
233236
throw new Error("Can't get a valid python command.");
234237
}
235238

236-
const robotcodeExtraArgs = config.get<string[]>("extraArgs", []);
239+
let robotcodeExtraArgs = config.get<string[]>("extraArgs", []);
240+
241+
if (session.configuration.launcherExtraArgs) {
242+
robotcodeExtraArgs = [...robotcodeExtraArgs, ...(session.configuration.launcherExtraArgs as string[])];
243+
}
237244
const args: string[] = [
238245
"-u",
239246
this.pythonManager.robotCodeMain,
@@ -550,10 +557,6 @@ export class DebugManager {
550557
cwd: folder?.uri.fsPath,
551558
paths: paths?.length > 0 ? paths : ["."],
552559
args: "args" in testLaunchConfig ? [...(testLaunchConfig.args as string[]), ...args] : args,
553-
console:
554-
"console" in testLaunchConfig
555-
? testLaunchConfig.console
556-
: config.get("debug.defaultConsole", "integratedTerminal"),
557560
runId: runId,
558561
},
559562
},

0 commit comments

Comments
 (0)