Skip to content

Commit a4dd37a

Browse files
committed
Always display the Workspace state and JSON file options in the context application menu, even if they contain zero saved contexts
1 parent 5d7d3b3 commit a4dd37a

1 file changed

Lines changed: 14 additions & 36 deletions

File tree

‎packages/vscode/src/commands/apply-context-command.ts‎

Lines changed: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -374,43 +374,21 @@ export function apply_context_command(
374374
} as any
375375
]
376376

377-
if (internal_contexts.length > 0) {
378-
main_quick_pick_options.push({
379-
label: 'Workspace state',
380-
description: `${internal_contexts.length} ${
381-
internal_contexts.length == 1 ? 'context' : 'contexts'
382-
}`,
383-
value: 'internal'
384-
})
385-
}
386-
387-
if (file_contexts.length > 0) {
388-
main_quick_pick_options.push({
389-
label: 'JSON file',
390-
description: `${file_contexts.length} ${
391-
file_contexts.length == 1 ? 'context' : 'contexts'
392-
}`,
393-
value: 'file'
394-
})
395-
}
396-
397-
if (internal_contexts.length == 0 && file_contexts.length == 0) {
398-
const main_selection = await vscode.window.showQuickPick(
399-
main_quick_pick_options,
400-
{
401-
placeHolder: 'Select option'
402-
}
403-
)
404-
405-
if (!main_selection) return
377+
main_quick_pick_options.push({
378+
label: 'Workspace state',
379+
description: `${internal_contexts.length} ${
380+
internal_contexts.length == 1 ? 'context' : 'contexts'
381+
}`,
382+
value: 'internal'
383+
})
406384

407-
if (main_selection.value == 'clipboard') {
408-
await vscode.commands.executeCommand(
409-
'codeWebChat.applyContextFromClipboard'
410-
)
411-
}
412-
return
413-
}
385+
main_quick_pick_options.push({
386+
label: 'JSON file',
387+
description: `${file_contexts.length} ${
388+
file_contexts.length == 1 ? 'context' : 'contexts'
389+
}`,
390+
value: 'file'
391+
})
414392

415393
const final_quick_pick_options = main_quick_pick_options
416394

0 commit comments

Comments
 (0)