Simplify eventing

This commit is contained in:
Alex Dima
2017-04-18 10:59:24 +03:00
parent 9079b0ebee
commit 946ac52e59
17 changed files with 277 additions and 342 deletions

View File

@@ -9,7 +9,7 @@ import { ISearchService, QueryType } from 'vs/platform/search/common/search';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
import { ICommonCodeEditor } from 'vs/editor/common/editorCommon';
import { ICommonCodeEditor, isCommonCodeEditor } from 'vs/editor/common/editorCommon';
import { bulkEdit, IResourceEdit } from 'vs/editor/common/services/bulkEdit';
import { TPromise } from 'vs/base/common/winjs.base';
import { Uri } from 'vscode';
@@ -94,9 +94,8 @@ export class MainThreadWorkspace extends MainThreadWorkspaceShape {
let codeEditor: ICommonCodeEditor;
let editor = this._editorService.getActiveEditor();
if (editor) {
let candidate = <ICommonCodeEditor>editor.getControl();
if (typeof candidate.getEditorType === 'function') {
// enough proof
let candidate = editor.getControl();
if (isCommonCodeEditor(candidate)) {
codeEditor = candidate;
}
}