Skip to content

Refactor Autocomplete code structure#156

Merged
gregorriegler merged 1 commit intomainfrom
refactor-autocomplete-12702161142593091071
Dec 31, 2025
Merged

Refactor Autocomplete code structure#156
gregorriegler merged 1 commit intomainfrom
refactor-autocomplete-12702161142593091071

Conversation

@google-labs-jules
Copy link
Copy Markdown
Contributor

Refactored the autocomplete package to improve modularity and maintainability.
Previously, autocompletion.py contained a mix of domain objects, protocols, strategies, and engines.
This change splits the code into focused modules:

  • domain.py: Holds Value Objects and Data Transfer Objects.
  • protocols.py: Defines Interfaces.
  • slash_commands.py & file_search.py: Contain specific implementation strategies.
  • engines.py: Contains composition logic.
  • __init__.py: Serves as the package entry point.

Also introduced FileReference to centralize the logic for the [📦filename] marker.
Verified with existing tests.


PR created automatically by Jules for task 12702161142593091071 started by @gregorriegler

…ing.

- Extracted domain objects (WordAtCursor, CursorAndLine, MessageDraft, CompletionResult, Suggestion, SuggestionList, FileReference) to `domain.py`.
- Split strategy implementations into `slash_commands.py` and `file_search.py`.
- Defined protocols in `protocols.py`.
- Moved orchestration engines (CompositeAutocompleter, NullAutocompleter) to `engines.py`.
- Created `__init__.py` to export the public API of the `autocomplete` package.
- Updated consumers to import from the package root.
- Introduced `FileReference` Value Object to encapsulate file marker format logic.
@google-labs-jules
Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@gregorriegler gregorriegler marked this pull request as ready for review December 31, 2025 16:11
@gregorriegler gregorriegler merged commit 857f777 into main Dec 31, 2025
3 checks passed
@gregorriegler gregorriegler deleted the refactor-autocomplete-12702161142593091071 branch December 31, 2025 16:11
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.

1 participant