提交 3375a6d9 编写于 作者: B Benjamin Pasero

clean up rangedecorations

上级 50b5d428
......@@ -3,13 +3,13 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IDisposable } from 'vs/base/common/lifecycle';
import {IDisposable} from 'vs/base/common/lifecycle';
import URI from 'vs/base/common/uri';
import { Range } from 'vs/editor/common/core/range';
import {Range} from 'vs/editor/common/core/range';
import * as editorCommon from 'vs/editor/common/editorCommon';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IEditor } from 'vs/platform/editor/common/editor';
import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput';
import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService';
import {IEditor} from 'vs/platform/editor/common/editor';
import {asFileEditorInput} from 'vs/workbench/common/editor';
export interface IRangeHighlightDecoration {
resource: URI;
......@@ -48,8 +48,8 @@ export class RangeHighlightDecorations implements IDisposable {
}
private getEditor(resourceRange: IRangeHighlightDecoration): IEditor {
let editorInput = this.editorService.getActiveEditorInput();
if (editorInput instanceof FileEditorInput) {
const editorInput = asFileEditorInput(this.editorService.getActiveEditorInput());
if (editorInput) {
if (editorInput.getResource().fsPath === resourceRange.resource.fsPath) {
return this.editorService.getActiveEditor();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册