提交 181ab9f3 编写于 作者: M Matt Bierner

Strict null work on editorService

上级 d3f079fd
......@@ -760,9 +760,9 @@ export class TextEditorOptions extends EditorOptions {
private revealInCenterIfOutsideViewport: boolean;
private editorViewState: IEditorViewState | null;
static from(input?: IBaseResourceInput): TextEditorOptions | null {
static from(input?: IBaseResourceInput): TextEditorOptions | undefined {
if (!input || !input.options) {
return null;
return undefined;
}
return TextEditorOptions.create(input.options);
......
......@@ -377,7 +377,7 @@ export class EditorService extends Disposable implements EditorServiceImpl {
//#region getOpend()
getOpened(editor: IResourceInput | IUntitledResourceInput, group?: IEditorGroup | GroupIdentifier): IEditorInput {
getOpened(editor: IResourceInput | IUntitledResourceInput, group?: IEditorGroup | GroupIdentifier): IEditorInput | undefined {
return this.doGetOpened(editor);
}
......@@ -626,7 +626,7 @@ export class DelegatingEditorService extends EditorService {
this.editorOpenHandler = handler;
}
protected doOpenEditor(group: IEditorGroup, editor: IEditorInput, options?: IEditorOptions): Promise<IEditor> {
protected doOpenEditor(group: IEditorGroup, editor: IEditorInput, options?: IEditorOptions): Promise<IEditor | null> {
if (!this.editorOpenHandler) {
return super.doOpenEditor(group, editor, options);
}
......
......@@ -166,7 +166,7 @@ export interface IEditorService {
*
* @param group optional to specify a group to check for the editor
*/
getOpened(editor: IResourceInput | IUntitledResourceInput, group?: IEditorGroup | GroupIdentifier): IEditorInput;
getOpened(editor: IResourceInput | IUntitledResourceInput, group?: IEditorGroup | GroupIdentifier): IEditorInput | undefined;
/**
* Allows to override the opening of editors by installing a handler that will
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册