Skip to content

Commit 7c369f2

Browse files
committed
Rename "Check All with Keywords" to "Search Files for Context" and refactor its implementation
1 parent a93c582 commit 7c369f2

11 files changed

Lines changed: 433 additions & 733 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Code Web Chat operates exclusively on your machine. Your prompts are sent direct
101101
- `Code Web Chat: Apply Context` - Apply a saved context or save the current file selection.
102102
- `Code Web Chat: Add File to Context` - Search and add file (or parent folder via file action) to the context.
103103
- `Code Web Chat: Remove File from Context` - Search and remove file (or parent folder via file action) from the context.
104-
- `Code Web Chat: Check All with Keywords` - Search and add files containing specific keywords to the context.
104+
- `Code Web Chat: Search Files for Context` - Search and add files containing specific keywords to the context.
105105
- `Code Web Chat: Copy Context` - Copy XML-formatted checked files from the Workspace view to the clipboard.
106106
- `Code Web Chat: Copy Context of Open Editors` - Copy XML-formatted checked files from the Open Editors view to the clipboard.
107107

‎apps/editor/package.json‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,10 @@
320320
"category": "Code Web Chat"
321321
},
322322
{
323-
"command": "codeWebChat.checkAllWithKeywords",
324-
"title": "Check All with Keywords...",
325-
"category": "Code Web Chat"
323+
"command": "codeWebChat.searchFilesForContext",
324+
"title": "Search Files for Context...",
325+
"category": "Code Web Chat",
326+
"icon": "$(search)"
326327
},
327328
{
328329
"command": "codeWebChat.checkReferencingFilesForContext",
@@ -537,6 +538,11 @@
537538
"when": "view == codeWebChatViewWorkspace",
538539
"group": "navigation@2"
539540
},
541+
{
542+
"command": "codeWebChat.searchFilesForContext",
543+
"when": "view == codeWebChatViewWorkspace",
544+
"group": "navigation@3.5"
545+
},
540546
{
541547
"command": "codeWebChat.applyContext",
542548
"when": "view == codeWebChatViewWorkspace",
@@ -687,7 +693,7 @@
687693
"group": "1_modification@3"
688694
},
689695
{
690-
"command": "codeWebChat.checkAllWithKeywords",
696+
"command": "codeWebChat.searchFilesForContext",
691697
"when": "(view == codeWebChatViewWorkspace || view == codeWebChatViewContext) && (viewItem == directory || viewItem == workspaceRoot || viewItem == contextDirectory || viewItem == contextWorkspaceRoot)",
692698
"group": "1_modification@3.5"
693699
},

‎apps/editor/src/commands/apply-context-command/apply-context-command.ts‎

Lines changed: 5 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import {
88
handle_unstaged_files_source,
99
handle_json_file_source,
1010
handle_workspace_state_source,
11-
handle_commit_files_source,
12-
handle_check_all_with_keywords_source
11+
handle_commit_files_source
1312
} from './sources'
1413
import {
1514
load_all_contexts,
@@ -27,13 +26,7 @@ export const apply_context_command = (
2726
async () => {
2827
let show_main_menu = true
2928
let last_main_selection_value = extension_context.workspaceState.get<
30-
| 'internal'
31-
| 'file'
32-
| 'unstaged'
33-
| 'commit_files'
34-
| 'check_all_with_keywords'
35-
| string
36-
| undefined
29+
'internal' | 'file' | 'unstaged' | 'commit_files' | string | undefined
3730
>(LAST_APPLY_CONTEXT_OPTION_STATE_KEY)
3831

3932
while (show_main_menu) {
@@ -57,13 +50,7 @@ export const apply_context_command = (
5750
}
5851

5952
const main_quick_pick_options: (vscode.QuickPickItem & {
60-
value:
61-
| 'internal'
62-
| 'file'
63-
| 'unstaged'
64-
| 'commit_files'
65-
| 'check_all_with_keywords'
66-
| string
53+
value: 'internal' | 'file' | 'unstaged' | 'commit_files' | string
6754
})[] = []
6855

6956
main_quick_pick_options.push({
@@ -98,20 +85,9 @@ export const apply_context_command = (
9885
value: 'commit_files'
9986
})
10087

101-
main_quick_pick_options.push({
102-
label: 'Check all with keywords...',
103-
value: 'check_all_with_keywords'
104-
})
105-
10688
const main_quick_pick = vscode.window.createQuickPick<
10789
vscode.QuickPickItem & {
108-
value:
109-
| 'internal'
110-
| 'file'
111-
| 'unstaged'
112-
| 'commit_files'
113-
| 'check_all_with_keywords'
114-
| string
90+
value: 'internal' | 'file' | 'unstaged' | 'commit_files' | string
11591
}
11692
>()
11793
main_quick_pick.title = 'Context Sources'
@@ -131,13 +107,7 @@ export const apply_context_command = (
131107

132108
const main_selection = await new Promise<
133109
| (vscode.QuickPickItem & {
134-
value:
135-
| 'internal'
136-
| 'file'
137-
| 'unstaged'
138-
| 'commit_files'
139-
| 'check_all_with_keywords'
140-
| string
110+
value: 'internal' | 'file' | 'unstaged' | 'commit_files' | string
141111
triggeredButton?: vscode.QuickInputButton
142112
})
143113
| undefined
@@ -258,14 +228,6 @@ export const apply_context_command = (
258228
if (result == 'back') {
259229
show_main_menu = true
260230
}
261-
} else if (main_selection.value == 'check_all_with_keywords') {
262-
const result = await handle_check_all_with_keywords_source(
263-
workspace_provider,
264-
extension_context
265-
)
266-
if (result == 'back') {
267-
show_main_menu = true
268-
}
269231
}
270232
}
271233
}

0 commit comments

Comments
 (0)