Skip to content

Commit 4b26e97

Browse files
committed
Add token count display to progress reporting during code generation
1 parent 865f0d6 commit 4b26e97

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎apps/editor/src/commands/code-at-cursor-commands.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { ToolConfig } from '@/services/model-providers-manager'
1515
import { PanelProvider } from '@/views/panel/backend/panel-provider'
1616
import { dictionary } from '@shared/constants/dictionary'
1717
import { apply_reasoning_effort } from '../utils/apply-reasoning-effort'
18+
import { display_token_count } from '../utils/display-token-count'
1819

1920
const show_ghost_text = async (params: {
2021
editor: vscode.TextEditor
@@ -427,7 +428,11 @@ const perform_code_at_cursor = async (params: {
427428
cancel_token_source.cancel('User cancelled the operation')
428429
})
429430

430-
progress.report({ message: 'waiting for server...' })
431+
progress.report({
432+
message: `sent ${display_token_count(
433+
Math.floor(content.length / 4)
434+
)} tokens...`
435+
})
431436

432437
return await make_api_request({
433438
endpoint_url,

0 commit comments

Comments
 (0)