From 1d1a3185179307fd49c6ac88d65b349161332655 Mon Sep 17 00:00:00 2001 From: ZeWaka Date: Tue, 3 Jan 2023 00:28:31 -0700 Subject: [PATCH 1/3] Add additional arg property to the ext settings --- package.json | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 7b962f2..457066a 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,11 @@ "type": "string", "default": null, "description": "Path to your copy of the OpenDream source code." + }, + "opendream.additionalArgs": { + "type": "string", + "default": null, + "description": "Additional arguments to pass to the OpenDream compiler" } } }, @@ -45,19 +50,19 @@ { "name": "openDreamCompiler", "owner": "opendream", - "source": "OpenDream", + "source": "OpenDream", "fileLocation": [ "relative", "${workspaceFolder}" ], - "pattern": { - "regexp": "^(\\w+) at (.+):(\\d+):(\\d+): (.+)$", - "severity": 1, - "file": 2, - "line": 3, - "column": 4, - "message": 5 - } + "pattern": { + "regexp": "^(\\w+) at (.+):(\\d+):(\\d+): (.+)$", + "severity": 1, + "file": 2, + "line": 3, + "column": 4, + "message": 5 + } } ], "taskDefinitions": [ From 3fe1a723eb67a3255afa588c398677932912f778 Mon Sep 17 00:00:00 2001 From: ZeWaka Date: Tue, 3 Jan 2023 00:53:38 -0700 Subject: [PATCH 2/3] Functionality for the additional arguments setting --- src/extension.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index c5c0993..09ab523 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -111,6 +111,9 @@ class OpenDreamTaskProvider implements TaskProvider { return []; } + let additionalArgs: string | undefined = workspace.getConfiguration('opendream').get('additionalArgs'); + additionalArgs = additionalArgs ?? "" // `ProcessExecution` can't handle args that are `undefined` + let list = []; // Add build tasks for each .dme in the workspace. @@ -125,7 +128,7 @@ class OpenDreamTaskProvider implements TaskProvider { folder, TaskNames.RUN_COMPILER(file), TaskNames.SOURCE, - openDream.getCompilerExecution(file), + openDream.getCompilerExecution(file, additionalArgs), '$openDreamCompiler' ); task.group = TaskGroup.Build; @@ -242,7 +245,7 @@ class OpenDreamDebugAdapter implements vscode.DebugAdapter { // Abstraction over possible OpenDream installation methods. interface OpenDreamInstallation { - getCompilerExecution(dme: string): ProcessExecution | vscode.ShellExecution | vscode.CustomExecution; + getCompilerExecution(dme: string, additionalArgs: string): ProcessExecution | vscode.ShellExecution | vscode.CustomExecution; buildClient(workspaceFolder?: vscode.WorkspaceFolder): Promise; startServer(params: { workspaceFolder?: vscode.WorkspaceFolder, debugPort: number, json_path: string }): Promise; } @@ -317,9 +320,10 @@ class ODBinaryDistribution implements OpenDreamInstallation { this.path = path; } - getCompilerExecution(dme: string): ProcessExecution { + getCompilerExecution(dme: string, addditionalArgs: string): ProcessExecution { return new ProcessExecution(`${this.path}/DMCompiler`, [ dme, + addditionalArgs, ]); } @@ -363,12 +367,13 @@ class ODSourceInstallation implements OpenDreamInstallation { this.path = path; } - getCompilerExecution(dme: string): ProcessExecution { + getCompilerExecution(dme: string, additionalArgs: string): ProcessExecution { return new ProcessExecution("dotnet", [ "run", "--project", `${this.path}/DMCompiler`, "--", dme, + additionalArgs, ]); } From 209afeedc26143bee577023c23c37b235f2153fa Mon Sep 17 00:00:00 2001 From: ZeWaka Date: Tue, 3 Jan 2023 00:54:01 -0700 Subject: [PATCH 3/3] Bump version to v0.1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 457066a..1098a92 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opendream", - "version": "0.1.0", + "version": "0.1.1", "displayName": "OpenDream dev tools", "description": "Developer tools for OpenDream", "publisher": "platymuus",