diff options
| author | hardliner66 <hardliner66@gmail.com> | 2025-03-09 17:03:43 +0100 |
|---|---|---|
| committer | hardliner66 <hardliner66@gmail.com> | 2025-03-09 17:03:43 +0100 |
| commit | 45ed358bbee2febc0bbfcd6525cce26fb263bda7 (patch) | |
| tree | 9d1810757636a3b58fef8b0b79492465cebe2d7d /editors/vscode/src/config.ts | |
| parent | a0694cb331571e2cb31512af7da75756ef984ec2 (diff) | |
read odin_command from ols.json to check if it exists
Diffstat (limited to 'editors/vscode/src/config.ts')
| -rw-r--r-- | editors/vscode/src/config.ts | 67 |
1 files changed, 34 insertions, 33 deletions
diff --git a/editors/vscode/src/config.ts b/editors/vscode/src/config.ts index af93db8..1950b2c 100644 --- a/editors/vscode/src/config.ts +++ b/editors/vscode/src/config.ts @@ -3,51 +3,52 @@ import { log } from "./util"; export class Config { - readonly extensionId = "danielgavin.ols"; - readonly rootSection = "ols"; + readonly extensionId = "danielgavin.ols"; + readonly rootSection = "ols"; readonly globalStorageUri: vscode.Uri; - readonly package: { - version: string; - releaseTag: string | null; - enableProposedApi: boolean | undefined; - } = vscode.extensions.getExtension(this.extensionId)!.packageJSON; + readonly package: { + version: string; + releaseTag: string | null; + enableProposedApi: boolean | undefined; + } = vscode.extensions.getExtension(this.extensionId)!.packageJSON; - constructor(ctx: vscode.ExtensionContext) { - this.globalStorageUri = ctx.globalStorageUri; - } + constructor(ctx: vscode.ExtensionContext) { + this.globalStorageUri = ctx.globalStorageUri; + } - private get cfg(): vscode.WorkspaceConfiguration { - return vscode.workspace.getConfiguration(this.rootSection); - } + private get cfg(): vscode.WorkspaceConfiguration { + return vscode.workspace.getConfiguration(this.rootSection); + } - get serverPath() { - return this.get<null | string>("server.path") ?? this.get<null | string>("serverPath"); - } + get serverPath() { + return this.get<null | string>("server.path") ?? this.get<null | string>("serverPath"); + } - get httpProxy() { - const httpProxy = vscode - .workspace - .getConfiguration('http') - .get<null | string>("proxy")!; + get httpProxy() { + const httpProxy = vscode + .workspace + .getConfiguration('http') + .get<null | string>("proxy")!; - return httpProxy || process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } + return httpProxy || process.env["https_proxy"] || process.env["HTTPS_PROXY"]; + } - private get<T>(path: string): T { - return this.cfg.get<T>(path)!; - } + private get<T>(path: string): T { + return this.cfg.get<T>(path)!; + } - get askBeforeDownload() { return this.get<boolean>("updates.askBeforeDownload"); } + get askBeforeDownload() { return this.get<boolean>("updates.askBeforeDownload"); } - get debugEngine() { return this.get<string>("debug.engine"); } + get debugEngine() { return this.get<string>("debug.engine"); } get askCreateOLS() { return this.get<boolean>("prompt.AskCreateOLS"); } - public updateAskCreateOLS(ask: boolean) { - this.cfg.update("prompt.AskCreateOLS", ask, vscode.ConfigurationTarget.Global); - } - - collections: any [] = []; + public updateAskCreateOLS(ask: boolean) { + this.cfg.update("prompt.AskCreateOLS", ask, vscode.ConfigurationTarget.Global); + } + + collections: any[] = []; + odinCommand: string = null; } |