Skip to content

Commit a0ba8e8

Browse files
committed
Consolidate workspace search handling into the main searchFiles command and remove the redundant workspace action command
- Remove the redundant 'codeWebChat.searchFilesWorkspaceAction' command across package.json and search-files-commands.ts, update the workspace view title action to use 'codeWebChat.searchFiles', and derive 'is_workspace_action' dynamically when no folder_path is present. └── apps └── editor ├── package.json └── src ├── commands │ └── search-files-commands │ ├── index.ts │ ├── search-files-commands.ts │ └── utils │ ├── get-target-folder-path.ts │ └── prompt-for-provided-results.ts └── features └── search-files └── search-modes ├── perform-agent-search-mode │ ├── agents │ │ ├── antigravity.ts │ │ ├── claude.ts │ │ ├── codex.ts │ │ ├── cursor.ts │ │ └── opencode.ts │ ├── index.ts │ ├── types.ts │ └── utils.ts ├── perform-intelligent-search-mode.ts ├── perform-keywords-search-mode.ts └── perform-phrase-search-mode.ts
1 parent ac78f9b commit a0ba8e8

2 files changed

Lines changed: 6 additions & 16 deletions

File tree

‎apps/editor/package.json‎

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -343,12 +343,6 @@
343343
"category": "Code Web Chat",
344344
"icon": "$(search)"
345345
},
346-
{
347-
"command": "codeWebChat.searchFilesWorkspaceAction",
348-
"title": "%codeWebChat.searchFiles.title%",
349-
"category": "Code Web Chat",
350-
"icon": "$(search)"
351-
},
352346
{
353347
"command": "codeWebChat.searchSelectedFiles",
354348
"title": "%codeWebChat.searchSelectedFiles.title%",
@@ -582,10 +576,6 @@
582576
"command": "codeWebChat.generateCommitMessage",
583577
"when": "false"
584578
},
585-
{
586-
"command": "codeWebChat.searchFilesWorkspaceAction",
587-
"when": "false"
588-
},
589579
{
590580
"command": "codeWebChat.searchFilesFromDirectory",
591581
"when": "false"
@@ -686,7 +676,7 @@
686676
"group": "navigation@2"
687677
},
688678
{
689-
"command": "codeWebChat.searchFilesWorkspaceAction",
679+
"command": "codeWebChat.searchFiles",
690680
"when": "view == codeWebChatViewWorkspace",
691681
"group": "navigation@5"
692682
},

‎apps/editor/src/commands/search-files-commands/search-files-commands.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ export const search_files_commands = (
197197
}
198198

199199
const folder_path = await get_target_folder_path(item)
200+
const is_workspace_action = options?.is_workspace_action ?? !folder_path
200201

201202
let all_files: string[] | undefined
202203

@@ -224,7 +225,7 @@ export const search_files_commands = (
224225
extension_context,
225226
websocket_manager,
226227
folder_path,
227-
is_workspace_action: options?.is_workspace_action
228+
is_workspace_action
228229
})
229230

230231
if (!result || result == 'back') return
@@ -300,6 +301,7 @@ export const search_files_commands = (
300301
is_workspace_action?: boolean
301302
}
302303
) => {
304+
let actual_item = item
303305
let actual_options = options
304306
if (
305307
item &&
@@ -310,13 +312,11 @@ export const search_files_commands = (
310312
item.is_workspace_action !== undefined)
311313
) {
312314
actual_options = item
315+
actual_item = undefined
313316
}
314-
return search_handler(undefined, actual_options)
317+
return search_handler(actual_item, actual_options)
315318
}
316319
),
317-
vscode.commands.registerCommand('codeWebChat.searchFilesWorkspaceAction', () =>
318-
search_handler(undefined, { is_workspace_action: true })
319-
),
320320
vscode.commands.registerCommand('codeWebChat.searchSelectedFiles', () =>
321321
search_selected_files_handler()
322322
),

0 commit comments

Comments
 (0)