Warn user when we overwrite a command due to conflict with extensions

This commit is contained in:
Christine Betts
2026-01-21 18:01:12 -05:00
parent 1033550f78
commit ced2f2873d
6 changed files with 140 additions and 5 deletions

View File

@@ -15,6 +15,7 @@ export interface Suggestion {
description?: string;
matchedIndex?: number;
commandKind?: CommandKind;
extensionName?: string;
}
interface SuggestionsDisplayProps {
suggestions: Suggestion[];
@@ -65,8 +66,13 @@ export function SuggestionsDisplay({
[CommandKind.AGENT]: ' [Agent]',
};
const getFullLabel = (s: Suggestion) =>
s.label + (s.commandKind ? (COMMAND_KIND_SUFFIX[s.commandKind] ?? '') : '');
const getFullLabel = (s: Suggestion) => {
let label = s.label;
if (s.commandKind && COMMAND_KIND_SUFFIX[s.commandKind]) {
label += COMMAND_KIND_SUFFIX[s.commandKind];
}
return label;
};
const maxLabelLength = Math.max(
...suggestions.map((s) => getFullLabel(s).length),