提交 8b2ec5a1 编写于 作者: S Sandeep Somavarapu

Fix #69418

上级 6a9c0580
......@@ -293,6 +293,8 @@ export class MarkersFilterActionItem extends BaseActionItem {
export class QuickFixAction extends Action {
public static readonly ID: string = 'workbench.actions.problems.quickfix';
private static readonly CLASS: string = 'markers-panel-action-quickfix';
private static readonly AUTO_FIX_CLASS: string = QuickFixAction.CLASS + ' autofixable';
private disposables: IDisposable[] = [];
......@@ -308,11 +310,14 @@ export class QuickFixAction extends Action {
this.enabled = this._quickFixes.length > 0;
}
autoFixable(autofixable: boolean) {
this.class = autofixable ? QuickFixAction.AUTO_FIX_CLASS : QuickFixAction.CLASS;
}
constructor(
readonly marker: Marker,
) {
super(QuickFixAction.ID, Messages.MARKERS_PANEL_ACTION_TOOLTIP_QUICKFIX, 'markers-panel-action-quickfix', false);
super(QuickFixAction.ID, Messages.MARKERS_PANEL_ACTION_TOOLTIP_QUICKFIX, QuickFixAction.CLASS, false);
}
run(): Promise<void> {
......
......@@ -548,8 +548,9 @@ export class MarkerViewModel extends Disposable {
}
private async setQuickFixes(waitForModel: boolean): Promise<void> {
const quickFixes = await this.getQuickFixes(waitForModel);
this.quickFixAction.quickFixes = quickFixes;
const codeActions = await this.getCodeActions(waitForModel);
this.quickFixAction.quickFixes = codeActions ? this.toActions(codeActions) : [];
this.quickFixAction.autoFixable(!!codeActions && codeActions.some(fix => !!fix.kind && CodeActionKind.QuickFix.contains(new CodeActionKind(fix.kind)) && !!fix.isPreferred));
}
private getCodeActions(waitForModel: boolean): Promise<CodeAction[] | null> {
......
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.001 4.2C12.601 2.1 10.301 0 8.801 0H6.201C5.801 0 5.601 0.2 5.601 0.2C3.501 0.8 2.001 2.7 2.001 4.9C2.001 5.4 1.901 7.2 3.701 8.7C4.201 9.2 4.901 10.7 5.001 11.1V14.4L6.601 16H8.601L10.101 14.4V11C10.201 10.6 10.901 9.1 11.401 8.7C12.501 7.8 12.901 6.8 13.001 6V4.2Z" fill="#1E1E1E"/>
<path d="M6.00098 12H9.00098V13H6.00098V12ZM7.00098 15H8.10098L9.00098 14H6.00098L7.00098 15Z" fill="#C5C5C5"/>
<path d="M12.1011 4.9999C12.1011 2.6999 10.3011 0.899902 8.00107 0.899902C7.90107 0.899902 6.60107 0.999902 6.60107 0.999902C4.50107 1.2999 2.90107 2.9999 2.90107 4.9999C2.90107 5.0999 2.70107 6.5999 4.30107 7.9999C5.00107 8.6999 5.80107 10.3999 5.90107 10.8999L6.00107 10.9999H9.00107L9.10107 10.7999C9.20107 10.2999 10.0011 8.5999 10.7011 7.8999C12.3011 6.5999 12.1011 5.0999 12.1011 4.9999V4.9999ZM9.10107 5.9999L8.60107 8.9999H8.00107V5.9999C9.10107 5.9999 8.90107 4.9999 8.90107 4.9999H6.00107V5.0999C6.00107 5.2999 6.10107 5.9999 7.00107 5.9999V8.9999H6.50107L6.30107 8.2999L6.00107 5.9999C5.30107 5.9999 5.10107 5.5999 5.00107 5.2999V4.8999C5.00107 4.0999 5.90107 3.9999 5.90107 3.9999H9.00107C9.00107 3.9999 10.0011 4.0999 10.0011 4.9999C10.0011 4.9999 10.1011 5.9999 9.10107 5.9999Z" fill="#DDB204"/>
<path d="M10.001 5C10.001 4.1 9.00098 4 9.00098 4H5.90098C5.90098 4 5.00098 4.1 5.00098 4.9V5.3C5.00098 5.6 5.30098 6 5.90098 6L6.30098 8.3L6.50098 9H7.00098V6C6.00098 6 6.00098 5.3 6.00098 5.1V5H9.00098C9.00098 5 9.10098 6 8.10098 6V9H8.70098L9.20098 6C10.101 6 10.001 5 10.001 5Z" fill="#252526"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M8 12C8 9.77386 9.77386 8 12 8C14.2261 8 16 9.77386 16 12C16 14.2261 14.2261 16 12 16C9.77386 16 8 14.2261 8 12Z" fill="#1E1E1E"/>
<path d="M12.3192 12.3031L13.3495 13.3334L13.3334 13.3495L12.3031 12.3192L12 12.0162L11.697 12.3192L10.6667 13.3495L10.6506 13.3334L11.6809 12.3031L11.9839 12L11.6809 11.697L10.6506 10.6667L10.6667 10.6506L11.697 11.6809L12 11.9839L12.3031 11.6809L13.3334 10.6506L13.3495 10.6667L12.3192 11.697L12.0162 12L12.3192 12.3031ZM12 8.46034C10.03 8.46034 8.46034 10.03 8.46034 12C8.46034 13.9701 10.03 15.5397 12 15.5397C13.9701 15.5397 15.5397 13.9701 15.5397 12C15.5397 10.03 13.9701 8.46034 12 8.46034Z" fill="#007ACC" stroke="#1E1E1E" stroke-width="0.857143"/>
<path d="M12.6225 12.0002L13.9558 13.3336L13.3336 13.9558L12.0002 12.6225L10.6669 13.9558L10.0447 13.3336L11.378 12.0002L10.0447 10.6669L10.6669 10.0447L12.0002 11.378L13.3336 10.0447L13.9558 10.6669L12.6225 12.0002Z" fill="#007ACC"/>
<path d="M10.704 14L11.2028 12.4712L10 11.6394H11.4732L12 10L12.5361 11.6394H14L12.7972 12.4712L13.3054 14L12 13.024L10.704 14Z" fill="white"/>
</svg>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.001 4.2C12.601 2.1 10.301 0 8.801 0H6.201C5.801 0 5.601 0.2 5.601 0.2C3.501 0.8 2.001 2.7 2.001 4.9C2.001 5.4 1.901 7.2 3.701 8.7C4.201 9.2 4.901 10.7 5.001 11.1V14.4L6.601 16H8.601L10.101 14.4V11C10.201 10.6 10.901 9.1 11.401 8.7C12.501 7.8 12.901 6.8 13.001 6V4.2Z" fill="#F6F6F6"/>
<path d="M6.00098 12H9.00098V13H6.00098V12ZM7.00098 15H8.10098L9.00098 14H6.00098L7.00098 15Z" fill="#848484"/>
<path d="M12.1011 4.9999C12.1011 2.6999 10.3011 0.899902 8.00107 0.899902C7.90107 0.899902 6.60107 0.999902 6.60107 0.999902C4.50107 1.2999 2.90107 2.9999 2.90107 4.9999C2.90107 5.0999 2.70107 6.5999 4.30107 7.9999C5.00107 8.6999 5.80107 10.3999 5.90107 10.8999L6.00107 10.9999H9.00107L9.10107 10.7999C9.20107 10.2999 10.0011 8.5999 10.7011 7.8999C12.3011 6.5999 12.1011 5.0999 12.1011 4.9999V4.9999ZM9.10107 5.9999L8.60107 8.9999H8.00107V5.9999C9.10107 5.9999 8.90107 4.9999 8.90107 4.9999H6.00107V5.0999C6.00107 5.2999 6.10107 5.9999 7.00107 5.9999V8.9999H6.50107L6.30107 8.2999L6.00107 5.9999C5.30107 5.9999 5.10107 5.5999 5.00107 5.2999V4.8999C5.00107 4.0999 5.90107 3.9999 5.90107 3.9999H9.00107C9.00107 3.9999 10.0011 4.0999 10.0011 4.9999C10.0011 4.9999 10.1011 5.9999 9.10107 5.9999Z" fill="#FFCC00"/>
<path d="M10.001 5C10.001 4.1 9.00098 4 9.00098 4H5.90098C5.90098 4 5.00098 4.1 5.00098 4.9V5.3C5.00098 5.6 5.30098 6 5.90098 6L6.30098 8.3L6.50098 9H7.00098V6C6.00098 6 6.00098 5.3 6.00098 5.1V5H9.00098C9.00098 5 9.10098 6 8.10098 6V9H8.70098L9.20098 6C10.101 6 10.001 5 10.001 5Z" fill="#F0EFF1"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M8 12C8 9.77386 9.77386 8 12 8C14.2261 8 16 9.77386 16 12C16 14.2261 14.2261 16 12 16C9.77386 16 8 14.2261 8 12Z" fill="#F6F6F6"/>
<path d="M12.3192 12.3031L13.3495 13.3334L13.3334 13.3495L12.3031 12.3192L12 12.0162L11.697 12.3192L10.6667 13.3495L10.6506 13.3334L11.6809 12.3031L11.9839 12L11.6809 11.697L10.6506 10.6667L10.6667 10.6506L11.697 11.6809L12 11.9839L12.3031 11.6809L13.3334 10.6506L13.3495 10.6667L12.3192 11.697L12.0162 12L12.3192 12.3031ZM12 8.46034C10.03 8.46034 8.46034 10.03 8.46034 12C8.46034 13.9701 10.03 15.5397 12 15.5397C13.9701 15.5397 15.5397 13.9701 15.5397 12C15.5397 10.03 13.9701 8.46034 12 8.46034Z" fill="#007ACC" stroke="#F6F6F6" stroke-width="0.857143"/>
<path d="M12.6225 12.0002L13.9558 13.3336L13.3336 13.9558L12.0002 12.6225L10.6669 13.9558L10.0447 13.3336L11.378 12.0002L10.0447 10.6669L10.6669 10.0447L12.0002 11.378L13.3336 10.0447L13.9558 10.6669L12.6225 12.0002Z" fill="#007ACC"/>
<path d="M10.704 14L11.2028 12.4712L10 11.6394H11.4732L12 10L12.5361 11.6394H14L12.7972 12.4712L13.3054 14L12 13.024L10.704 14Z" fill="white"/>
</svg>
......@@ -192,10 +192,19 @@
margin-right: 0px;
}
.markers-panel .monaco-tl-contents .actions .action-label.icon.markers-panel-action-quickfix.autofixable {
background: url('lightbulb-autofix.svg') center center no-repeat;
}
.vs-dark .markers-panel .monaco-tl-contents .actions .action-label.icon.markers-panel-action-quickfix {
background: url('lightbulb-dark.svg') center/80% no-repeat;
}
.vs-dark .markers-panel .monaco-tl-contents .actions .action-label.icon.markers-panel-action-quickfix.autofixable,
.hc-black .markers-panel .monaco-tl-contents .actions .action-label.icon.markers-panel-action-quickfix.autofixable {
background: url('lightbulb-autofix-dark.svg') center center no-repeat;
}
.markers-panel .monaco-tl-contents .actions .monaco-action-bar {
display: none;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册