-
Couldn't load subscription status.
- Fork 1.2k
refactor: update AutoTriggerStrategy.getPrompts API to accept AutocompleteInput #3189
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
Conversation
|
| } | ||
|
|
||
| // Add current position | ||
| if (context.range && context.document) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it removes these ifs, but i do not think they were ever necessary tbh
| return false | ||
| } | ||
|
|
||
| export function extractComment(document: TextDocument, currentLine: number): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated, but when i removed use of another import of autotrigger strategy i noticed this was unused as well
…pleteInput Changed the getPrompts method signature to align with autocomplete system architecture: - Now accepts AutocompleteInput, prefix, suffix, and languageId as separate parameters - Made GhostSuggestionContext optional since data is provided through other params - Updated all callers in GhostProvider, tests, and utilities This change extracts parts from PR #3102 to make the API more flexible and better aligned with the autocomplete input structure used throughout the system. Modified files: - src/services/ghost/strategies/AutoTriggerStrategy.ts - src/services/ghost/GhostProvider.ts - src/services/ghost/strategies/__tests__/AutoTriggerStrategy.test.ts - src/services/ghost/__tests__/GhostRecentOperations.spec.ts - src/services/ghost/__tests__/GhostModelPerformance.spec.ts - src/test-llm-autocompletion/strategy-tester.ts All tests passing (28/28)
Now the getPrompts methods actually use the AutocompleteInput parameter: - getUserPrompt uses autocompleteInput.recentlyEditedRanges and autocompleteInput.pos - getCommentsUserPrompt extracts comment from prefix instead of context.document - Both methods build code with cursor from prefix/suffix instead of document - Updated test to properly populate AutocompleteInput.recentlyEditedRanges This completes the refactoring to make the API truly independent of GhostSuggestionContext, using the autocomplete input structure instead.
…tPrompts() - Removed unused context?: GhostSuggestionContext parameter from getPrompts method - Updated all callsites in GhostProvider and test files - All tests passing (28 tests across 3 test files)
…lication - Replace manual AutocompleteInput conversion in GhostProvider with contextToAutocompleteInput helper - Update GhostRecentOperations test to use the helper function - Reduces ~30 lines of duplicated conversion logic - All 208 ghost service tests pass
53547b4 to
e1a89c2
Compare
Changed the getPrompts method signature to align with autocomplete system architecture:
This change extracts parts from PR #3102 to make the API more flexible and better aligned with the autocomplete input structure used throughout the system.