提交 e0ff35f6 编写于 作者: M Matt Bierner

Strict null fixes for IEditorOpenHandler

上级 2c70b5d5
......@@ -30,7 +30,7 @@ import { DelegatingEditorService } from 'vs/workbench/services/editor/browser/ed
import { IEditorGroup, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IEditorOptions } from 'vs/platform/editor/common/editor';
import { IEditorInput } from 'vs/workbench/common/editor';
import { IEditorInput, IEditor } from 'vs/workbench/common/editor';
import { ViewletPanel } from 'vs/workbench/browser/parts/views/panelViewlet';
import { KeyChord, KeyMod, KeyCode } from 'vs/base/common/keyCodes';
import { Registry } from 'vs/platform/registry/common/platform';
......@@ -183,7 +183,7 @@ export class ExplorerViewlet extends ViewContainerViewlet {
// We try to be smart and only use the delay if we recognize that the user action is likely to cause
// a new entry in the opened editors view.
const delegatingEditorService = this.instantiationService.createInstance(DelegatingEditorService);
delegatingEditorService.setEditorOpenHandler((group: IEditorGroup, editor: IEditorInput, options?: IEditorOptions) => {
delegatingEditorService.setEditorOpenHandler((group: IEditorGroup, editor: IEditorInput, options?: IEditorOptions): Promise<IEditor | null> => {
let openEditorsView = this.getOpenEditorsView();
if (openEditorsView) {
let delay = 0;
......@@ -199,8 +199,8 @@ export class ExplorerViewlet extends ViewContainerViewlet {
openEditorsView.setStructuralRefreshDelay(delay);
}
const onSuccessOrError = (editor?: BaseEditor) => {
let openEditorsView = this.getOpenEditorsView();
const onSuccessOrError = (editor: BaseEditor | null) => {
const openEditorsView = this.getOpenEditorsView();
if (openEditorsView) {
openEditorsView.setStructuralRefreshDelay(0);
}
......
......@@ -596,7 +596,7 @@ export class EditorService extends Disposable implements EditorServiceImpl {
}
export interface IEditorOpenHandler {
(group: IEditorGroup, editor: IEditorInput, options?: IEditorOptions | ITextEditorOptions): Promise<IEditor>;
(group: IEditorGroup, editor: IEditorInput, options?: IEditorOptions | ITextEditorOptions): Promise<IEditor | null>;
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册