Skip to content

Commit 2bb8099

Browse files
committed
Merge branch 'dev'
2 parents 5c13002 + f35b78f commit 2bb8099

89 files changed

Lines changed: 380 additions & 380 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<a href="https://marketplace.visualstudio.com/items?itemName=robertpiosik.gemini-coder" target="_blank"><img src="https://img.shields.io/badge/Install-VS_Code_Marketplace-blue" alt="Get from Visual Studio Code Marketplace" /></a> <a href="https://open-vsx.org/extension/robertpiosik/gemini-coder" target="_blank"><img src="https://img.shields.io/badge/Install-Open_VSX_Registry-a60ee5" alt="Get from Open VSX Registry" /></a> <a href="https://github.com/robertpiosik/CodeWebChat/blob/dev/LICENSE" target="_blank"><img src="https://img.shields.io/badge/License-GPL--3.0-green.svg" alt="GPL-3.0 license" /></a>
44

5-
Agent-free AI pair programming for production-grade code. Steer the model with hand-picked context for fast and accurate edits with simple instructions.
5+
Blazing fast AI pair programming for production-grade code. Select context as you go for pro accuracy and game-changing speed.
66

77
Works with VS Code, Cursor, Windsurf, and other forks.
88

‎file-X.txt‎

Whitespace-only changes.

‎packages/ui/src/components/editor/panel/ContextUtilisation/ContextUtilisation.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const ContextUtilisation: React.FC<Props> = (props) => {
4242
const formatted_remaining_tokens = format_tokens(remaining_tokens)
4343
title_text = `${formatted_remaining_tokens} tokens remaining until threshold warning (change in settings)`
4444
} else {
45-
title_text = `Context of size ${formatted_current_size} exceeds threshold ${formatted_threshold} by `
45+
title_text = `Context of size ${formatted_current_size} tokens exceeds threshold by ${formatted_threshold} tokens`
4646
}
4747

4848
return (

‎packages/ui/src/components/editor/panel/modals/Modal/Modal.module.scss‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
background-color: var(--vscode-quickInput-background);
6767
color: var(--vscode-quickInput-foreground);
6868
border: 1px solid var(--vscode-widget-border);
69-
box-shadow: 0 0 8px 2px var(--vscode-widget-shadow);
7069
display: flex;
7170
flex-direction: column;
7271
}

