Skip to content

Commit 031c323

Browse files
committed
Refactor command handlers to improve code consistency and type safety
- [Pasted text]
1 parent 0717086 commit 031c323

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

‎apps/editor/src/commands/generate-commit-message-command/generate-commit-message-command.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ import {
1414
import { t } from '@/i18n'
1515
import axios from 'axios'
1616
import { PromptsForCommitMessagesUtils } from '../../utils/prompts-for-commit-messages-utils'
17-
import { simplify_prompt_symbols } from '@shared/utils/simplify-prompt-symbols'
1817
import { MAX_PROMPT_CHARS_IN_COMMIT_MESSAGE } from '@/constants/values'
1918
import { PanelProvider } from '@/views/panel/backend/panel-provider'
2019
import { WorkspaceProvider } from '@/context/providers/workspace/workspace-provider'
2120
import { create_checkpoint } from '@/features/checkpoints/actions'
21+
import { simplify_prompt_symbols } from '@shared/utils/simplify-prompt-symbols'
2222

2323
const truncate_prompt = (text: string): string => {
2424
if (text.length <= MAX_PROMPT_CHARS_IN_COMMIT_MESSAGE) return text

‎apps/editor/src/commands/select-imported-files-command/select-imported-files-command.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,15 +264,15 @@ export const select_imported_files_command = (
264264
return
265265
}
266266

267-
if (selected_items === 'search') {
267+
if (selected_items == 'search') {
268268
const search_result = await search_files({
269269
files: shown_paths,
270270
workspace_provider,
271271
extension_context,
272272
show_back_button: true
273273
})
274274

275-
if (search_result === 'back') {
275+
if (search_result == 'back') {
276276
continue
277277
}
278278

‎apps/editor/src/commands/select-referencing-files-command.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,10 @@ export const select_referencing_files_command = (
221221

222222
const currently_checked = workspace_provider.get_checked_files()
223223

224-
const quick_pick_items = await Promise.all(
224+
const quick_pick_items: (vscode.QuickPickItem & {
225+
file_path: string
226+
range: vscode.Range
227+
})[] = await Promise.all(
225228
matched_files.map(async ({ file_path, range }) => {
226229
const workspace_root =
227230
workspace_provider.get_workspace_root_for_file(file_path)

0 commit comments

Comments
 (0)