diff --git a/package.json b/package.json index d99d166..a1b048d 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "contract-guard", "displayName": "contract-guard", - "description": "Security analysis for code, config, Dockerfiles, data payloads, and dependencies.", - "version": "1.2.0", + "description": "A VS Code extension that finds security issues in code, configs, queries, Dockerfiles, and secrets.", + "version": "1.2.1", "publisher": "BlackplaneSystems", "license": "Apache-2.0", "icon": "media/icon.png", @@ -118,6 +118,12 @@ "minimum": 0, "description": "Debounce delay for automatic scans." }, + "contractguard.scanOnSaveScope": { + "type": "string", + "default": "workspace", + "enum": ["workspace", "currentFile"], + "description": "What to scan after saving a file: the whole workspace or just the active file." + }, "contractguard.enabledAnalyzers": { "type": "array", "default": [ @@ -158,7 +164,7 @@ }, "scripts": { "build": "tsc -p ./tsconfig.json", - "package": "node -e \"require('fs').mkdirSync('dist-vsix',{recursive:true})\" && vsce package --out dist-vsix/contractguard-1.2.0.vsix", + "package": "node -e \"require('fs').mkdirSync('dist-vsix',{recursive:true})\" && vsce package --out dist-vsix/contractguard-1.2.1.vsix", "prepackage": "npm run build" }, "devDependencies": { diff --git a/vscode-src/extension.ts b/vscode-src/extension.ts index 338dbb0..8d2b45e 100644 --- a/vscode-src/extension.ts +++ b/vscode-src/extension.ts @@ -510,7 +510,12 @@ export function activate(context: vscode.ExtensionContext): void { if (document.uri.scheme !== 'file') { return; } - controller.scheduleFileScan(document.uri.fsPath); + const scanOnSaveScope = vscode.workspace.getConfiguration('contractguard').get('scanOnSaveScope', 'workspace'); + if (scanOnSaveScope === 'currentFile') { + controller.scheduleFileScan(document.uri.fsPath); + return; + } + controller.scheduleWorkspaceScan(); }), vscode.workspace.onDidChangeConfiguration((event) => { if (event.affectsConfiguration('contractguard')) {