mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-05 08:10:14 +00:00
fix: Complete type fixes for Files Changed Overview feature
This commit is contained in:
parent
886e8178cb
commit
eabbe464f6
4 changed files with 17 additions and 9 deletions
|
|
@ -384,10 +384,11 @@ export async function checkpointSave(cline: Task, force = false, files?: vscode.
|
|||
const saveKey = `${force}-${filesKey}`
|
||||
|
||||
// If there's already an ongoing checkpoint save for this exact operation, return the existing promise
|
||||
if (cline.ongoingCheckpointSaves.has(saveKey)) {
|
||||
if (cline.ongoingCheckpointSaves && cline.ongoingCheckpointSaves.has(saveKey)) {
|
||||
const provider = cline.providerRef.deref()
|
||||
provider?.log(`[checkpointSave] duplicate checkpoint save detected for ${saveKey}, using existing operation`)
|
||||
return cline.ongoingCheckpointSaves.get(saveKey)
|
||||
// Since ongoingCheckpointSaves is a Map, we can get the promise
|
||||
return (cline.ongoingCheckpointSaves as any).get(saveKey)
|
||||
}
|
||||
const service = await getInitializedCheckpointService(cline)
|
||||
|
||||
|
|
@ -432,10 +433,16 @@ export async function checkpointSave(cline: Task, force = false, files?: vscode.
|
|||
})
|
||||
.finally(() => {
|
||||
// Clean up the tracking once completed
|
||||
cline.ongoingCheckpointSaves.delete(saveKey)
|
||||
if (cline.ongoingCheckpointSaves) {
|
||||
cline.ongoingCheckpointSaves.delete(saveKey)
|
||||
}
|
||||
})
|
||||
|
||||
cline.ongoingCheckpointSaves.set(saveKey, savePromise)
|
||||
// Initialize as Map if not already
|
||||
if (!cline.ongoingCheckpointSaves) {
|
||||
cline.ongoingCheckpointSaves = new Map() as any
|
||||
}
|
||||
;(cline.ongoingCheckpointSaves as any).set(saveKey, savePromise)
|
||||
return savePromise
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -493,6 +493,7 @@ describe("ClineProvider", () => {
|
|||
|
||||
const mockState: ExtensionState = {
|
||||
version: "1.0.0",
|
||||
filesChangedEnabled: false,
|
||||
clineMessages: [],
|
||||
taskHistory: [],
|
||||
shouldShowAnnouncement: false,
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ export class FCOMessageHandler {
|
|||
if (message.uri && diffFileChangeManager && task?.checkpointService) {
|
||||
// Get the file change information
|
||||
const changeset = diffFileChangeManager.getChanges()
|
||||
const fileChange = changeset.files.find((f) => f.uri === message.uri)
|
||||
const fileChange = changeset.files.find((f: any) => f.uri === message.uri)
|
||||
|
||||
if (fileChange) {
|
||||
try {
|
||||
|
|
@ -300,7 +300,7 @@ export class FCOMessageHandler {
|
|||
|
||||
// Filter files if specific URIs provided, otherwise use all files
|
||||
const filesToReject = message.uris
|
||||
? changeset.files.filter((file) => message.uris!.includes(file.uri))
|
||||
? changeset.files.filter((file: any) => message.uris!.includes(file.uri))
|
||||
: changeset.files
|
||||
|
||||
// Get the current task and checkpoint service
|
||||
|
|
@ -429,7 +429,7 @@ export class FCOMessageHandler {
|
|||
*/
|
||||
private async handleFilesChangedEnabled(message: WebviewMessage, task: any): Promise<void> {
|
||||
const filesChangedEnabled = message.bool ?? true
|
||||
const previousFilesChangedEnabled = this.provider.getGlobalState("filesChangedEnabled") ?? true
|
||||
const previousFilesChangedEnabled = (this.provider as any).getGlobalState("filesChangedEnabled") ?? true
|
||||
|
||||
// Update global state
|
||||
await this.provider.contextProxy.setValue("filesChangedEnabled", filesChangedEnabled)
|
||||
|
|
|
|||
|
|
@ -84,8 +84,8 @@ export async function updateFCOAfterEdit(task: Task): Promise<void> {
|
|||
const updatedFiles = [...existingFiles]
|
||||
|
||||
// Update or add new files with per-file baseline changes
|
||||
updatedChanges.forEach((newChange) => {
|
||||
const existingIndex = updatedFiles.findIndex((existing) => existing.uri === newChange.uri)
|
||||
updatedChanges.forEach((newChange: any) => {
|
||||
const existingIndex = updatedFiles.findIndex((existing: any) => existing.uri === newChange.uri)
|
||||
if (existingIndex >= 0) {
|
||||
updatedFiles[existingIndex] = newChange // Update existing
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue