Skip to content

Commit

Permalink
vscode-extension: add optional asconfigPath to launch.json configurat…
Browse files Browse the repository at this point in the history
…ion (references #29)
  • Loading branch information
joshtynjala committed Sep 7, 2021
1 parent fed55ab commit ef89460
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
8 changes: 8 additions & 0 deletions vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,14 @@
],
"description": "(Advanced) Specifies the root directory of the application to run. If not specified, the directory containing the application descriptor file is used.",
"default": null
},
"asconfigPath": {
"type": [
"string",
"null"
],
"description": "(Advanced) A custom path to the asconfig.json file used for automatically populating the other fields.",
"default": null
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ interface SWFDebugConfiguration extends vscode.DebugConfiguration {
platform?: string;
bundle?: string;
applicationID?: string;
asconfigPath?: string;
}

export type SWFDebugConfigurationPathsCallback = () => {
Expand Down Expand Up @@ -93,10 +94,12 @@ export default class SWFDebugConfigurationProvider

let asconfigJSON: any = null;
if (workspaceFolder !== undefined) {
let asconfigPath = path.resolve(
workspaceFolder.uri.fsPath,
FILE_NAME_ASCONFIG_JSON
);
var asconfigPath = debugConfiguration.asconfigPath
? debugConfiguration.asconfigPath
: FILE_NAME_ASCONFIG_JSON;
if (!path.isAbsolute(asconfigPath)) {
asconfigPath = path.resolve(workspaceFolder.uri.fsPath, asconfigPath);
}
if (fs.existsSync(asconfigPath)) {
try {
let asconfigFile = fs.readFileSync(asconfigPath, "utf8");
Expand Down

0 comments on commit ef89460

Please sign in to comment.