@@ -52,6 +52,7 @@ import { withNullAsUndefined } from 'vs/base/common/types';
52
52
import { URI } from 'vs/base/common/uri' ;
53
53
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity' ;
54
54
import { isLinux , isNative , isWindows } from 'vs/base/common/platform' ;
55
+ import { ILogService } from 'vs/platform/log/common/log' ;
55
56
56
57
export class EditorGroupView extends Themable implements IEditorGroupView {
57
58
@@ -145,7 +146,8 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
145
146
@IFileDialogService private readonly fileDialogService : IFileDialogService ,
146
147
@IEditorService private readonly editorService : EditorServiceImpl ,
147
148
@IFilesConfigurationService private readonly filesConfigurationService : IFilesConfigurationService ,
148
- @IUriIdentityService private readonly uriIdentityService : IUriIdentityService
149
+ @IUriIdentityService private readonly uriIdentityService : IUriIdentityService ,
150
+ @ILogService private readonly logService : ILogService
149
151
) {
150
152
super ( themeService ) ;
151
153
@@ -1600,10 +1602,13 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
1600
1602
1601
1603
return editor . isDirty ( ) ; // veto if still dirty
1602
1604
} catch ( error ) {
1605
+ this . logService . error ( error ) ;
1606
+
1603
1607
// if that fails, since we are about to close the editor, we accept that
1604
1608
// the editor cannot be reverted and instead do a soft revert that just
1605
1609
// enables us to close the editor. With this, a user can always close a
1606
1610
// dirty editor even when reverting fails.
1611
+
1607
1612
await editor . revert ( this . id , { soft : true } ) ;
1608
1613
1609
1614
return editor . isDirty ( ) ; // veto if still dirty
0 commit comments