Skip to content

ADFA-3867: member completions do not show up without non-empty partial#1260

Merged
itsaky-adfa merged 1 commit intostagefrom
fix/ADFA-3867
Apr 28, 2026
Merged

ADFA-3867: member completions do not show up without non-empty partial#1260
itsaky-adfa merged 1 commit intostagefrom
fix/ADFA-3867

Conversation

@itsaky-adfa
Copy link
Copy Markdown
Contributor

@itsaky-adfa itsaky-adfa commented Apr 28, 2026

See ADFA-3867 for more details.

Signed-off-by: Akash Yadav <itsaky01@gmail.com>
@itsaky-adfa itsaky-adfa requested a review from a team April 28, 2026 17:32
@itsaky-adfa itsaky-adfa self-assigned this Apr 28, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

📝 Walkthrough

Walkthrough

A guard checking for blank partial identifiers in KotlinCompletions has been relocated from doComplete to collectScopeCompletions, allowing analysis context collection to proceed while preventing unnecessary scope completion generation under that condition.

Changes

Cohort / File(s) Summary
Kotlin Completion Guard Relocation
lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/KotlinCompletions.kt
Moved blank partial identifier check from doComplete method to collectScopeCompletions method with warning log; other completion paths unaffected.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A guard hops to a new post,
Where scope completions matter most—
No early exit, just a peek,
Before the blank partials wreak havoc next week! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: member completions are now available even without a non-empty partial identifier, which aligns with the summary showing scope-completion guards were moved to prevent early abort.
Description check ✅ Passed The description references the associated Jira ticket ADFA-3867 which provides context for the changes, though minimal details are included in the PR description itself.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ADFA-3867

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/KotlinCompletions.kt (1)

292-295: Remove the redundant blank-partial early return in scope completions.

This guard is now redundant and can unnecessarily suppress scope/snippet/keyword completions if upstream filtering regresses; better to rely on the existing upstream invariant here.

♻️ Proposed cleanup
-	if (ctx.partial.isBlank()) {
-		logger.warn("cannot complete for blank partial candidate")
-		return
-	}
-
 	abortIfCancelled()

Based on learnings: empty-prefix completion requests are already filtered upstream in this project, so no empty-prefix guard is needed at this call site.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/KotlinCompletions.kt`
around lines 292 - 295, The early-return guard in KotlinCompletions.kt that
checks ctx.partial.isBlank() and logs via logger.warn should be removed because
empty-prefix filtering is handled upstream; delete the if-block that references
ctx.partial.isBlank(), logger.warn("cannot complete for blank partial
candidate"), and the subsequent return so scope/snippet/keyword completions are
not suppressed here (locate the check inside the scope completion path in
KotlinCompletions.kt and remove those three statements).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/KotlinCompletions.kt`:
- Around line 292-295: The early-return guard in KotlinCompletions.kt that
checks ctx.partial.isBlank() and logs via logger.warn should be removed because
empty-prefix filtering is handled upstream; delete the if-block that references
ctx.partial.isBlank(), logger.warn("cannot complete for blank partial
candidate"), and the subsequent return so scope/snippet/keyword completions are
not suppressed here (locate the check inside the scope completion path in
KotlinCompletions.kt and remove those three statements).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7b030138-9847-4bdc-94a0-454d6e60296b

📥 Commits

Reviewing files that changed from the base of the PR and between feb0eea and 0d13071.

📒 Files selected for processing (1)
  • lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/completion/KotlinCompletions.kt

@itsaky-adfa itsaky-adfa merged commit 14898ac into stage Apr 28, 2026
2 checks passed
@itsaky-adfa itsaky-adfa deleted the fix/ADFA-3867 branch April 28, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants