Skip to content

Launch Inline Assist Commands (Ghost Writer) - Autocomplete v0.1 #1244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jul 17, 2025

Conversation

hassoncs
Copy link
Contributor

Introduces new translation keys for the "ghost" feature across all supported languages. It also updates existing translation keys related to commit message generation to use the new t() function for internationalization.

The changes include:

  • Adding ghost object with progress, input, commands, errors, codeAction, chatParticipant, and messages keys to all kilocode.json files.
  • Updating activationFailed and providerRegistered keys in various languages.
  • Integrating t() function calls in GhostCodeActionProvider, GhostModel, GhostProvider, and index.ts to use the new translation keys for UI elements and messages.
  • Renaming and re-categorizing commands in extension.json to match the rest## Context

Copy link

changeset-bot bot commented Jul 11, 2025

🦋 Changeset detected

Latest commit: 508a760

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
kilo-code Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@hassoncs hassoncs force-pushed the hassoncs/ghost-i18n-and-rule-loading branch from 893ddb6 to 1a6275b Compare July 11, 2025 06:27
@catrielmuller
Copy link
Contributor

@hassoncs Please don't merge this because the keybinding are not working properly. I'm investigating this issue

@hassoncs hassoncs changed the title Add ghost feature translations and update existing keys Launch Ghost Writer 'Quick Edit' Command - Autocomplete v0.1 Jul 14, 2025
Chris Hasson and others added 2 commits July 14, 2025 14:31
This commit enables the Ghost Writer feature by uncommenting its registration in `extension.ts`. It also introduces internationalization (i18n) support for all Ghost Writer related strings across multiple languages, including progress messages, input prompts, commands, and chat participant details.

The `package.json` is updated to include new commands, keybindings, code actions, and chat participant declarations for the Ghost Writer. The `GhostCodeActionProvider`, `GhostModel`, and `GhostProvider` classes are updated to use the new i18n strings and to properly initialize the `GhostProvider` with the extension context. The `GhostStrategy` is also updated to incorporate custom instructions into the system prompt.
* refactor: remove chat api definition

* feat: ghost navigation

* Update src/services/ghost/GhostProvider.ts

Co-authored-by: Copilot <[email protected]>

* feat: CodeLens indicator

* refactor: fix commands names

* refactor(ghost): rename haveSuggestions to hasSuggestions

Renames the `haveSuggestions` method and related context key to `hasSuggestions` for improved clarity and consistency. This change affects the GhostProvider, GhostSuggestions, and the `package.json` and `extension.json` files where the context key is used.

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Chris Hasson <[email protected]>
@hassoncs hassoncs force-pushed the hassoncs/ghost-i18n-and-rule-loading branch 2 times, most recently from e1326d7 to fc11235 Compare July 14, 2025 21:34
@hassoncs hassoncs marked this pull request as ready for review July 14, 2025 22:51
catrielmuller and others added 2 commits July 14, 2025 16:47
* refactor: implement fuzzy matching

* refactor: implement fuzzy matching with relative path
@hassoncs
Copy link
Contributor Author

we should rename this command so it shows up nicely in the UI:
CleanShot 2025-07-14 at 20 09 01

seeing this bug where edits that delete lines in succession end up removing the wrong lines- I think this is because the lines they need to remove change as earlier edits get applied. applying them all at once does not seem to cause the bug
2025-07-14 22 09 39

catrielmuller and others added 8 commits July 15, 2025 15:51
* refactor: fix codelens ranges, lock workspaces edits, update commands

* refactor: add translations of the new cmds

* refactor: move the cursor to follow the suggestions

* refactor: update the pending suggestion when we applied a single op group

* refactor: update the pending suggestion when we applied a single op group

* refactor: ghost render when active editor change

* refactor: correct typo in compute operations offset method

* refactor: simplify GhostProvider method calls

Removed unnecessary explicit object destructuring in method calls for `provideCodeSuggestions` and `enhanceContext` to improve readability and conciseness. Also removed redundant progress report messages.

---------

Co-authored-by: Chris Hasson <[email protected]>
* test(testing): add mock editor and workspace framework for services

Introduce a comprehensive mock testing framework to simulate the VS Code
editor and workspace environments. This allows for isolated and
deterministic unit testing of services that rely on VS Code APIs.

The new framework includes:
- `MockTextDocument`: Simulates document content, line/range operations.
- `MockTextEditor`: Encapsulates a document with cursor position.
- `MockWorkspace`: Manages a collection of mock documents.
- `MockWorkspaceEdit`: Simulates applying edits to the workspace.

This infrastructure will be used to build out robust tests for Ghost,
autocomplete, and other editor-aware services.

* test(ghost): add comprehensive test suite for ghost provider

This commit introduces a robust testing framework for the Ghost feature, centered around a new `MockWorkspace` that simulates the VS Code environment. This allows for isolated unit testing of the suggestion parsing and application logic.

The new test suite, `GhostProvider.spec.ts`, validates various scenarios:
- Simple line additions and deletions
- Mixed addition/deletion operations
- Complex diffs with multiple change hunks
- Sequential application of individual suggestions

A minor fix is also included in `GhostStrategy.ts` to handle file path URI parsing more robustly, ensuring that paths are correctly converted to URIs whether or not they already have a `file://` prefix.

* refactor: wip tests

* refactor: fix all existing tests

* refactor: fix random suggestion apply

* refactor(ghost): update default model to stable gemini-2.5-flash

* refactor: simplify the logic of apply changes

* refactor: fix triple slash

* fix: fix workspace edit lock

* Switch GhostProvider tests to be file based

---------

Co-authored-by: Chris Hasson <[email protected]>
Co-authored-by: Catriel Müller <[email protected]>
@hassoncs hassoncs changed the title Launch Ghost Writer 'Quick Edit' Command - Autocomplete v0.1 Launch Inline Assist Commands (Ghost Writer) - Autocomplete v0.1 Jul 17, 2025
@hassoncs hassoncs force-pushed the hassoncs/ghost-i18n-and-rule-loading branch from 252626d to 0ec2d1b Compare July 17, 2025 01:22
@hassoncs hassoncs force-pushed the hassoncs/ghost-i18n-and-rule-loading branch from 0ec2d1b to 508a760 Compare July 17, 2025 01:25
@hassoncs hassoncs merged commit 8b50f8e into main Jul 17, 2025
11 checks passed
@hassoncs hassoncs deleted the hassoncs/ghost-i18n-and-rule-loading branch July 17, 2025 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants