@@ -48,6 +48,7 @@ export class MultiDiffEditorInput extends EditorInput implements ILanguageSuppor
48
48
resource . modified . resource ,
49
49
) ;
50
50
} ) ,
51
+ input . isTransient ?? false
51
52
) ;
52
53
}
53
54
@@ -59,7 +60,8 @@ export class MultiDiffEditorInput extends EditorInput implements ILanguageSuppor
59
60
data . resources ?. map ( resource => new MultiDiffEditorItem (
60
61
resource . originalUri ? URI . parse ( resource . originalUri ) : undefined ,
61
62
resource . modifiedUri ? URI . parse ( resource . modifiedUri ) : undefined ,
62
- ) )
63
+ ) ) ,
64
+ false
63
65
) ;
64
66
}
65
67
@@ -80,6 +82,7 @@ export class MultiDiffEditorInput extends EditorInput implements ILanguageSuppor
80
82
public readonly multiDiffSource : URI ,
81
83
public readonly label : string | undefined ,
82
84
public readonly initialResources : readonly MultiDiffEditorItem [ ] | undefined ,
85
+ public readonly isTransient : boolean = false ,
83
86
@ITextModelService private readonly _textModelService : ITextModelService ,
84
87
@ITextResourceConfigurationService private readonly _textResourceConfigurationService : ITextResourceConfigurationService ,
85
88
@IInstantiationService private readonly _instantiationService : IInstantiationService ,
@@ -360,12 +363,15 @@ interface ISerializedMultiDiffEditorInput {
360
363
}
361
364
362
365
export class MultiDiffEditorSerializer implements IEditorSerializer {
366
+
367
+ // TODO@bpasero , @aiday-mar: following canSerialize should be removed (debt item)
363
368
canSerialize ( editor : EditorInput ) : boolean {
364
- return editor instanceof MultiDiffEditorInput ;
369
+ return editor instanceof MultiDiffEditorInput && ! editor . isTransient ;
365
370
}
366
371
367
372
serialize ( editor : MultiDiffEditorInput ) : string | undefined {
368
- return JSON . stringify ( editor . serialize ( ) ) ;
373
+ const shouldSerialize = editor instanceof MultiDiffEditorInput && ! editor . isTransient ;
374
+ return shouldSerialize ? JSON . stringify ( editor . serialize ( ) ) : undefined ;
369
375
}
370
376
371
377
deserialize ( instantiationService : IInstantiationService , serializedEditor : string ) : EditorInput | undefined {
0 commit comments