Repository navigation
Conversation
…low the End key Fixes continuedev#12302
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
This branch has not been deployed
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.
Fixes #12302
What was wrong
In the IntelliJ plugin, pressing
Enddid nothing when Continue's autocomplete had returned a blank suggestion. Repro from the issue:.tomlfile[some_heading<caret>]EndExpected: the caret moves to the end of the line. Actual: nothing happens — Continue swallows the keypress even though no suggestion is visible.
Root cause
Two places could produce a blank suggestion, and the platform treats any returned suggestion — even one with an empty gray-text element — as an active suggestion, so its inline-completion handler intercepts
End(accept-to-end-of-line) instead of letting the editor handle it:ContinueCompletionService.getAutocompletereturned""(notnull) when the core response carried no content, and the provider only checked fornull, so it builtInlineCompletionSingleSuggestionwith an emptyInlineCompletionGrayTextElement.checkFimcan yield an emptyfimTextwhen the suggested edit is identical to the existing text, and the provider rendered that as a gray-text suggestion too.No End-key handling exists in the plugin's own code (verified by searching the whole
extensions/intellijtree) — the interception comes from the platform once a suggestion object exists, so the fix is to never surface a blank suggestion.Changes
ContinueInlineCompletionProvider.kt: returnInlineCompletionSuggestion.Emptywhen the traditional autocomplete variant is null or blank, and when the NextEdit FIM text is blank.ContinueCompletionService.kt: returnnullinstead of""when the core response has no completion content, so "no completion" is signalled the way theCompletionServicecontract intends.ContinueInlineCompletionProviderTest.kt: two new tests using the issue's exact repro ([some_heading<caret>]+EditorLineEnd): a blank suggestion and a whitespace-only suggestion must both letEndmove the caret to the end of the line.Verification
Honest note: I could not run the plugin test suite here — this environment has no JDK at all (and
apt-getcould not install one), and the IntelliJ tests need the Gradle + IDE sandbox, so the new tests have not been executed and fail-before has not been observed in this environment. The tests follow the existingtestInlineCompletionpatterns in the same file and exercise the exact repro from the issue; please let CI run them. The fix itself was verified by code inspection: the only two paths that build a gray-text suggestion are now guarded, andgetAutocompletehas no other caller besides the provider.