Skip to content

Commit 4afd7d7

Browse files
committed
fix: remove await from startIndexing calls and update JSDoc
- startIndexing should never be awaited as it's a long-running background process - Added JSDoc warning to never await this method - Updated webviewMessageHandler to not await startIndexing calls
1 parent f9605a0 commit 4afd7d7

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/core/webview/webviewMessageHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2204,13 +2204,13 @@ export const webviewMessageHandler = async (
22042204
}
22052205

22062206
// startIndexing now handles error recovery internally
2207-
await manager.startIndexing()
2207+
manager.startIndexing()
22082208

22092209
// If startIndexing recovered from error, we need to reinitialize
22102210
if (!manager.isInitialized) {
22112211
await manager.initialize(provider.contextProxy)
22122212
// Try starting again after initialization
2213-
await manager.startIndexing()
2213+
manager.startIndexing()
22142214
}
22152215
}
22162216
} catch (error) {

src/services/code-index/manager.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ export class CodeIndexManager {
161161
/**
162162
* Initiates the indexing process (initial scan and starts watcher).
163163
* Automatically recovers from error state if needed before starting.
164+
*
165+
* @important This method should NEVER be awaited as it starts a long-running background process.
166+
* The indexing will continue asynchronously and progress will be reported through events.
164167
*/
165168
public async startIndexing(): Promise<void> {
166169
if (!this.isFeatureEnabled) {

0 commit comments

Comments
 (0)