Commit 181088e
committed
Fix showRange field regression in InlineCompletionItem
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 #237532.
Fixes regression from commit b0abf06 (Refactors InlineCompletionsSource)
Restores functionality from commit a016c0b (Support show range for inline edits)1 parent 0a2707c commit 181088e
File tree
3 files changed
+19
-3
lines changed- src/vs/editor/contrib/inlineCompletions/browser/model
3 files changed
+19
-3
lines changedLines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
626 | 626 | | |
627 | 627 | | |
628 | 628 | | |
| 629 | + | |
629 | 630 | | |
630 | 631 | | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
631 | 638 | | |
632 | 639 | | |
633 | 640 | | |
| |||
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
307 | 308 | | |
308 | 309 | | |
309 | 310 | | |
310 | | - | |
| 311 | + | |
311 | 312 | | |
312 | 313 | | |
313 | 314 | | |
314 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
315 | 321 | | |
316 | 322 | | |
317 | 323 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
| 251 | + | |
251 | 252 | | |
252 | 253 | | |
253 | 254 | | |
| |||
318 | 319 | | |
319 | 320 | | |
320 | 321 | | |
| 322 | + | |
321 | 323 | | |
322 | 324 | | |
323 | 325 | | |
| |||
493 | 495 | | |
494 | 496 | | |
495 | 497 | | |
| 498 | + | |
496 | 499 | | |
497 | 500 | | |
498 | 501 | | |
| |||
0 commit comments