Skip to content

Commit

Permalink
Fixed extension host termination issue (presidio-oss#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
magesh-presidio authored Jan 28, 2025
1 parent 8241dc7 commit ea36f75
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/core/webview/ClineProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {

private codeIndexAbortController: AbortController
private isSideBar: boolean
fileSystemWatcher: HaiFileSystemWatcher
fileSystemWatcher: HaiFileSystemWatcher | undefined

constructor(
readonly context: vscode.ExtensionContext,
Expand All @@ -141,9 +141,11 @@ export class ClineProvider implements vscode.WebviewViewProvider {
this.mcpHub = new McpHub(this)
this.codeIndexAbortController = new AbortController()
this.isSideBar = isSideBar
this.vsCodeWorkSpaceFolderFsPath = this.getWorkspacePath() || ""
this.fileSystemWatcher = new HaiFileSystemWatcher(this, this.vsCodeWorkSpaceFolderFsPath)
this.codeIndexBackground()
this.vsCodeWorkSpaceFolderFsPath = (this.getWorkspacePath() || "").trim()
if (this.vsCodeWorkSpaceFolderFsPath) {
this.fileSystemWatcher = new HaiFileSystemWatcher(this, this.vsCodeWorkSpaceFolderFsPath)
this.codeIndexBackground()
}
}

private getWorkspacePath() {
Expand Down Expand Up @@ -437,7 +439,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
this.workspaceTracker = undefined
this.mcpHub?.dispose()
this.mcpHub = undefined
this.fileSystemWatcher.dispose()
this.fileSystemWatcher?.dispose()
this.outputChannel.appendLine("Disposed all disposables")
ClineProvider.activeInstances.delete(this)
}
Expand Down

0 comments on commit ea36f75

Please sign in to comment.