Skip to content

Commit 58b0b64

Browse files
committed
fix: Use workspacePath from instance if available in CodeIndexManager and QdrantVectorStore
1 parent f53fd39 commit 58b0b64

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/services/code-index/manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export class CodeIndexManager {
132132
}
133133

134134
// 3. Check if workspace is available
135-
const workspacePath = getWorkspacePath()
135+
const workspacePath = this.workspacePath || getWorkspacePath()
136136
if (!workspacePath) {
137137
this._stateManager.setSystemState("Standby", "No workspace folder open")
138138
return { requiresRestart }
@@ -305,7 +305,7 @@ export class CodeIndexManager {
305305
)
306306

307307
const ignoreInstance = ignore()
308-
const workspacePath = getWorkspacePath()
308+
const workspacePath = this.workspacePath
309309

310310
if (!workspacePath) {
311311
this._stateManager.setSystemState("Standby", "")

src/services/code-index/vector-store/qdrant-client.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export class QdrantVectorStore implements IVectorStore {
1717
private client: QdrantClient
1818
private readonly collectionName: string
1919
private readonly qdrantUrl: string = "http://localhost:6333"
20+
private readonly workspaceRoot: string
2021

2122
/**
2223
* Creates a new Qdrant vector store
@@ -29,6 +30,7 @@ export class QdrantVectorStore implements IVectorStore {
2930

3031
// Store the resolved URL for our property
3132
this.qdrantUrl = parsedUrl
33+
this.workspaceRoot = workspacePath
3234

3335
try {
3436
const urlObj = new URL(parsedUrl)
@@ -445,7 +447,7 @@ export class QdrantVectorStore implements IVectorStore {
445447
return
446448
}
447449

448-
const workspaceRoot = getWorkspacePath()
450+
const workspaceRoot = this.workspaceRoot || getWorkspacePath()
449451

450452
// Build filters using pathSegments to match the indexed fields
451453
const filters = filePaths.map((filePath) => {

0 commit comments

Comments
 (0)