‎packages/vscode/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "gemini-coder",
33
"displayName": "Code Web Chat",
4-
"description": "CWC: Initialize free chatbots, call model providers, apply responses, batteries included",
5-
"version": "1.491.0",
4+
"description": "CWC: Initialize free chatbots · call model providers · apply responses · batteries included",
5+
"version": "1.492.0",
66
"scripts": {
77
"build": "npx vsce package --no-dependencies",
88
"vscode:prepublish": "rimraf out && npm run compile",

‎packages/vscode/src/commands/apply-chat-response-command/apply-chat-response-command.ts‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export const apply_chat_response_command = (
2424
return vscode.commands.registerCommand(
2525
'codeWebChat.applyChatResponse',
2626
async (args?: CommandArgs) => {
27-
console.log('xxx', args)
2827
if (!vscode.workspace.workspaceFolders?.length) {
2928
vscode.window.showErrorMessage(
3029
dictionary.error_message.NO_WORKSPACE_FOLDER_OPEN
@@ -227,6 +226,22 @@ export const apply_chat_response_command = (
227226

228227
if (accepted_state.is_deleted) {
229228
if (fs.existsSync(sanitized_file_path)) {
229+
const tabs_to_close: vscode.Tab[] = []
230+
for (const tab_group of vscode.window.tabGroups.all) {
231+
tabs_to_close.push(
232+
...tab_group.tabs.filter((tab) => {
233+
const tab_uri = (tab.input as any)?.uri as
234+
| vscode.Uri
235+
| undefined
236+
return tab_uri && tab_uri.fsPath == sanitized_file_path
237+
})
238+
)
239+
}
240+
241+
if (tabs_to_close.length > 0) {
242+
await vscode.window.tabGroups.close(tabs_to_close)
243+
}
244+
230245
await vscode.workspace.fs.delete(
231246
vscode.Uri.file(sanitized_file_path)
232247
)

‎packages/vscode/src/commands/apply-chat-response-command/response-processor.ts‎

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as vscode from 'vscode'
22
import * as fs from 'fs'
33
import { OriginalFileState } from './types/original-file-state'
44
import { handle_restore_review } from './handlers/restore-review-handler'
5-
import { parse_response } from './utils/clipboard-parser'
5+
import { parse_response, FileItem, DiffItem } from './utils/clipboard-parser'
66
import { create_safe_path } from '@/utils/path-sanitizer'
77
import { dictionary } from '@shared/constants/dictionary'
88
import { Logger } from '@shared/utils/logger'
@@ -72,16 +72,13 @@ export const process_chat_response = async (
7272
const is_single_root_folder_workspace =
7373
vscode.workspace.workspaceFolders?.length == 1
7474

75-
let clipboard_content = parse_response({
75+
let clipboard_items = parse_response({
7676
response: chat_response,
7777
is_single_root_folder_workspace
7878
})
7979

80-
if (
81-
clipboard_content.type == 'code-completion' &&
82-
clipboard_content.code_completion
83-
) {
84-
const completion = clipboard_content.code_completion
80+
if (clipboard_items.length == 1 && clipboard_items[0].type == 'completion') {
81+
const completion = clipboard_items[0]
8582
const workspace_map = new Map<string, string>()
8683
vscode.workspace.workspaceFolders!.forEach((folder) => {
8784
workspace_map.set(folder.name, folder.uri.fsPath)
@@ -146,15 +143,22 @@ export const process_chat_response = async (
146143
}
147144
args.suppress_fast_replace_inaccuracies_dialog = true
148145

149-
clipboard_content = {
150-
type: 'files',
151-
files: [{ ...completion, content: new_content }]
152-
} as any
146+
clipboard_items = [
147+
{
148+
type: 'file',
149+
file_path: completion.file_path,
150+
content: new_content,
151+
workspace_name: completion.workspace_name
152+
}
153+
]
153154
}
154155

155-
if (clipboard_content.type == 'patches' && clipboard_content.patches) {
156+
const item_type = clipboard_items.length > 0 ? clipboard_items[0].type : null
157+
158+
if (item_type == 'diff') {
159+
const patches = clipboard_items as DiffItem[]
156160
const rename_map = new Map<string, string>()
157-
clipboard_content.patches.forEach((patch) => {
161+
patches.forEach((patch) => {
158162
if (patch.new_file_path && patch.file_path) {
159163
rename_map.set(patch.file_path, patch.new_file_path)
160164
}
@@ -187,10 +191,10 @@ export const process_chat_response = async (
187191
}[] = []
188192
let any_patch_used_fallback = false
189193

190-
const total_patches = clipboard_content.patches.length
194+
const total_patches = patches.length
191195

192196
for (let i = 0; i < total_patches; i++) {
193-
const patch = clipboard_content.patches[i]
197+
const patch = patches[i]
194198
let workspace_path = default_workspace
195199

196200
if (patch.workspace_name && workspace_map.has(patch.workspace_name)) {
@@ -354,7 +358,10 @@ export const process_chat_response = async (
354358

355359
return null
356360
} else {
357-
if (!clipboard_content.files || clipboard_content.files.length == 0) {
361+
const files = clipboard_items.filter(
362+
(item): item is FileItem => item.type == 'file'
363+
)
364+
if (files.length == 0) {
358365
const editor = vscode.window.activeTextEditor
359366
if (editor) {
360367
const choice = await vscode.window.showWarningMessage(
@@ -427,7 +434,7 @@ export const process_chat_response = async (
427434
let selected_mode_label: 'Fast replace' | 'Intelligent update' | undefined =
428435
undefined
429436

430-
const all_files_new = await check_if_all_files_new(clipboard_content.files)
437+
const all_files_new = await check_if_all_files_new(files)
431438

432439
if (all_files_new) {
433440
selected_mode_label = 'Fast replace'
@@ -441,9 +448,7 @@ export const process_chat_response = async (
441448
args?.edit_format === undefined || // Is undefined when invoked manually
442449
args?.edit_format == 'truncated'
443450
) {
444-
has_truncated_fragments = check_for_truncated_fragments(
445-
clipboard_content.files
446-
)
451+
has_truncated_fragments = check_for_truncated_fragments(files)
447452
}
448453

449454
if (has_truncated_fragments) {
@@ -466,7 +471,7 @@ export const process_chat_response = async (
466471
let operation_success = false
467472

468473
if (selected_mode_label == 'Fast replace') {
469-
const result = await handle_fast_replace(clipboard_content.files)
474+
const result = await handle_fast_replace(files)
470475
if (result.success && result.original_states) {
471476
if (!args?.suppress_fast_replace_inaccuracies_dialog) {
472477
result.original_states.forEach((s) => (s.is_replaced = true))

0 commit comments

Comments
 (0)