Skip to content

Commit

Permalink
Fixed issue #9
Browse files Browse the repository at this point in the history
  • Loading branch information
genius257 committed Jan 29, 2023
1 parent 8f1ce21 commit 9b78d46
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,18 @@
"launch": {
"required": [
"script",
"cwd",
"executable"
],
"properties": {
"script": {
"type": "string",
"description": "Absolute path to the AutoIt3 script"
},
"cwd": {
"type": "string",
"description": "Absolute path to the working directory of the script being debugged."
},
"executable": {
"type": "string",
"description": "Absolute path to the AutoIt3 executable",
Expand All @@ -69,6 +74,7 @@
"request": "launch",
"name": "Run AutoIt3 script",
"script": "${file}",
"cwd": "${fileDirname}",
"executable": "${config:autoit3.installDir}/AutoIt3.exe"
}
],
Expand All @@ -81,6 +87,7 @@
"request": "launch",
"name": "Run AutoIt3 script",
"script": "^\"\\${file}\"",
"cwd": "\"\\${fileDirname}\"",
"executable": "^\"\\${config:autoit3.installDir}/AutoIt3.exe\""
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/au3Debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export interface LaunchRequestArguments extends VSCodeDebugProtocol.LaunchReques
executable: string;
/** Full path to the AutoIt3 script */
script: string;
/** Absolute path to the working directory of the script */
cwd: string;
}

export class Au3DebugSession extends DebugSession {
Expand All @@ -39,7 +41,7 @@ export class Au3DebugSession extends DebugSession {
//vscode.debug.activeDebugConsole.append
vscode.commands.executeCommand('workbench.panel.repl.view.focus');

this.process = childProcess.spawn(args.executable, [args.script], {stdio: "pipe"});
this.process = childProcess.spawn(args.executable, [args.script], {stdio: "pipe", cwd: args.cwd});
this.process.on('error', (err) => {
response.success = false;
response.message = err.message;
Expand Down

0 comments on commit 9b78d46

Please sign in to comment.