@@ -48,6 +48,7 @@ export class MultiDiffEditorInput extends EditorInput implements ILanguageSuppor
4848 resource . modified . resource ,
4949 ) ;
5050 } ) ,
51+ input . isTransient ?? false
5152 ) ;
5253 }
5354
@@ -59,7 +60,8 @@ export class MultiDiffEditorInput extends EditorInput implements ILanguageSuppor
5960 data . resources ?. map ( resource => new MultiDiffEditorItem (
6061 resource . originalUri ? URI . parse ( resource . originalUri ) : undefined ,
6162 resource . modifiedUri ? URI . parse ( resource . modifiedUri ) : undefined ,
62- ) )
63+ ) ) ,
64+ false
6365 ) ;
6466 }
6567
@@ -80,6 +82,7 @@ export class MultiDiffEditorInput extends EditorInput implements ILanguageSuppor
8082 public readonly multiDiffSource : URI ,
8183 public readonly label : string | undefined ,
8284 public readonly initialResources : readonly MultiDiffEditorItem [ ] | undefined ,
85+ public readonly isTransient : boolean = false ,
8386 @ITextModelService private readonly _textModelService : ITextModelService ,
8487 @ITextResourceConfigurationService private readonly _textResourceConfigurationService : ITextResourceConfigurationService ,
8588 @IInstantiationService private readonly _instantiationService : IInstantiationService ,
@@ -360,12 +363,15 @@ interface ISerializedMultiDiffEditorInput {
360363}
361364
362365export class MultiDiffEditorSerializer implements IEditorSerializer {
366+
367+ // TODO@bpasero , @aiday-mar: following canSerialize should be removed (debt item)
363368 canSerialize ( editor : EditorInput ) : boolean {
364- return editor instanceof MultiDiffEditorInput ;
369+ return editor instanceof MultiDiffEditorInput && ! editor . isTransient ;
365370 }
366371
367372 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 ;
369375 }
370376
371377 deserialize ( instantiationService : IInstantiationService , serializedEditor : string ) : EditorInput | undefined {
0 commit comments