-
Notifications
You must be signed in to change notification settings - Fork 1.5k
ghost: refactor sending accepted/dismissed telemetry and minor fixes #2639
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR refactors the ghost text completion system to remove the command-based approach for handling accepted/dismissed telemetry in favor of a more direct approach using the handleEndOfLifetime lifecycle method.
Key Changes
- Removed the command-based acceptance flow (
_github.copilot.ghostTextPostInsert2) in favor of handling acceptance directly inhandleEndOfLifetime - Introduced typed interfaces (
GhostTextCompletionItem,GhostTextCompletionList) to store completion metadata directly rather than in command arguments - Fixed the type signature for partial acceptance from the incorrect intersection type
number & PartialAcceptInfoto the correct union typenumber | PartialAcceptInfo - Refactored survey signal usage to call
ISurveyService.signalUsage()directly instead of via command execution - Improved error reporting by correcting exception handler method names
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/extension/survey/vscode-node/surveyCommands.ts | Exported the survey command ID constant (no longer used elsewhere after refactoring) |
| src/extension/completions-core/vscode-node/extension/src/inlineCompletion.ts | Updated to use new GhostTextCompletionItem type, fixed type signature for partial accept, and corrected error messages in exception handlers |
| src/extension/completions-core/vscode-node/extension/src/ghostText/ghostText.ts | Major refactoring: removed command-based approach, added typed interfaces, moved telemetry handling to handleEndOfLifetime with a switch statement on reason kinds, and integrated direct survey service calls |
| src/extension/completions-core/vscode-node/completionsServiceBridges.ts | Removed the now-obsolete registerGhostTextDependencies function call that was registering the command |
src/extension/completions-core/vscode-node/extension/src/ghostText/ghostText.ts
Show resolved
Hide resolved
src/extension/completions-core/vscode-node/extension/src/ghostText/ghostText.ts
Outdated
Show resolved
Hide resolved
…stead of accessing it from command arguments
1f043d6 to
38debc5
Compare
No description provided.