fix: skip indexing home directory
This commit is contained in:
parent
1fa4c2f9f3
commit
7443c20ea8
1 changed files with 10 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ import { glob, GlobOptionsWithFileTypesFalse } from "glob";
|
|||
import { FILE_IGNORE_PATTERNS, FILE_PATTERNS } from "../util/filePatterns.js";
|
||||
import { getFileWatcher } from "../util/fileWatcher.js";
|
||||
import { isGitRepo } from "../util/git.js";
|
||||
import { isInHomeDirectory } from "../util/isInHomeDirectory.js";
|
||||
import { logger } from "../util/logger.js";
|
||||
|
||||
import { BaseService } from "./BaseService.js";
|
||||
|
|
@ -69,6 +70,15 @@ export class FileIndexService extends BaseService<FileIndexServiceState> {
|
|||
|
||||
try {
|
||||
const inGitRepo = isGitRepo();
|
||||
|
||||
if (isInHomeDirectory()) {
|
||||
this.setState({
|
||||
isIndexing: false,
|
||||
error: "Skipping full index as in home directory",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const allMatches = await this.throttledGlob(FILE_PATTERNS, {
|
||||
maxDepth: inGitRepo ? 15 : 3,
|
||||
ignore: FILE_IGNORE_PATTERNS,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue