diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2024-02-22 20:46:13 +0100 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2024-02-22 20:46:13 +0100 |
| commit | acb232ac94f46d6c1b81378ab0be0c5b2f91a446 (patch) | |
| tree | 50519c8b5f4847e73da0712c3ae801c2a184c434 /editors | |
| parent | a75c3424a6003f1ccbfbf6f170009ebf7bf18e4e (diff) | |
Automatically add shared collection.
Diffstat (limited to 'editors')
| -rw-r--r-- | editors/vscode/package-lock.json | 4 | ||||
| -rw-r--r-- | editors/vscode/package.json | 7 | ||||
| -rw-r--r-- | editors/vscode/src/config.ts | 8 | ||||
| -rw-r--r-- | editors/vscode/src/extension.ts | 10 |
4 files changed, 23 insertions, 6 deletions
diff --git a/editors/vscode/package-lock.json b/editors/vscode/package-lock.json index 589200b..6d2309e 100644 --- a/editors/vscode/package-lock.json +++ b/editors/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "ols", - "version": "0.1.15", + "version": "0.1.26", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ols", - "version": "0.1.15", + "version": "0.1.26", "dependencies": { "adm-zip": "^0.5.9", "https-proxy-agent": "^5.0.0", diff --git a/editors/vscode/package.json b/editors/vscode/package.json index b50d575..abbd4d7 100644 --- a/editors/vscode/package.json +++ b/editors/vscode/package.json @@ -7,7 +7,7 @@ "type": "git", "url": "git://github.com/DanielGavin/ols.git" }, - "version": "0.1.23", + "version": "0.1.27", "engines": { "vscode": "^1.66.0" }, @@ -46,6 +46,11 @@ "type": "object", "title": "Odin language client configuration", "properties": { + "ols.prompt.AskCreateOLS": { + "type": "boolean", + "default": true, + "description": "Ask if it should create an ols.json file if it's not in the project." + }, "ols.updates.askBeforeDownload": { "type": "boolean", "default": true, diff --git a/editors/vscode/src/config.ts b/editors/vscode/src/config.ts index 8508d6e..af93db8 100644 --- a/editors/vscode/src/config.ts +++ b/editors/vscode/src/config.ts @@ -1,8 +1,6 @@ import * as vscode from 'vscode'; import { log } from "./util"; -//modified from https://github.com/rust-analyzer/rust-analyzer/blob/master/editors/code/src/config.ts - 03.05.2021 - export class Config { readonly extensionId = "danielgavin.ols"; @@ -45,5 +43,11 @@ export class Config { 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 [] = []; } diff --git a/editors/vscode/src/extension.ts b/editors/vscode/src/extension.ts index 0dd4268..f7ad636 100644 --- a/editors/vscode/src/extension.ts +++ b/editors/vscode/src/extension.ts @@ -107,14 +107,22 @@ export async function activate(context: vscode.ExtensionContext) { fs.access(olsFile, constants.F_OK).catch(async err => { if (err) { + if (!config.askCreateOLS) { + return; + } + const userResponse = await vscode.window.showInformationMessage( "No ols config file in the workspace root folder. Do you wish to create one?", "Yes", - "No" + "No", + "Don't ask again" ); if (userResponse === "Yes") { createOlsConfig(ctx); + } else if (userResponse === "Don't ask again") { + config.updateAskCreateOLS(false); + return; } } |