Skip to content

Commit a441f35

Browse files
committed
Add informative QuickPick header showing keyboard shortcuts (Tab to insert, Enter to navigate)
1 parent 70edbbc commit a441f35

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/ccs/commands/jumpToTagOffsetCrossEntity.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,20 @@ async function promptWithQuickPick(
249249
return accepted;
250250
}
251251

252+
/**
253+
* Adds a non-selectable tip at the top of the QuickPick using a separator.
254+
* This avoids interfering with selection while informing the shortcuts.
255+
*/
252256
function buildLocalItems(localNames: LocalNamesMap): vscode.QuickPickItem[] {
257+
// Non-selectable header (separator) with the tip
258+
const infoSeparator = {
259+
label: "Tab ↹ Inserir • Enter ↩ Navegar",
260+
kind: vscode.QuickPickItemKind.Separator,
261+
} as unknown as vscode.QuickPickItem; // keep type compatible for qp.items
262+
253263
if (!localNames.size) {
254264
return [
265+
infoSeparator,
255266
{
256267
label: "Nenhum nome local encontrado",
257268
description: "—",
@@ -261,13 +272,16 @@ function buildLocalItems(localNames: LocalNamesMap): vscode.QuickPickItem[] {
261272
];
262273
}
263274

264-
return [...localNames.values()]
275+
const items = [...localNames.values()]
265276
.sort((a, b) => a.line - b.line || a.originalName.localeCompare(b.originalName))
266277
.map((info) => ({
267278
label: info.originalName,
268279
description: "definição local",
269280
detail: `linha ${info.line + 1}`,
270281
}));
282+
283+
// Keep the informative separator on top.
284+
return [infoSeparator, ...items];
271285
}
272286

273287
/** Replaces only the "name" portion in the expression, preserving +offset and ^item. */

0 commit comments

Comments
 (0)