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

fix #12353

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