From a9b20e805b895c5f41d6bcd436cf6cbc1097fd51 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Wed, 2 Oct 2024 10:42:34 +0200 Subject: [PATCH] chore: print paths relative to the workspace --- src/watcher.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/watcher.ts b/src/watcher.ts index 25a6a22d..f6170632 100644 --- a/src/watcher.ts +++ b/src/watcher.ts @@ -1,4 +1,5 @@ import { stat } from 'node:fs/promises' +import { relative } from 'node:path' import * as vscode from 'vscode' import { normalize } from 'pathe' import mm from 'micromatch' @@ -32,12 +33,12 @@ export class ExtensionWatcher extends vscode.Disposable { this.watcherByFolder.set(api.workspaceFolder, watcher) watcher.onDidDelete((file) => { - log.verbose?.('[VSCODE] File deleted:', file.fsPath) + log.verbose?.('[VSCODE] File deleted:', relative(api.workspaceFolder.uri.fsPath, file.fsPath)) this.testTree.removeFile(normalize(file.fsPath)) }) watcher.onDidChange(async (file) => { - log.verbose?.('[VSCODE] File changed:', file.fsPath) + log.verbose?.('[VSCODE] File changed:', relative(api.workspaceFolder.uri.fsPath, file.fsPath)) const filepath = normalize(file.fsPath) if (await this.shouldIgnoreFile(filepath)) { return @@ -46,7 +47,7 @@ export class ExtensionWatcher extends vscode.Disposable { }) watcher.onDidCreate(async (file) => { - log.verbose?.('[VSCODE] File created:', file.fsPath) + log.verbose?.('[VSCODE] File created:', relative(api.workspaceFolder.uri.fsPath, file.fsPath)) const filepath = normalize(file.fsPath) if (await this.shouldIgnoreFile(filepath)) { return