Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/vscode.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Pasero <benjpas@microsoft.com>2020-05-29 11:17:04 +0300
committerBenjamin Pasero <benjpas@microsoft.com>2020-05-29 11:17:09 +0300
commitfc9c3f109de64a55507dd263c335d09b38652681 (patch)
tree2e73543b11706413e1f7fbda0b378ae629ae0c0c
parent464f3de63c439ecbeffde58b0a36326f995528f5 (diff)
editors - lift onDidCloseEditor to service interface
-rw-r--r--src/vs/workbench/browser/parts/editor/editor.ts5
-rw-r--r--src/vs/workbench/contrib/customEditor/browser/customEditors.ts3
-rw-r--r--src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts9
-rw-r--r--src/vs/workbench/electron-browser/window.ts3
-rw-r--r--src/vs/workbench/services/editor/browser/editorService.ts1
-rw-r--r--src/vs/workbench/services/editor/common/editorService.ts7
6 files changed, 13 insertions, 15 deletions
diff --git a/src/vs/workbench/browser/parts/editor/editor.ts b/src/vs/workbench/browser/parts/editor/editor.ts
index 50ba6bcb269..8f9eba46ccb 100644
--- a/src/vs/workbench/browser/parts/editor/editor.ts
+++ b/src/vs/workbench/browser/parts/editor/editor.ts
@@ -166,11 +166,6 @@ export function getActiveTextEditorOptions(group: IEditorGroup, expectedActiveEd
export interface EditorServiceImpl extends IEditorService {
/**
- * Emitted when an editor is closed.
- */
- readonly onDidCloseEditor: Event<IEditorCloseEvent>;
-
- /**
* Emitted when an editor failed to open.
*/
readonly onDidOpenEditorFail: Event<IEditorIdentifier>;
diff --git a/src/vs/workbench/contrib/customEditor/browser/customEditors.ts b/src/vs/workbench/contrib/customEditor/browser/customEditors.ts
index 421b2241d22..28a83664a79 100644
--- a/src/vs/workbench/contrib/customEditor/browser/customEditors.ts
+++ b/src/vs/workbench/contrib/customEditor/browser/customEditors.ts
@@ -20,7 +20,6 @@ import { IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/commo
import { IStorageService } from 'vs/platform/storage/common/storage';
import * as colorRegistry from 'vs/platform/theme/common/colorRegistry';
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
-import { EditorServiceImpl } from 'vs/workbench/browser/parts/editor/editor';
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
import { EditorInput, EditorOptions, GroupIdentifier, IEditorInput, IEditorPane } from 'vs/workbench/common/editor';
import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput';
@@ -422,7 +421,7 @@ export class CustomEditorService extends Disposable implements ICustomEditorServ
export class CustomEditorContribution extends Disposable implements IWorkbenchContribution {
constructor(
- @IEditorService private readonly editorService: EditorServiceImpl,
+ @IEditorService private readonly editorService: IEditorService,
@ICustomEditorService private readonly customEditorService: ICustomEditorService,
) {
super();
diff --git a/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts b/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts
index b51074310b4..76599aff1c4 100644
--- a/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts
+++ b/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts
@@ -36,6 +36,9 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
import { CustomEditorsAssociations, customEditorsAssociationsSettingId } from 'vs/workbench/services/editor/common/editorAssociationsSetting';
import { coalesce, distinct } from 'vs/base/common/arrays';
import { CustomEditorInfo } from 'vs/workbench/contrib/customEditor/common/customEditor';
+import { NotebookEditorOptions } from 'vs/workbench/contrib/notebook/browser/notebookEditorWidget';
+import { INotebookEditor } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
+import { IUndoRedoService } from 'vs/platform/undoRedo/common/undoRedo';
// Editor Contribution
@@ -52,10 +55,6 @@ import 'vs/workbench/contrib/notebook/browser/contrib/status/editorStatus';
import 'vs/workbench/contrib/notebook/browser/view/output/transforms/streamTransform';
import 'vs/workbench/contrib/notebook/browser/view/output/transforms/errorTransform';
import 'vs/workbench/contrib/notebook/browser/view/output/transforms/richTransform';
-import { NotebookEditorOptions } from 'vs/workbench/contrib/notebook/browser/notebookEditorWidget';
-import { EditorServiceImpl } from 'vs/workbench/browser/parts/editor/editor';
-import { INotebookEditor } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
-import { IUndoRedoService } from 'vs/platform/undoRedo/common/undoRedo';
/*--------------------------------------------------------------------------------------------- */
@@ -116,7 +115,7 @@ export class NotebookContribution extends Disposable implements IWorkbenchContri
private _resourceMapping = new ResourceMap<NotebookEditorInput>();
constructor(
- @IEditorService private readonly editorService: EditorServiceImpl,
+ @IEditorService private readonly editorService: IEditorService,
@INotebookService private readonly notebookService: INotebookService,
@IInstantiationService private readonly instantiationService: IInstantiationService,
@IConfigurationService private readonly configurationService: IConfigurationService,
diff --git a/src/vs/workbench/electron-browser/window.ts b/src/vs/workbench/electron-browser/window.ts
index d175381aca2..ca6880ab3ad 100644
--- a/src/vs/workbench/electron-browser/window.ts
+++ b/src/vs/workbench/electron-browser/window.ts
@@ -36,7 +36,6 @@ import { IIntegrityService } from 'vs/workbench/services/integrity/common/integr
import { isRootUser, isWindows, isMacintosh, isLinux } from 'vs/base/common/platform';
import product from 'vs/platform/product/common/product';
import { INotificationService } from 'vs/platform/notification/common/notification';
-import { EditorServiceImpl } from 'vs/workbench/browser/parts/editor/editor';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
import { IAccessibilityService, AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';
@@ -84,7 +83,7 @@ export class NativeWindow extends Disposable {
private isDocumentedEdited = false;
constructor(
- @IEditorService private readonly editorService: EditorServiceImpl,
+ @IEditorService private readonly editorService: IEditorService,
@IConfigurationService private readonly configurationService: IConfigurationService,
@ITitleService private readonly titleService: ITitleService,
@IWorkbenchThemeService protected themeService: IWorkbenchThemeService,
diff --git a/src/vs/workbench/services/editor/browser/editorService.ts b/src/vs/workbench/services/editor/browser/editorService.ts
index 4f29767181a..0bf83aaa84e 100644
--- a/src/vs/workbench/services/editor/browser/editorService.ts
+++ b/src/vs/workbench/services/editor/browser/editorService.ts
@@ -1278,6 +1278,7 @@ export class DelegatingEditorService implements IEditorService {
get onDidActiveEditorChange(): Event<void> { return this.editorService.onDidActiveEditorChange; }
get onDidVisibleEditorsChange(): Event<void> { return this.editorService.onDidVisibleEditorsChange; }
+ get onDidCloseEditor(): Event<IEditorCloseEvent> { return this.editorService.onDidCloseEditor; }
get activeEditor(): IEditorInput | undefined { return this.editorService.activeEditor; }
get activeEditorPane(): IVisibleEditorPane | undefined { return this.editorService.activeEditorPane; }
diff --git a/src/vs/workbench/services/editor/common/editorService.ts b/src/vs/workbench/services/editor/common/editorService.ts
index de14e714908..8a83415835c 100644
--- a/src/vs/workbench/services/editor/common/editorService.ts
+++ b/src/vs/workbench/services/editor/common/editorService.ts
@@ -5,7 +5,7 @@
import { createDecorator, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { IResourceEditorInput, IEditorOptions, ITextEditorOptions } from 'vs/platform/editor/common/editor';
-import { IEditorInput, IEditorPane, GroupIdentifier, IEditorInputWithOptions, IUntitledTextResourceEditorInput, IResourceDiffEditorInput, ITextEditorPane, ITextDiffEditorPane, IEditorIdentifier, ISaveOptions, IRevertOptions, EditorsOrder, IVisibleEditorPane } from 'vs/workbench/common/editor';
+import { IEditorInput, IEditorPane, GroupIdentifier, IEditorInputWithOptions, IUntitledTextResourceEditorInput, IResourceDiffEditorInput, ITextEditorPane, ITextDiffEditorPane, IEditorIdentifier, ISaveOptions, IRevertOptions, EditorsOrder, IVisibleEditorPane, IEditorCloseEvent } from 'vs/workbench/common/editor';
import { Event } from 'vs/base/common/event';
import { IEditor, IDiffEditor } from 'vs/editor/common/editorCommon';
import { IEditorGroup, IEditorReplacement } from 'vs/workbench/services/editor/common/editorGroupsService';
@@ -104,6 +104,11 @@ export interface IEditorService {
readonly onDidVisibleEditorsChange: Event<void>;
/**
+ * Emitted when an editor is closed.
+ */
+ readonly onDidCloseEditor: Event<IEditorCloseEvent>;
+
+ /**
* The currently active editor pane or `undefined` if none. The editor pane is
* the workbench container for editors of any kind.
*