Skip to content

Commit

Permalink
chore: print paths relative to the workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Oct 2, 2024
1 parent 73ee026 commit a9b20e8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/watcher.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a9b20e8

Please sign in to comment.