Skip to content

Commit 683a6da

Browse files
authored
fix(scan): Restrict scan to current worspace (#25)
1 parent 479fa0d commit 683a6da

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/extension.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ export function activate(context: ExtensionContext) {
202202
context.subscriptions.push(diagnosticCollection);
203203
context.subscriptions.push(
204204
workspace.onDidSaveTextDocument((textDocument) => {
205-
if (authStatus) {
205+
// Check if the document is inside the workspace
206+
const workspaceFolder = workspace.getWorkspaceFolder(textDocument.uri);
207+
if (authStatus && workspaceFolder) {
206208
scanFile(
207209
textDocument.fileName,
208210
textDocument.uri,

0 commit comments

Comments
 (0)