Repository navigation
ADFA-7267 AI-Code-Suggestions: cancel the pending suggestion when the word is gone - #177
Open
davidschachterADFA wants to merge 1 commit into
Open
davidschachterADFA wants to merge 1 commit into
davidschachterADFA wants to merge 1 commit into
Conversation
… word is gone Typing "fun" and then a space showed a suggestion for "fun" after the space. An edit that left no word of 2+ letters before the cursor returned before cancelling the request started for the previous word, so that request ran 0.8 s later and showed its suggestion. Every edit now cancels the pending request first. Adds the plugin's first unit tests: a word still gets a suggestion, and neither a space nor a one-letter word after "fun" sends "fun" to the model. Both of those fail without the fix. Also raises plugin.max_ide_version from 26.30 to 26.99, like AI-Core and the other first-party plugins: the plugin review failed rubric 6.1 because the declared range excluded the current release (26.47). Version 1.1.0 -> 1.1.1 (versionCode 2 -> 3). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Vh2DAZWMkFWJh7CY7P4kCH
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.
ADFA-7267
Problem. Typing
funand then a space could show a suggestion forfunwith the cursor already past the space.CodeSuggestionsPlugin.onEditorContentChangedreturned early when no word of 2+ letters was left before the cursor (:136), before it cancelled the pending request (:143). The request started forfuntherefore still ran 0.8 s later and showed its suggestion. A one-letter word afterfundid the same. Found by reading the code.Fix. Every edit now cancels the pending request first, then either dismisses (no word to complete) or starts a new one.
Also in this PR: IDE range. The plugin review (
.claude/skills/plugin-review) failed rubric 6.1:plugin.max_ide_versionwas 26.30, and the current release is 26.47. It is now 26.99, like AI-Core and the other first-party plugins. Code on the Go reads this value but doesn't enforce it today, so installs were not blocked.plugin.min_ide_versionstays 26.17.Tests: the plugin's first unit tests,
CodeSuggestionsPluginTest, drive the plugin through its content-change listener with a fake editor and a fake LLM:funthenfunnever sendsfunto the model, and nothing is shown;funthenfun x(a one-letter word) likewise.Before the fix, the last two failed: the model was asked about
funat about 0.8 s. After it, all three pass. They use real time, so the two cancel tests wait 2 s each. CI does not run plugin unit tests; run them with./gradlew testDebugUnitTestinplugins/AI-Code-Suggestions.Checks at 8d2dcd4:
testDebugUnitTest,assemblePlugin(no warnings) andaddons checkpass. The plugin review passes every clause. Build security audit: nothing found. The.cgprecords revision8d2dcd4f5068(not dirty) and an IDE range of 26.17 to 26.99.Not covered. A request already past its last cancellation check (between
ensureActive()andshowInlineSuggestion) can still show its suggestion. The window is microseconds.Version: 1.1.0 / versionCode 2 → 1.1.1 / versionCode 3 (PATCH).
Not yet verified on a device. A retest on a Galaxy Note 20 is planned: the current build first, to see whether suggestions appear at all (the one earlier check was invalid), then this build.
Screens: no layout change.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Vh2DAZWMkFWJh7CY7P4kCH