Skip to content

Commit ab6178f

Browse files
committed
Implement auto-selection for the context file quick pick when a search yields a single result and simplify the corresponding warning message
1 parent a5ebc6f commit ab6178f

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎packages/shared/src/constants/dictionary.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export const dictionary = {
110110
NO_MODELS_FOUND_MANUAL_ENTRY: (provider_name: string) =>
111111
`No models found for ${provider_name}. You can enter model name manually.`,
112112
NO_RESULTS_FOR_SEARCH_SHOWING_ALL: (search_value: string) =>
113-
`No results for "${search_value}" in the selected context. Showing all items.`,
113+
`No results for "${search_value}" in the selected context.`,
114114
NO_MODEL_PROVIDERS_CONFIGURED:
115115
'No model providers configured. Please add a model provider first on the "Model Providers" page.'
116116
},

‎packages/vscode/src/views/panel/backend/message-handlers/handle-at-sign-quick-pick.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ const at_sign_quick_pick = async (params: {
6060
return filename_lower.includes(search_lower)
6161
})
6262

63-
if (filtered_items.length > 0) {
63+
if (filtered_items.length == 1) {
64+
return `\`${filtered_items[0].fullPath}\` `
65+
} else if (filtered_items.length > 1) {
6466
quick_pick_items_to_show = filtered_items
6567
} else {
6668
vscode.window.showWarningMessage(

0 commit comments

Comments
 (0)