@@ -136,7 +136,7 @@ describe("writeToFileTool", () => {
136136 mockCline . rooIgnoreController = {
137137 validateAccess : vi . fn ( ) . mockReturnValue ( true ) ,
138138 }
139- mockCline . diffViewProvider = {
139+ mockCline . editingProvider = {
140140 editType : undefined ,
141141 isEditing : false ,
142142 originalContent : "" ,
@@ -245,7 +245,7 @@ describe("writeToFileTool", () => {
245245 await executeWriteFileTool ( { } , { accessAllowed : true } )
246246
247247 expect ( mockCline . rooIgnoreController . validateAccess ) . toHaveBeenCalledWith ( testFilePath )
248- expect ( mockCline . diffViewProvider . open ) . toHaveBeenCalledWith ( testFilePath , MOCK_VIEW_COLUMN )
248+ expect ( mockCline . editingProvider . open ) . toHaveBeenCalledWith ( testFilePath , MOCK_VIEW_COLUMN )
249249 } )
250250 } )
251251
@@ -254,18 +254,18 @@ describe("writeToFileTool", () => {
254254 await executeWriteFileTool ( { } , { fileExists : true } )
255255
256256 expect ( mockedFileExistsAtPath ) . toHaveBeenCalledWith ( absoluteFilePath )
257- expect ( mockCline . diffViewProvider . editType ) . toBe ( "modify" )
257+ expect ( mockCline . editingProvider . editType ) . toBe ( "modify" )
258258 } )
259259
260260 it . skipIf ( process . platform === "win32" ) ( "detects new file and sets editType to create" , async ( ) => {
261261 await executeWriteFileTool ( { } , { fileExists : false } )
262262
263263 expect ( mockedFileExistsAtPath ) . toHaveBeenCalledWith ( absoluteFilePath )
264- expect ( mockCline . diffViewProvider . editType ) . toBe ( "create" )
264+ expect ( mockCline . editingProvider . editType ) . toBe ( "create" )
265265 } )
266266
267267 it ( "uses cached editType without filesystem check" , async ( ) => {
268- mockCline . diffViewProvider . editType = "modify"
268+ mockCline . editingProvider . editType = "modify"
269269
270270 await executeWriteFileTool ( { } )
271271
@@ -277,13 +277,13 @@ describe("writeToFileTool", () => {
277277 it ( "removes markdown code block markers from content" , async ( ) => {
278278 await executeWriteFileTool ( { content : testContentWithMarkdown } )
279279
280- expect ( mockCline . diffViewProvider . update ) . toHaveBeenCalledWith ( "Line 1\nLine 2" , true )
280+ expect ( mockCline . editingProvider . update ) . toHaveBeenCalledWith ( "Line 1\nLine 2" , true )
281281 } )
282282
283283 it ( "passes through empty content unchanged" , async ( ) => {
284284 await executeWriteFileTool ( { content : "" } )
285285
286- expect ( mockCline . diffViewProvider . update ) . toHaveBeenCalledWith ( "" , true )
286+ expect ( mockCline . editingProvider . update ) . toHaveBeenCalledWith ( "" , true )
287287 } )
288288
289289 it ( "unescapes HTML entities for non-Claude models" , async ( ) => {
@@ -311,7 +311,7 @@ describe("writeToFileTool", () => {
311311
312312 expect ( mockedEveryLineHasLineNumbers ) . toHaveBeenCalledWith ( contentWithLineNumbers )
313313 expect ( mockedStripLineNumbers ) . toHaveBeenCalledWith ( contentWithLineNumbers )
314- expect ( mockCline . diffViewProvider . update ) . toHaveBeenCalledWith ( "line one\nline two" , true )
314+ expect ( mockCline . editingProvider . update ) . toHaveBeenCalledWith ( "line one\nline two" , true )
315315 } )
316316 } )
317317
@@ -320,10 +320,10 @@ describe("writeToFileTool", () => {
320320 await executeWriteFileTool ( { } , { fileExists : false } )
321321
322322 expect ( mockCline . consecutiveMistakeCount ) . toBe ( 0 )
323- expect ( mockCline . diffViewProvider . open ) . toHaveBeenCalledWith ( testFilePath , MOCK_VIEW_COLUMN )
324- expect ( mockCline . diffViewProvider . update ) . toHaveBeenCalledWith ( testContent , true )
323+ expect ( mockCline . editingProvider . open ) . toHaveBeenCalledWith ( testFilePath , MOCK_VIEW_COLUMN )
324+ expect ( mockCline . editingProvider . update ) . toHaveBeenCalledWith ( testContent , true )
325325 expect ( mockAskApproval ) . toHaveBeenCalled ( )
326- expect ( mockCline . diffViewProvider . saveChanges ) . toHaveBeenCalled ( )
326+ expect ( mockCline . editingProvider . saveChanges ) . toHaveBeenCalled ( )
327327 expect ( mockCline . fileContextTracker . trackFileContext ) . toHaveBeenCalledWith ( testFilePath , "roo_edited" )
328328 expect ( mockCline . didEditFile ) . toBe ( true )
329329 } )
@@ -348,21 +348,21 @@ describe("writeToFileTool", () => {
348348 it ( "returns early when path is missing in partial block" , async ( ) => {
349349 await executeWriteFileTool ( { path : undefined } , { isPartial : true } )
350350
351- expect ( mockCline . diffViewProvider . open ) . not . toHaveBeenCalled ( )
351+ expect ( mockCline . editingProvider . open ) . not . toHaveBeenCalled ( )
352352 } )
353353
354354 it ( "returns early when content is undefined in partial block" , async ( ) => {
355355 await executeWriteFileTool ( { content : undefined } , { isPartial : true } )
356356
357- expect ( mockCline . diffViewProvider . open ) . not . toHaveBeenCalled ( )
357+ expect ( mockCline . editingProvider . open ) . not . toHaveBeenCalled ( )
358358 } )
359359
360360 it ( "streams content updates during partial execution" , async ( ) => {
361361 await executeWriteFileTool ( { } , { isPartial : true } )
362362
363363 expect ( mockCline . ask ) . toHaveBeenCalled ( )
364- expect ( mockCline . diffViewProvider . open ) . toHaveBeenCalledWith ( testFilePath , MOCK_VIEW_COLUMN )
365- expect ( mockCline . diffViewProvider . update ) . toHaveBeenCalledWith ( testContent , false )
364+ expect ( mockCline . editingProvider . open ) . toHaveBeenCalledWith ( testFilePath , MOCK_VIEW_COLUMN )
365+ expect ( mockCline . editingProvider . update ) . toHaveBeenCalledWith ( testContent , false )
366366 } )
367367 } )
368368
@@ -372,19 +372,19 @@ describe("writeToFileTool", () => {
372372
373373 await executeWriteFileTool ( { } )
374374
375- expect ( mockCline . diffViewProvider . revertChanges ) . toHaveBeenCalled ( )
376- expect ( mockCline . diffViewProvider . saveChanges ) . not . toHaveBeenCalled ( )
375+ expect ( mockCline . editingProvider . revertChanges ) . toHaveBeenCalled ( )
376+ expect ( mockCline . editingProvider . saveChanges ) . not . toHaveBeenCalled ( )
377377 } )
378378
379379 it ( "reports user edits with diff feedback" , async ( ) => {
380380 const userEditsValue = "- old line\n+ new line"
381- mockCline . diffViewProvider . saveChanges . mockResolvedValue ( {
381+ mockCline . editingProvider . saveChanges . mockResolvedValue ( {
382382 newProblemsMessage : " with warnings" ,
383383 userEdits : userEditsValue ,
384384 finalContent : "modified content" ,
385385 } )
386386 // Manually set the property on the mock instance because the original saveChanges is not called
387- mockCline . diffViewProvider . userEdits = userEditsValue
387+ mockCline . editingProvider . userEdits = userEditsValue
388388
389389 await executeWriteFileTool ( { } , { fileExists : true } )
390390
@@ -397,21 +397,21 @@ describe("writeToFileTool", () => {
397397
398398 describe ( "error handling" , ( ) => {
399399 it ( "handles general file operation errors" , async ( ) => {
400- mockCline . diffViewProvider . open . mockRejectedValue ( new Error ( "General error" ) )
400+ mockCline . editingProvider . open . mockRejectedValue ( new Error ( "General error" ) )
401401
402402 await executeWriteFileTool ( { } )
403403
404404 expect ( mockHandleError ) . toHaveBeenCalledWith ( "writing file" , expect . any ( Error ) )
405- expect ( mockCline . diffViewProvider . resetWithListeners ) . toHaveBeenCalled ( )
405+ expect ( mockCline . editingProvider . resetWithListeners ) . toHaveBeenCalled ( )
406406 } )
407407
408408 it ( "handles partial streaming errors" , async ( ) => {
409- mockCline . diffViewProvider . open . mockRejectedValue ( new Error ( "Open failed" ) )
409+ mockCline . editingProvider . open . mockRejectedValue ( new Error ( "Open failed" ) )
410410
411411 await executeWriteFileTool ( { } , { isPartial : true } )
412412
413413 expect ( mockHandleError ) . toHaveBeenCalledWith ( "writing file" , expect . any ( Error ) )
414- expect ( mockCline . diffViewProvider . resetWithListeners ) . toHaveBeenCalled ( )
414+ expect ( mockCline . editingProvider . resetWithListeners ) . toHaveBeenCalled ( )
415415 } )
416416 } )
417417} )
0 commit comments