Skip to content

Commit b5d4e80

Browse files
committed
Remove the "Code Completion with Instructions to Clipboard" command and its associated functionality
1 parent 2c0c4ee commit b5d4e80

3 files changed

Lines changed: 4 additions & 81 deletions

File tree

packages/vscode/package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "gemini-coder",
33
"displayName": "Code Web Chat (CWC)",
44
"description": "Free AI coding for everyone",
5-
"version": "1.224.0",
5+
"version": "1.225.0",
66
"scripts": {
77
"build": "npx vsce package --no-dependencies",
88
"vscode:prepublish": "rimraf out && npm run compile",
@@ -224,11 +224,6 @@
224224
"title": "Code Completion to Clipboard",
225225
"category": "Code Web Chat"
226226
},
227-
{
228-
"command": "codeWebChat.codeCompletionWithInstructionsToClipboard",
229-
"title": "Code Completion with Instructions to Clipboard",
230-
"category": "Code Web Chat"
231-
},
232227
{
233228
"command": "codeWebChat.applyChatResponse",
234229
"title": "Apply Chat Response",

packages/vscode/src/commands/code-completion-to-clipboard-commands.ts

Lines changed: 3 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,17 @@
11
import * as vscode from 'vscode'
22
import { FilesCollector } from '../utils/files-collector'
3-
import { chat_code_completion_instructions } from '../constants/instructions'
4-
import { replace_saved_context_placeholder } from '../utils/replace-saved-context-placeholder'
53

64
async function perform_code_completion_to_clipboard(
75
context: vscode.ExtensionContext,
86
file_tree_provider: any,
9-
open_editors_provider: any,
10-
with_instructions: boolean = false
7+
open_editors_provider: any
118
) {
129
const editor = vscode.window.activeTextEditor
1310
if (!editor) {
1411
vscode.window.showErrorMessage('No active editor found.')
1512
return
1613
}
1714

18-
let completion_instructions: string | undefined
19-
if (with_instructions) {
20-
completion_instructions = await vscode.window.showInputBox({
21-
placeHolder: 'Completion instructions',
22-
prompt: 'E.g. "Include explanatory comments".'
23-
})
24-
25-
// If user cancels the input box (not the same as empty input), return
26-
if (completion_instructions === undefined) {
27-
return
28-
}
29-
}
30-
3115
const document = editor.document
3216
const document_path = document.uri.fsPath
3317
const position = editor.selection.active
@@ -56,38 +40,7 @@ async function perform_code_completion_to_clipboard(
5640
after: `${text_after_cursor}\n]]>\n</file>\n</files>`
5741
}
5842

59-
const base_instructions = chat_code_completion_instructions(
60-
relative_path,
61-
position.line,
62-
position.character
63-
)
64-
65-
let pre_instructions = base_instructions
66-
let post_instructions = base_instructions
67-
68-
if (with_instructions && completion_instructions) {
69-
if (completion_instructions.includes('@SavedContext:')) {
70-
const pre_user_instructions = await replace_saved_context_placeholder(
71-
completion_instructions,
72-
context,
73-
file_tree_provider
74-
)
75-
const post_user_instructions = await replace_saved_context_placeholder(
76-
completion_instructions,
77-
context,
78-
file_tree_provider,
79-
true
80-
)
81-
pre_instructions += ` Follow instructions: ${pre_user_instructions}`
82-
post_instructions += ` Follow instructions: ${post_user_instructions}`
83-
} else {
84-
const user_instructions_part = ` Follow instructions: ${completion_instructions}`
85-
pre_instructions += user_instructions_part
86-
post_instructions += user_instructions_part
87-
}
88-
}
89-
90-
const content = `${pre_instructions}\n${payload.before}<missing text>${payload.after}\n${post_instructions}`
43+
const content = `${payload.before}<missing text>${payload.after}`
9144

9245
await vscode.env.clipboard.writeText(content)
9346
vscode.window.showInformationMessage(
@@ -109,26 +62,7 @@ export function code_completion_to_clipboard_command(
10962
await perform_code_completion_to_clipboard(
11063
context,
11164
file_tree_provider,
112-
open_editors_provider,
113-
false
114-
)
115-
}
116-
)
117-
}
118-
119-
export function code_completion_with_instructions_to_clipboard_command(
120-
context: vscode.ExtensionContext,
121-
file_tree_provider: any,
122-
open_editors_provider?: any
123-
) {
124-
return vscode.commands.registerCommand(
125-
'codeWebChat.codeCompletionWithInstructionsToClipboard',
126-
async () => {
127-
await perform_code_completion_to_clipboard(
128-
context,
129-
file_tree_provider,
130-
open_editors_provider,
131-
true
65+
open_editors_provider
13266
)
13367
}
13468
)

packages/vscode/src/extension.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import {
2929
generate_commit_message_command,
3030
commit_changes_command,
3131
code_completion_to_clipboard_command,
32-
code_completion_with_instructions_to_clipboard_command,
3332
reference_in_chat_command,
3433
open_settings_command,
3534
open_url_command,
@@ -110,11 +109,6 @@ export async function activate(context: vscode.ExtensionContext) {
110109
workspace_provider,
111110
open_editors_provider
112111
),
113-
code_completion_with_instructions_to_clipboard_command(
114-
context,
115-
workspace_provider,
116-
open_editors_provider
117-
),
118112
close_editor_command(),
119113
close_all_editors_command(),
120114
save_all_command(),

0 commit comments

Comments
 (0)