Skip to content

Commit da17d77

Browse files
feat: add watch on activate setting (#486)
Co-authored-by: Ryan Luker <[email protected]>
1 parent bb4d09b commit da17d77

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@
143143
"scope": "resource",
144144
"default": true,
145145
"description": "enable or disable quick commands in the context menu"
146+
},
147+
"coverage-gutters.watchOnActivate": {
148+
"type": "boolean",
149+
"scope":"resource",
150+
"default": false,
151+
"description": "automatically watch coverage files and visible editors on extension activation (workspace open)"
146152
}
147153
}
148154
},

src/extension.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,8 @@ export function activate(context: vscode.ExtensionContext) {
4949
context.subscriptions.push(removeWatch);
5050
context.subscriptions.push(gutters);
5151
context.subscriptions.push(outputChannel);
52+
53+
if (configStore.watchOnActivate) {
54+
gutters.watchCoverageAndVisibleEditors();
55+
}
5256
}

src/extension/config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export class Config {
2020
public ignoredPathGlobs!: string;
2121
public remotePathResolve!: string[];
2222
public manualCoverageFilePaths!: string[];
23+
public watchOnActivate!: boolean;
2324

2425
private context: ExtensionContext;
2526

@@ -149,6 +150,8 @@ export class Config {
149150

150151
// Add the manual coverage file path(s) if present
151152
this.manualCoverageFilePaths = rootConfig.get("manualCoverageFilePaths") as string[];
153+
154+
this.watchOnActivate = rootConfig.get("watchOnActivate") as boolean;
152155
}
153156

154157
/**

0 commit comments

Comments
 (0)