@@ -90,7 +90,7 @@ export interface IProblemsWidget {
90
90
reset ( resourceMarkers : ResourceMarkers [ ] ) : void ;
91
91
revealMarkers ( activeResource : ResourceMarkers | null , focus : boolean , lastSelectedRelativeTop : number ) : void ;
92
92
setAriaLabel ( label : string ) : void ;
93
- setMarkerSelection ( marker ?: Marker ) : void ;
93
+ setMarkerSelection ( selection ?: Marker [ ] , focus ?: Marker [ ] ) : void ;
94
94
toggleVisibility ( hide : boolean ) : void ;
95
95
update ( resourceMarkers : ResourceMarkers [ ] ) : void ;
96
96
updateMarker ( marker : Marker ) : void ;
@@ -451,7 +451,7 @@ export class MarkersView extends ViewPane implements IMarkersView {
451
451
accessibilityProvider : this . widgetAccessibilityProvider ,
452
452
horizontalScrolling : false ,
453
453
identityProvider : this . widgetIdentityProvider ,
454
- multipleSelectionSupport : false ,
454
+ multipleSelectionSupport : true ,
455
455
selectionNavigation : true
456
456
} ,
457
457
) ;
@@ -599,16 +599,31 @@ export class MarkersView extends ViewPane implements IMarkersView {
599
599
}
600
600
601
601
// Save selection
602
- const selection = this . widget ?. getSelection ( ) ;
602
+ const selection = new Set < Marker > ( ) ;
603
+ for ( const marker of this . widget . getSelection ( ) ) {
604
+ if ( marker instanceof ResourceMarkers ) {
605
+ marker . markers . forEach ( m => selection . add ( m ) ) ;
606
+ } else if ( marker instanceof Marker || marker instanceof MarkerTableItem ) {
607
+ selection . add ( marker ) ;
608
+ }
609
+ }
610
+
611
+ // Save focus
612
+ const focus = new Set < Marker > ( ) ;
613
+ for ( const marker of this . widget . getFocus ( ) ) {
614
+ if ( marker instanceof Marker || marker instanceof MarkerTableItem ) {
615
+ focus . add ( marker ) ;
616
+ }
617
+ }
603
618
604
619
// Create new widget
605
620
this . createWidget ( this . widgetContainer ) ;
606
621
this . refreshPanel ( ) ;
607
622
608
623
// Restore selection
609
- if ( selection && selection . length > 0 && ( selection [ 0 ] instanceof Marker || selection [ 0 ] instanceof MarkerTableItem ) ) {
624
+ if ( selection . size > 0 ) {
625
+ this . widget . setMarkerSelection ( Array . from ( selection ) , Array . from ( focus ) ) ;
610
626
this . widget . domFocus ( ) ;
611
- this . widget . setMarkerSelection ( selection [ 0 ] ) ;
612
627
}
613
628
}
614
629
@@ -982,14 +997,15 @@ class MarkersTree extends WorkbenchObjectTree<MarkerElement, FilterData> impleme
982
997
this . ariaLabel = label ;
983
998
}
984
999
985
- setMarkerSelection ( marker : Marker ) : void {
1000
+ setMarkerSelection ( selection ? : Marker [ ] , focus ?: Marker [ ] ) : void {
986
1001
if ( this . isVisible ( ) ) {
987
- if ( marker ) {
988
- const markerNode = this . findMarkerNode ( marker ) ;
1002
+ if ( selection && selection . length > 0 ) {
1003
+ this . setSelection ( selection . map ( m => this . findMarkerNode ( m ) ) ) ;
989
1004
990
- if ( markerNode ) {
991
- this . setFocus ( [ markerNode ] ) ;
992
- this . setSelection ( [ markerNode ] ) ;
1005
+ if ( focus && focus . length > 0 ) {
1006
+ this . setFocus ( focus . map ( f => this . findMarkerNode ( f ) ) ) ;
1007
+ } else {
1008
+ this . setFocus ( [ this . findMarkerNode ( selection [ 0 ] ) ] ) ;
993
1009
}
994
1010
} else if ( this . getSelection ( ) . length === 0 ) {
995
1011
const firstVisibleElement = this . firstVisibleElement ;
@@ -1026,7 +1042,7 @@ class MarkersTree extends WorkbenchObjectTree<MarkerElement, FilterData> impleme
1026
1042
}
1027
1043
}
1028
1044
1029
- return undefined ;
1045
+ return null ;
1030
1046
}
1031
1047
1032
1048
private hasSelectedMarkerFor ( resource : ResourceMarkers ) : boolean {
0 commit comments