Skip to content

Commit af5a089

Browse files
committed
Rename Code Completion to Code at Cursor across commands, configurations, UI labels, and internal logic to improve clarity and consistency
1 parent 1ec2035 commit af5a089

27 files changed

Lines changed: 168 additions & 507 deletions

‎README.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Code Web Chat is a free and open-source (FOSS), independent AI coding toolkit fo
1919
- APIs—_[Google](https://aistudio.google.com/api-keys), [OpenAI](https://platform.openai.com/api-keys), [OpenRouter](https://openrouter.ai/settings/keys), [local Ollama](https://ollama.com/search), etc._
2020

2121
✅ **Apply responses**—interactive multi-file changes integration \
22-
✅ **Fully-featured**—code completions, commit messages, etc. \
22+
✅ **Fully-featured**—code at cursor, commit messages, etc. \
2323
🌱 **Sustainable**—optimized for [prompt caching](https://platform.openai.com/docs/guides/prompt-caching) across tasks \
2424
✋ **Privacy-first**—strict zero telemetry policy
2525

@@ -86,8 +86,8 @@ Integrate changes from malformed markdown code blocks.
8686
**🛠️ Prune Context** \
8787
Remove irrelevant files from the current context selection.
8888

89-
**🛠️ Code Completions** \
90-
Get accurate code at cursor from state-of-the-art models.
89+
**🛠️ Code at Cursor** \
90+
Get accurate inline suggestions from state-of-the-art models.
9191

9292
**🛠️ Commit Messages** \
9393
Meaningful summaries of changes adhering to your style.
@@ -98,12 +98,12 @@ Meaningful summaries of changes adhering to your style.
9898

9999
## Commands
100100

101-
### Code completions
101+
### Code at Cursor
102102

103-
- `Code Web Chat: Code Completion` - Get code-at-cursor using API tool.
104-
- `Code Web Chat: Code Completion using...` - ...with configuration selection.
105-
- `Code Web Chat: Code Completion with Instructions` - ...with instructions.
106-
- `Code Web Chat: Code Completion with Instructions using...` - ...with instructions and configuration selection.
103+
- `Code Web Chat: Code at Cursor` - Get an inline snippet while using the current context.
104+
- `Code Web Chat: Code at Cursor using...` - Inline snippet with configuration selection.
105+
- `Code Web Chat: Code at Cursor with Instructions` - Inline snippet with instructions.
106+
- `Code Web Chat: Code at Cursor with Instructions using...` - Inline snippet with instructions and configuration selection.
107107

108108
### Checkpoints
109109

‎apps/editor/package.json‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -195,23 +195,23 @@
195195
"icon": "$(save-all)"
196196
},
197197
{
198-
"command": "codeWebChat.codeCompletion",
199-
"title": "Code Completion",
198+
"command": "codeWebChat.codeAtCursor",
199+
"title": "Code at Cursor",
200200
"category": "Code Web Chat"
201201
},
202202
{
203-
"command": "codeWebChat.codeCompletionUsing",
204-
"title": "Code Completion using...",
203+
"command": "codeWebChat.codeAtCursorUsing",
204+
"title": "Code at Cursor using...",
205205
"category": "Code Web Chat"
206206
},
207207
{
208-
"command": "codeWebChat.codeCompletionWithInstructions",
209-
"title": "Code Completion with Instructions",
208+
"command": "codeWebChat.codeAtCursorWithInstructions",
209+
"title": "Code at Cursor with Instructions",
210210
"category": "Code Web Chat"
211211
},
212212
{
213-
"command": "codeWebChat.codeCompletionWithInstructionsUsing",
214-
"title": "Code Completion with Instructions using...",
213+
"command": "codeWebChat.codeAtCursorWithInstructionsUsing",
214+
"title": "Code at Cursor with Instructions using...",
215215
"category": "Code Web Chat"
216216
},
217217
{
@@ -1647,7 +1647,7 @@
16471647
]
16481648
}
16491649
},
1650-
"codeWebChat.configurationsForCodeCompletions": {
1650+
"codeWebChat.configurationsForCodeAtCursor": {
16511651
"type": "array",
16521652
"scope": "resource",
16531653
"default": [],

apps/editor/src/commands/code-completion-commands.ts renamed to apps/editor/src/commands/code-at-cursor-commands.ts

Lines changed: 50 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as vscode from 'vscode'
22
import axios from 'axios'
33
import { make_api_request } from '../utils/make-api-request'
4-
import { code_completion_instructions } from '../constants/instructions'
4+
import { code_at_cursor_instructions } from '../constants/instructions'
55
import { FilesCollector } from '../utils/files-collector'
66
import {
77
ModelProvidersManager,
@@ -11,8 +11,8 @@ import { Logger } from '@shared/utils/logger'
1111
import he from 'he'
1212
import { PROVIDERS } from '@shared/constants/providers'
1313
import {
14-
LAST_SELECTED_CODE_COMPLETION_CONFIG_ID_STATE_KEY,
15-
RECENTLY_USED_CODE_COMPLETION_CONFIG_IDS_STATE_KEY
14+
LAST_SELECTED_CODE_AT_CURSOR_CONFIG_ID_STATE_KEY,
15+
RECENTLY_USED_CODE_AT_CURSOR_CONFIG_IDS_STATE_KEY
1616
} from '@/constants/state-keys'
1717
import { ToolConfig } from '@/services/model-providers-manager'
1818
import { PanelProvider } from '@/views/panel/backend/panel-provider'
@@ -55,17 +55,17 @@ const show_inline_completion = async (params: {
5555
}, 10000)
5656
}
5757

58-
const get_code_completion_config = async (
58+
const get_code_at_cursor_config = async (
5959
api_providers_manager: ModelProvidersManager,
6060
show_quick_pick: boolean = false,
6161
context: vscode.ExtensionContext,
6262
config_id?: string,
6363
panel_provider?: PanelProvider
6464
): Promise<{ provider: any; config: any } | undefined> => {
65-
const code_completions_configs =
65+
const code_at_cursor_configs =
6666
await api_providers_manager.get_code_completions_tool_configs()
6767

68-
if (code_completions_configs.length == 0) {
68+
if (code_at_cursor_configs.length == 0) {
6969
vscode.commands.executeCommand('codeWebChat.settings')
7070
vscode.window.showInformationMessage(
7171
dictionary.information_message.NO_CODE_COMPLETIONS_CONFIGURATIONS_FOUND
@@ -77,9 +77,8 @@ const get_code_completion_config = async (
7777

7878
if (config_id !== undefined) {
7979
selected_config =
80-
code_completions_configs.find(
81-
(c) => get_tool_config_id(c) === config_id
82-
) || null
80+
code_at_cursor_configs.find((c) => get_tool_config_id(c) === config_id) ||
81+
null
8382
} else if (!show_quick_pick) {
8483
const default_config =
8584
await api_providers_manager.get_default_code_completions_config()
@@ -88,16 +87,16 @@ const get_code_completion_config = async (
8887
selected_config = default_config
8988
} else {
9089
const last_selected_id = context.workspaceState.get<string>(
91-
LAST_SELECTED_CODE_COMPLETION_CONFIG_ID_STATE_KEY
90+
LAST_SELECTED_CODE_AT_CURSOR_CONFIG_ID_STATE_KEY
9291
)
9392
if (last_selected_id) {
9493
selected_config =
95-
code_completions_configs.find(
94+
code_at_cursor_configs.find(
9695
(c) => get_tool_config_id(c) === last_selected_id
9796
) || null
9897
}
99-
if (!selected_config && code_completions_configs.length > 0) {
100-
selected_config = code_completions_configs[0]
98+
if (!selected_config && code_at_cursor_configs.length > 0) {
99+
selected_config = code_at_cursor_configs[0]
101100
}
102101
}
103102
}
@@ -106,13 +105,13 @@ const get_code_completion_config = async (
106105
const create_items = () => {
107106
const recent_ids =
108107
context.workspaceState.get<string[]>(
109-
RECENTLY_USED_CODE_COMPLETION_CONFIG_IDS_STATE_KEY
108+
RECENTLY_USED_CODE_AT_CURSOR_CONFIG_IDS_STATE_KEY
110109
) || []
111110

112111
const matched_recent_configs: ToolConfig[] = []
113112
const remaining_configs: ToolConfig[] = []
114113

115-
code_completions_configs.forEach((config) => {
114+
code_at_cursor_configs.forEach((config) => {
116115
const id = get_tool_config_id(config)
117116
if (recent_ids.includes(id)) {
118117
matched_recent_configs.push(config)
@@ -178,11 +177,11 @@ const get_code_completion_config = async (
178177

179178
const quick_pick = vscode.window.createQuickPick()
180179
quick_pick.items = create_items()
181-
quick_pick.placeholder = 'Select code completions configuration'
180+
quick_pick.placeholder = 'Select code at cursor configuration'
182181
quick_pick.matchOnDescription = true
183182

184183
const last_selected_id = context.workspaceState.get<string>(
185-
LAST_SELECTED_CODE_COMPLETION_CONFIG_ID_STATE_KEY
184+
LAST_SELECTED_CODE_AT_CURSOR_CONFIG_ID_STATE_KEY
186185
)
187186

188187
const items = quick_pick.items as (vscode.QuickPickItem & { id: string })[]
@@ -211,17 +210,17 @@ const get_code_completion_config = async (
211210
}
212211

213212
context.workspaceState.update(
214-
LAST_SELECTED_CODE_COMPLETION_CONFIG_ID_STATE_KEY,
213+
LAST_SELECTED_CODE_AT_CURSOR_CONFIG_ID_STATE_KEY,
215214
selected.id
216215
)
217216

218217
let recents =
219218
context.workspaceState.get<string[]>(
220-
RECENTLY_USED_CODE_COMPLETION_CONFIG_IDS_STATE_KEY
219+
RECENTLY_USED_CODE_AT_CURSOR_CONFIG_IDS_STATE_KEY
221220
) || []
222221
recents = [selected.id, ...recents.filter((id) => id != selected.id)]
223222
context.workspaceState.update(
224-
RECENTLY_USED_CODE_COMPLETION_CONFIG_IDS_STATE_KEY,
223+
RECENTLY_USED_CODE_AT_CURSOR_CONFIG_IDS_STATE_KEY,
225224
recents
226225
)
227226

@@ -269,7 +268,7 @@ const get_code_completion_config = async (
269268
dictionary.error_message.API_PROVIDER_NOT_FOUND
270269
)
271270
Logger.warn({
272-
function_name: 'get_code_completion_config',
271+
function_name: 'get_code_at_cursor_config',
273272
message: 'API provider not found for Code Completions tool.'
274273
})
275274
return
@@ -281,7 +280,7 @@ const get_code_completion_config = async (
281280
}
282281
}
283282

284-
const perform_code_completion = async (params: {
283+
const perform_code_at_cursor = async (params: {
285284
file_tree_provider: any
286285
open_editors_provider: any
287286
context: vscode.ExtensionContext
@@ -314,7 +313,7 @@ const perform_code_completion = async (params: {
314313
)
315314
}
316315

317-
const config_result = await get_code_completion_config(
316+
const config_result = await get_code_at_cursor_config(
318317
api_providers_manager,
319318
params.show_quick_pick,
320319
params.context,
@@ -326,23 +325,23 @@ const perform_code_completion = async (params: {
326325
return
327326
}
328327

329-
const { provider, config: code_completions_config } = config_result
328+
const { provider, config: code_at_cursor_config } = config_result
330329

331-
if (!code_completions_config.provider_name) {
330+
if (!code_at_cursor_config.provider_name) {
332331
vscode.window.showErrorMessage(
333332
dictionary.error_message.API_PROVIDER_NOT_SPECIFIED_FOR_CODE_COMPLETIONS
334333
)
335334
Logger.warn({
336-
function_name: 'perform_code_completion',
335+
function_name: 'perform_code_at_cursor',
337336
message: 'API provider is not specified for Code Completions tool.'
338337
})
339338
return
340-
} else if (!code_completions_config.model) {
339+
} else if (!code_at_cursor_config.model) {
341340
vscode.window.showErrorMessage(
342341
dictionary.error_message.MODEL_NOT_SPECIFIED_FOR_CODE_COMPLETIONS
343342
)
344343
Logger.warn({
345-
function_name: 'perform_code_completion',
344+
function_name: 'perform_code_at_cursor',
346345
message: 'Model is not specified for Code Completions tool.'
347346
})
348347
return
@@ -356,7 +355,7 @@ const perform_code_completion = async (params: {
356355
dictionary.error_message.BUILT_IN_PROVIDER_NOT_FOUND(provider.name)
357356
)
358357
Logger.warn({
359-
function_name: 'perform_code_completion',
358+
function_name: 'perform_code_at_cursor',
360359
message: `Built-in provider "${provider.name}" not found.`
361360
})
362361
return
@@ -402,11 +401,11 @@ const perform_code_completion = async (params: {
402401
after: `${text_after_cursor}\n]]>\n</file>\n</files>`
403402
}
404403

405-
const content = `${code_completion_instructions}\n${payload.before}${
404+
const content = `${code_at_cursor_instructions}\n${payload.before}${
406405
completion_instructions
407406
? `<missing_text>${completion_instructions}</missing_text>`
408407
: '<missing_text>'
409-
}${payload.after}\n${code_completion_instructions}`
408+
}${payload.after}\n${code_at_cursor_instructions}`
410409

411410
const messages = [
412411
{
@@ -417,14 +416,14 @@ const perform_code_completion = async (params: {
417416

418417
const body: { [key: string]: any } = {
419418
messages,
420-
model: code_completions_config.model,
421-
temperature: code_completions_config.temperature
419+
model: code_at_cursor_config.model,
420+
temperature: code_at_cursor_config.temperature
422421
}
423422

424423
apply_reasoning_effort(
425424
body,
426425
provider,
427-
code_completions_config.reasoning_effort
426+
code_at_cursor_config.reasoning_effort
428427
)
429428

430429
const cursor_listener = vscode.window.onDidChangeTextEditorSelection(() => {
@@ -528,7 +527,7 @@ const perform_code_completion = async (params: {
528527
}
529528
} catch (err: any) {
530529
Logger.error({
531-
function_name: 'perform_code_completion',
530+
function_name: 'perform_code_at_cursor',
532531
message: 'Completion error',
533532
data: err
534533
})
@@ -538,15 +537,15 @@ const perform_code_completion = async (params: {
538537
}
539538
}
540539

541-
export const code_completion_commands = (params: {
540+
export const code_at_cursor_commands = (params: {
542541
file_tree_provider: any
543542
open_editors_provider: any
544543
context: vscode.ExtensionContext
545544
panel_provider: PanelProvider
546545
}) => {
547546
return [
548-
vscode.commands.registerCommand('codeWebChat.codeCompletion', async () =>
549-
perform_code_completion({
547+
vscode.commands.registerCommand('codeWebChat.codeAtCursor', async () =>
548+
perform_code_at_cursor({
550549
file_tree_provider: params.file_tree_provider,
551550
open_editors_provider: params.open_editors_provider,
552551
context: params.context,
@@ -555,32 +554,30 @@ export const code_completion_commands = (params: {
555554
})
556555
),
557556
vscode.commands.registerCommand(
558-
'codeWebChat.codeCompletionWithInstructions',
557+
'codeWebChat.codeAtCursorWithInstructions',
559558
async () =>
560-
perform_code_completion({
559+
perform_code_at_cursor({
561560
file_tree_provider: params.file_tree_provider,
562561
open_editors_provider: params.open_editors_provider,
563562
context: params.context,
564563
with_completion_instructions: true,
565564
show_quick_pick: false
566565
})
567566
),
568-
vscode.commands.registerCommand(
569-
'codeWebChat.codeCompletionUsing',
570-
async () =>
571-
perform_code_completion({
572-
file_tree_provider: params.file_tree_provider,
573-
open_editors_provider: params.open_editors_provider,
574-
context: params.context,
575-
with_completion_instructions: false,
576-
show_quick_pick: true,
577-
panel_provider: params.panel_provider
578-
})
567+
vscode.commands.registerCommand('codeWebChat.codeAtCursorUsing', async () =>
568+
perform_code_at_cursor({
569+
file_tree_provider: params.file_tree_provider,
570+
open_editors_provider: params.open_editors_provider,
571+
context: params.context,
572+
with_completion_instructions: false,
573+
show_quick_pick: true,
574+
panel_provider: params.panel_provider
575+
})
579576
),
580577
vscode.commands.registerCommand(
581-
'codeWebChat.codeCompletionWithInstructionsUsing',
578+
'codeWebChat.codeAtCursorWithInstructionsUsing',
582579
async () =>
583-
perform_code_completion({
580+
perform_code_at_cursor({
584581
file_tree_provider: params.file_tree_provider,
585582
open_editors_provider: params.open_editors_provider,
586583
context: params.context,

‎apps/editor/src/commands/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export * from './close-all-editors-command'
55
export * from './checkpoints-command'
66
export * from './close-editor-command'
77
export * from './duplicate-workspace-command'
8-
export * from './code-completion-commands'
8+
export * from './code-at-cursor-commands'
99
export * from './delete-command'
1010
export * from './generate-commit-message-command'
1111
export * from './new-file-command'

‎apps/editor/src/constants/instructions.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
export const code_completion_instructions =
1+
export const code_at_cursor_instructions =
22
'Find correct replacement for the <missing_text> symbol. Respond with replacement text within "replacement" XML tags, without explanations or any other text.\nExample:\n<replacement>!== undefined</replacement>\n'
33

4-
export const code_completion_instructions_for_panel = (
4+
export const code_at_cursor_instructions_for_panel = (
55
file_path: string,
66
row: number,
77
column: number

0 commit comments

Comments
 (0)