Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the diagnostics-based inline edit provider to improve state management and cancellation handling. The changes replace a polling-based approach with an event-driven model using workInProgress tracking and the raceCancellation utility.
Key Changes:
- Introduced
workInProgressfield to track async operation state across the diagnostics completion system - Refactored
runUntilNextEditto use event-driven waiting instead of polling viagetNextUpdatedState - Enhanced timeout logic for diagnostics provider to calculate remaining time dynamically
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| inlineCompletionProvider.ts | Added clamp import and improved diagnostics timeout calculation to respect remaining request time |
| diagnosticsInlineEditProvider.ts | Added workInProgress tracking, refactored runUntilNextEdit to use raceCancellation with event listeners, made getNextEdit throw error |
| diagnosticsCompletionProcessor.ts | Added workInProgress field to state, simplified _getDiagnostics return type, removed getNextUpdatedState method, refactored AsyncWorker to track work-in-progress state |
| diagnosticsCompletions.ts | Added toString method to DiagnosticCompletionItem for better debugging |
src/extension/inlineEdits/vscode-node/features/diagnosticsInlineEditProvider.ts
Show resolved
Hide resolved
src/extension/inlineEdits/vscode-node/features/diagnosticsInlineEditProvider.ts
Show resolved
Hide resolved
src/extension/inlineEdits/vscode-node/features/diagnosticsCompletionProcessor.ts
Show resolved
Hide resolved
DonJayamanne
approved these changes
Jan 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Copilot Generated Description:Update import statements and enhance theDiagnosticsNextEditProviderclass to improve handling of diagnostic edits, including better cancellation logic and state management. Add atoStringmethod forDiagnosticCompletionItem.