提交 95f24e58 编写于 作者: S Sandeep Somavarapu

fix #12353

上级 5e6580aa
......@@ -34,7 +34,7 @@ import { ActionProvider } from 'vs/workbench/parts/markers/browser/markersAction
import { CollapseAllAction, FilterAction, FilterInputBoxActionItem } from 'vs/workbench/parts/markers/browser/markersPanelActions';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import Messages from 'vs/workbench/parts/markers/common/messages';
import { RangeHighlightDecorations, IRangeHighlightDecoration } from 'vs/workbench/common/editor/rangeDecorations';
import { RangeHighlightDecorations } from 'vs/workbench/common/editor/rangeDecorations';
export class MarkersPanel extends Panel {
......@@ -327,7 +327,8 @@ export class MarkersPanel extends Panel {
private highlightCurrentSelectedMarkerRange() {
let selections = this.tree.getSelection();
if (selections && selections.length === 1 && selections[0] instanceof Marker) {
this.rangeHighlightDecorations.highlightRange(<IRangeHighlightDecoration>selections[0]);
const marker: Marker = selections[0];
this.rangeHighlightDecorations.highlightRange(marker);
}
}
......
......@@ -12,7 +12,6 @@ import treedefaults = require('vs/base/parts/tree/browser/treeDefaults');
import { MarkersModel, Marker } from 'vs/workbench/parts/markers/common/markersModel';
import { RangeHighlightDecorations } from 'vs/workbench/common/editor/rangeDecorations';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IMarker } from 'vs/platform/markers/common/markers';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
export class Controller extends treedefaults.DefaultController {
......@@ -60,24 +59,19 @@ export class Controller extends treedefaults.DefaultController {
private openFileAtElement(element: any, preserveFocus: boolean, sideByside: boolean, pinned: boolean): boolean {
if (element instanceof Marker) {
this.telemetryService.publicLog('problems.marker.opened', { source: element.source });
let marker = <IMarker>element.marker;
const marker: Marker = element;
this.telemetryService.publicLog('problems.marker.opened', { source: marker.marker.source });
this.editorService.openEditor({
resource: marker.resource,
options: {
selection: {
startLineNumber: marker.startLineNumber,
startColumn: marker.startColumn,
endLineNumber: marker.endLineNumber,
endColumn: marker.endColumn
},
selection: marker.range,
preserveFocus,
pinned,
revealIfVisible: true
},
}, sideByside).done((editor) => {
if (preserveFocus) {
this.rangeHighlightDecorations.highlightRange(element, editor);
this.rangeHighlightDecorations.highlightRange(marker, editor);
} else {
this.rangeHighlightDecorations.removeHighlightRange();
}
......
......@@ -9,6 +9,7 @@ import * as types from 'vs/base/common/types';
import * as Map from 'vs/base/common/map';
import Severity from 'vs/base/common/severity';
import URI from 'vs/base/common/uri';
import { IRange } from 'vs/editor/common/editorCommon';
import { Range } from 'vs/editor/common/core/range';
import { IMarker, MarkerStatistics } from 'vs/platform/markers/common/markers';
import {IFilter, IMatch, or, matchesContiguousSubString, matchesPrefix, matchesFuzzy} from 'vs/base/common/filters';
......@@ -52,6 +53,10 @@ export class Marker {
public get resource(): URI {
return this.marker.resource;
}
public get range(): IRange {
return this.marker;
}
}
export class FilterOptions {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册