Skip to content

Commit 21fbcc8

Browse files
authored
Merge pull request microsoft#261350 from microsoft/tyriar/261345
Fix tooltips in new rule added links
2 parents 18ba50d + 141522a commit 21fbcc8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,15 @@ export class ChatTerminalToolConfirmationSubPart extends BaseChatToolInvocationS
205205
throw new ErrorNoTelemetry(`Cannot add new rule, existing setting is unexpected format`);
206206
}
207207
await this.configurationService.updateValue(TerminalContribSettingId.AutoApprove, newValue);
208+
function formatRuleLinks(newRules: ITerminalNewAutoApproveRule[]): string {
209+
return newRules.map(e => {
210+
return `[\`${e.key}\`](settings_${ConfigurationTarget.USER} "${localize('ruleTooltip', 'View rule in settings')}")`;
211+
}).join(', ');
212+
}
208213
if (newRules.length === 1) {
209-
terminalData.autoApproveInfo = new MarkdownString(`_${localize('newRule', 'Auto approve rule {0} added', `[\`${newRules[0].key}\`](settings_a)`)}_`);
214+
terminalData.autoApproveInfo = new MarkdownString(`_${localize('newRule', 'Auto approve rule {0} added', formatRuleLinks(newRules))}_`);
210215
} else if (newRules.length > 1) {
211-
terminalData.autoApproveInfo = new MarkdownString(`_${localize('newRule.plural', 'Auto approve rules {0} added', newRules.map(r => `[\`${r.key}\`](settings_a)`).join(', '))}_`);
216+
terminalData.autoApproveInfo = new MarkdownString(`_${localize('newRule.plural', 'Auto approve rules {0} added', formatRuleLinks(newRules))}_`);
212217
}
213218
break;
214219
}

0 commit comments

Comments
 (0)