Fix bug where new files won't show up in files dropdown (#1704)

* Fix bug where new files won't show up in files dropdown

* Create small-gifts-count.md
This commit is contained in:
Saoud Rizwan 2025-02-07 20:52:51 -08:00 committed by GitHub
parent 134020d51b
commit 887456ead8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 17 additions and 3 deletions

View file

@ -0,0 +1,5 @@
---
"claude-dev": patch
---
Fix bug where new files won't show up in files dropdown

View file

@ -1835,6 +1835,11 @@ export class Cline {
`${newProblemsMessage}`,
)
}
if (!fileExists) {
this.providerRef.deref()?.workspaceTracker?.populateFilePaths()
}
await this.diffViewProvider.reset()
await this.saveCheckpoint()
break
@ -2387,6 +2392,10 @@ export class Cline {
if (userRejected) {
this.didRejectTool = true
}
// Re-populate file paths in case the command modified the workspace (vscode listeners do not trigger unless the user manually creates/deletes files)
this.providerRef.deref()?.workspaceTracker?.populateFilePaths()
pushToolResult(result)
await this.saveCheckpoint()
break

View file

@ -102,7 +102,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
private disposables: vscode.Disposable[] = []
private view?: vscode.WebviewView | vscode.WebviewPanel
private cline?: Cline
private workspaceTracker?: WorkspaceTracker
workspaceTracker?: WorkspaceTracker
mcpHub?: McpHub
private authManager: FirebaseAuthManager
private latestAnnouncementId = "jan-20-2025" // update to some unique identifier when we add a new announcement
@ -379,7 +379,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
switch (message.type) {
case "webviewDidLaunch":
this.postStateToWebview()
this.workspaceTracker?.initializeFilePaths() // don't await
this.workspaceTracker?.populateFilePaths() // don't await
getTheme().then((theme) =>
this.postMessageToWebview({
type: "theme",

View file

@ -16,7 +16,7 @@ class WorkspaceTracker {
this.registerListeners()
}
async initializeFilePaths() {
async populateFilePaths() {
// should not auto get filepaths for desktop since it would immediately show permission popup before cline ever creates a file
if (!cwd) {
return