Skip to content

Commit d383334

Browse files
committed
Refactor diff processor to improve robustness and add generic test case support
1 parent a6e5862 commit d383334

7 files changed

Lines changed: 518 additions & 239 deletions

File tree

README.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,9 @@
1111
<a href="https://marketplace.visualstudio.com/items?itemName=robertpiosik.gemini-coder"><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"><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"><img src="https://img.shields.io/badge/License-GPL--3.0-green.svg" alt="GPL-3.0 license" /></a>
1212
</p>
1313

14-
Code Web Chat is a free and open-source, independent AI coding toolkit for VS Code.
14+
Code Web Chat is a free and open-source, independent AI coding toolkit for VS Code. Start using [projects](https://help.openai.com/en/articles/10169521-projects-in-chatgpt) (also called [gems](https://gemini.google/pl/overview/gems) or [spaces](https://docs.github.com/en/copilot/concepts/context/spaces)) without the tedious copy and paste!
1515

16-
**Construct coding prompts for...**
17-
18-
- Chatbots—_[Gemini](https://gemini.google.com/app), [ChatGPT](https://chatgpt.com/), [Claude](https://claude.ai/), [Grok](https://grok.com/), [DeepSeek](https://chat.deepseek.com/), etc._
19-
- 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._
20-
21-
**Apply responses**—multi-file edits integration with automatic checkpoints \
16+
💅 **Apply responses**—multi-file edits integration with automatic checkpoints \
2217
🌱 **Sustainable**—first-class support for [context caching](https://ai.google.dev/gemini-api/docs/caching) across tasks \
2318
🤙 **Fully-featured**—code at cursor, commit messages \
2419
**Privacy-first**[strict zero telemetry policy](https://github.com/robertpiosik/CodeWebChat/blob/dev/PRIVACY.md)
@@ -37,13 +32,11 @@ When pair programming with Code Web Chat, you foster codebase understanding to p
3732
3833
## Enabling autofill in chatbots
3934

40-
Start using [projects](https://help.openai.com/en/articles/10169521-projects-in-chatgpt) (also called [gems](https://gemini.google/pl/overview/gems) or [spaces](https://docs.github.com/en/copilot/concepts/context/spaces)) without the tedious copy and paste!
35+
The browser extension simplifies the workflow but is not a prerequisite. You can still copy and paste.
4136

4237
- [Chrome Web Store](https://chromewebstore.google.com/detail/code-web-chat-connector/ljookipcanaglfaocjbgdicfbdhhjffp)
4338
- [Firefox Add-ons](https://addons.mozilla.org/en-US/firefox/addon/code-web-chat-connector/)
4439

45-
Like all of CWC, the browser extension is [open-source](https://github.com/robertpiosik/CodeWebChat/blob/dev/packages/browser) and works with minimal permissions for your absolute privacy and security.
46-
4740
**List of supported chatbots:**
4841

4942
- AI Studio
@@ -67,10 +60,10 @@ Like all of CWC, the browser extension is [open-source](https://github.com/rober
6760
- Z AI
6861

6962
> [!IMPORTANT]
70-
> In respect to chatbot's Terms of Use, a prompt autofill is all the extension does automatically. Furthermore, the _Apply response_ button placed under responses is not a means of automatic output extraction, it's an alias for the original _copy to clipboard_ button. Review the [content script](https://github.com/robertpiosik/CodeWebChat/blob/dev/apps/browser/src/content-scripts/send-prompt-content-script/send-prompt-content-script.ts) for implementation details.
63+
> The _Apply response_ button placed under responses is not a means of automatic output extraction, it's an alias for the original _copy to clipboard_ button. Review the [content script](https://github.com/robertpiosik/CodeWebChat/blob/dev/apps/browser/src/content-scripts/send-prompt-content-script/send-prompt-content-script.ts) to learn implementation details.
7164
7265
> [!NOTE]
73-
> Use [port forwarding](https://code.visualstudio.com/docs/debugtest/port-forwarding) on port _55155_ when using remote machine via SSH.
66+
> Use [forwarding](https://code.visualstudio.com/docs/debugtest/port-forwarding) of port _55155_ when using remote machine via SSH.
7467
7568
## API tools for common tasks
7669

apps/editor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "gemini-coder",
33
"displayName": "Code Web Chat",
44
"description": "Connect VS Code with chatbots (CWC)",
5-
"version": "1.804.0",
5+
"version": "1.805.0",
66
"scripts": {
77
"build": "npx vsce package --no-dependencies",
88
"vscode:prepublish": "rimraf out && npm run compile",

apps/editor/src/commands/apply-chat-response-command/utils/diff-processor/diff-processor.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,19 @@ describe('diff-processor', () => {
5656

5757
expect(result).toBe(expected)
5858
})
59+
60+
it('applies diff with generic test case correctly', async () => {
61+
const test_case = 'generic-1'
62+
const original = load_test_case_file('', test_case, 'original.txt')
63+
const diff = load_test_case_file('', test_case, 'diff.txt')
64+
const expected = load_test_case_file('', test_case, 'expected.txt')
65+
66+
const result = apply_diff({
67+
original_code: original,
68+
diff_patch: diff
69+
})
70+
71+
expect(result).toBe(expected)
72+
})
5973
})
6074
})

0 commit comments

Comments
 (0)