Skip to content

Commit f104f22

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 d2308de commit f104f22

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
@@ -2218,13 +2218,13 @@ export const webviewMessageHandler = async (
22182218
}
22192219

22202220
// startIndexing now handles error recovery internally
2221-
await manager.startIndexing()
2221+
manager.startIndexing()
22222222

22232223
// If startIndexing recovered from error, we need to reinitialize
22242224
if (!manager.isInitialized) {
22252225
await manager.initialize(provider.contextProxy)
22262226
// Try starting again after initialization
2227-
await manager.startIndexing()
2227+
manager.startIndexing()
22282228
}
22292229
}
22302230
} catch (error) {

src/services/code-index/manager.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ export class CodeIndexManager {
168168
/**
169169
* Initiates the indexing process (initial scan and starts watcher).
170170
* Automatically recovers from error state if needed before starting.
171+
*
172+
* @important This method should NEVER be awaited as it starts a long-running background process.
173+
* The indexing will continue asynchronously and progress will be reported through events.
171174
*/
172175
public async startIndexing(): Promise<void> {
173176
if (!this.isFeatureEnabled) {

0 commit comments

Comments
 (0)