MCPcopy Create free account
hub / github.com/UNLINEARITY/Obsidian-CodeSpace / ignoreFile

Method ignoreFile

src/main.ts:344–353  ·  view source on GitHub ↗
(fileOrPath: TFile | TFolder | string)

Source from the content-addressed store, hash-verified

342 }
343
344 async ignoreFile(fileOrPath: TFile | TFolder | string): Promise<boolean> {
345 const normalizedPath = this.normalizeIgnoredPath(typeof fileOrPath === "string" ? fileOrPath : fileOrPath.path);
346 if (!normalizedPath || this.settings.ignoredFiles.includes(normalizedPath)) {
347 return false;
348 }
349
350 this.settings.ignoredFiles = this.normalizeIgnoredFiles([...this.settings.ignoredFiles, normalizedPath]);
351 await this.persistIgnoredFiles();
352 return true;
353 }
354
355 async unignoreFile(fileOrPath: TFile | TFolder | string): Promise<boolean> {
356 const normalizedPath = this.normalizeIgnoredPath(typeof fileOrPath === "string" ? fileOrPath : fileOrPath.path);

Callers 1

showContextMenuMethod · 0.80

Calls 3

normalizeIgnoredPathMethod · 0.95
normalizeIgnoredFilesMethod · 0.95
persistIgnoredFilesMethod · 0.95

Tested by

no test coverage detected