Skip to content

Commit 0381e0e

Browse files
committed
Start running and debugging from yaml path
1 parent 4fad05a commit 0381e0e

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

src/debug.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export function debugYaml(pykisoConfigPath: vscode.Uri) {
2424
module: "pykiso",
2525
justMyCode: false,
2626
args: ["-c", pykisoConfigPath.fsPath],
27+
cwd: pykisoConfigPath.path.substring(0, pykisoConfigPath.path.lastIndexOf('/')),
28+
purpose: ["debug-in-terminal"]
2729
};
2830

2931
vscode.debug.startDebugging(workspaceFolder, pykisoDebugConfig);

src/pykisoRunner.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,25 @@ export class PykisoRunner {
2323
var activeFile = filePath!.split("\\").pop()!.split("/").pop();
2424
this.updatePythonInterpreter();
2525

26+
var filePathUri = vscode.Uri.parse(filePath);
27+
2628
if (!debug) {
27-
var terminal = vscode.window.createTerminal(
28-
`Pykiso #${this.nextTermID++} ${activeFile}`
29-
);
29+
const terminalOptions = {
30+
name: `Pykiso #${this.nextTermID++} ${activeFile}`,
31+
cwd: filePathUri.path.substring(0, filePathUri.path.lastIndexOf('/')),
32+
};
33+
34+
var terminal = vscode.window.createTerminal(terminalOptions);
3035
terminal.sendText(
3136
`${this.pythonInterpreterPath} -m pykiso -c \"${filePath}\"`
3237
);
3338
} else {
34-
var terminal = vscode.window.createTerminal(
35-
`Pykiso DEBUG #${this.nextTermID++} ${activeFile}`
36-
);
39+
const terminalOptions = {
40+
name: `Pykiso DEBUG #${this.nextTermID++} ${activeFile}`,
41+
cwd: filePathUri.path.substring(0, filePathUri.path.lastIndexOf('/')),
42+
};
43+
44+
var terminal = vscode.window.createTerminal(terminalOptions);
3745
terminal.sendText(
3846
`${this.pythonInterpreterPath} -m pykiso -c \"${filePath}\" --log-level DEBUG`
3947
);

0 commit comments

Comments
 (0)