@@ -50,6 +50,7 @@ import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/c
5050import { MarkersContextKeys , MarkersViewMode } from 'vs/workbench/contrib/markers/common/markers' ;
5151import { unsupportedSchemas } from 'vs/platform/markers/common/markerService' ;
5252import { defaultCountBadgeStyles } from 'vs/platform/theme/browser/defaultStyles' ;
53+ import Severity from 'vs/base/common/severity' ;
5354
5455interface IResourceMarkersTemplateData {
5556 readonly resourceLabel : IResourceLabel ;
@@ -270,6 +271,7 @@ class MarkerWidget extends Disposable {
270271
271272 private readonly actionBar : ActionBar ;
272273 private readonly icon : HTMLElement ;
274+ private readonly iconContainer : HTMLElement ;
273275 private readonly messageAndDetailsContainer : HTMLElement ;
274276 private readonly disposables = this . _register ( new DisposableStore ( ) ) ;
275277
@@ -283,7 +285,12 @@ class MarkerWidget extends Disposable {
283285 this . actionBar = this . _register ( new ActionBar ( dom . append ( parent , dom . $ ( '.actions' ) ) , {
284286 actionViewItemProvider : ( action : IAction ) => action . id === QuickFixAction . ID ? _instantiationService . createInstance ( QuickFixActionViewItem , < QuickFixAction > action ) : undefined
285287 } ) ) ;
286- this . icon = dom . append ( parent , dom . $ ( '' ) ) ;
288+
289+ // wrap the icon in a container that get the icon color as foreground color. That way, if the
290+ // list view does not have a specific color for the icon (=the color variable is invalid) it
291+ // falls back to the foreground color of container (inherit)
292+ this . iconContainer = dom . append ( parent , dom . $ ( '' ) ) ;
293+ this . icon = dom . append ( this . iconContainer , dom . $ ( '' ) ) ;
287294 this . messageAndDetailsContainer = dom . append ( parent , dom . $ ( '.marker-message-details-container' ) ) ;
288295 }
289296
@@ -292,7 +299,8 @@ class MarkerWidget extends Disposable {
292299 this . disposables . clear ( ) ;
293300 dom . clearNode ( this . messageAndDetailsContainer ) ;
294301
295- this . icon . className = `marker-icon codicon ${ SeverityIcon . className ( MarkerSeverity . toSeverity ( element . marker . severity ) ) } ` ;
302+ this . iconContainer . className = `marker-icon ${ Severity . toString ( MarkerSeverity . toSeverity ( element . marker . severity ) ) } ` ;
303+ this . icon . className = `codicon ${ SeverityIcon . className ( MarkerSeverity . toSeverity ( element . marker . severity ) ) } ` ;
296304 this . renderQuickfixActionbar ( element ) ;
297305
298306 this . renderMessageAndDetails ( element , filterData ) ;
0 commit comments