Skip to content

Commit 592b5a8

Browse files
authored
ignore venv when local indexing (#5433)
## Problem When triggering the indexing of a project, if the .venv or venv directories from a python virtual environment is not listed in the .gitignore file, the workspace feature tries to index all the files in those directories causing it to take a really long time OR fail due to size. ## Solution Ignore .venv and venv at local indexing. We will build more robust ignore mechanism in the LSP soon. This is a stopgap for now.
1 parent 0ed44a2 commit 592b5a8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "Ignore virtual environment when indexing workspace"
4+
}

packages/core/src/shared/utilities/workspaceUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ export async function collectFilesForIndex(
552552
}
553553

554554
const isBuildOrBin = (filePath: string) => {
555-
const k = /[/\\](bin|build|node_modules|env|\.idea)[/\\]/i
555+
const k = /[/\\](bin|build|node_modules|env|\.idea|\.venv|venv)[/\\]/i
556556
return k.test(filePath)
557557
}
558558

0 commit comments

Comments
 (0)