-
Notifications
You must be signed in to change notification settings - Fork 36.4k
Fix showRange field regression in InlineCompletionItem #279269
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?
Fix showRange field regression in InlineCompletionItem #279269
Conversation
|
@microsoft-github-policy-service agree |
|
@microsoft-github-policy-service agree company="Meta" |
1d84234 to
e4d827f
Compare
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 restores the showRange functionality for inline completions that was accidentally removed during the InlineCompletionsSource refactoring. The showRange field allows extensions to specify a range within which inline completions should be visible, hiding them when the cursor moves outside this range.
Key changes:
- Added
showRangeparameter toInlineSuggestDataconstructor and passed it through the data flow - Implemented
showRangevisibility check inInlineCompletionItem.isVisible() - Added cursor position validation against
showRangein the inline edit state computation
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.ts |
Added showRange field to InlineSuggestData constructor and passed it from InlineCompletion to InlineSuggestData in toInlineSuggestData() |
src/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.ts |
Added showRange getter to InlineSuggestionItemBase and implemented visibility check in InlineCompletionItem.isVisible() |
src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.ts |
Added cursor position check against showRange for inline edits in the state computation |
src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.ts
Show resolved
Hide resolved
e4d827f to
9df68fb
Compare
The showRange field in InlineCompletionItem (part of the inlineCompletionsAdditions proposed API) stopped working after the InlineCompletionsSource refactoring in commit b0abf06. While the field is still defined in the API and accepted from extensions, the implementation that checks cursor position against this range was removed. This commit restores the showRange functionality by: 1. Adding showRange field to InlineSuggestData constructor 2. Passing showRange from InlineCompletion to InlineSuggestData in toInlineSuggestData 3. Adding showRange getter to InlineSuggestionItemBase 4. Implementing showRange check in InlineCompletionItem.isVisible() method 5. Adding cursor position check against showRange in inlineCompletionsModel state computation The fix ensures that inline completions are only shown when the cursor is within the specified showRange (if provided), matching the original behavior from PR microsoft#237532. Fixes regression from commit b0abf06 (Refactors InlineCompletionsSource) Restores functionality from commit a016c0b (Support show range for inline edits)
60d5648 to
181088e
Compare
The showRange field in InlineCompletionItem (part of the inlineCompletionsAdditions proposed API) stopped working after the InlineCompletionsSource refactoring in commit b0abf06. While the field is still defined in the API and accepted from extensions, the implementation that checks cursor position against this range was removed.
See more detail: #279266
This commit restores the showRange functionality by:
The fix ensures that inline completions are only shown when the cursor is within the specified showRange (if provided), matching the original behavior from PR #237532.
Fixes regression from commit b0abf06 (Refactors InlineCompletionsSource) Restores functionality from commit a016c0b (Support show range for inline edits)