Skip to content

ADFA-4612: Add code action to implement abstract members#1546

Open
itsaky-adfa wants to merge 3 commits into
stagefrom
feat/ADFA-4612
Open

ADFA-4612: Add code action to implement abstract members#1546
itsaky-adfa wants to merge 3 commits into
stagefrom
feat/ADFA-4612

Conversation

@itsaky-adfa

@itsaky-adfa itsaky-adfa commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Jira: ADFA-4612

What & why

On a concrete class/object that does not implement all required members, adds a code action that generates override stubs for the abstract functions and properties. Diagnostic-free: recomputes from the enclosing declaration via a fresh analysis session (no dependency on diagnostics).

Stub text is emitted fully indented (code-action edits bypass the editor's auto-indent), with the indent unit detected from context (existing members, else the file's predominant indent, else a tab). Handles generics with bounds, multiple supertypes (collapsed to one signature), extension receivers, and varargs. Bodies use TODO("Not yet implemented").

Tests

:lsp:kotlin:testV7DebugUnitTest - AbstractMemberStubsTest + ImplementMembersEndToEndTest green (functions, val/var properties, generics incl. bounded, suspend, multiple supertypes, already-implemented no-op, and exact resulting-text insertion cases). :lsp:kotlin:assembleV8Debug builds. Spotless can't run in the worktree; formatting hand-verified.

Notes

The action is always-visible (like OrganizeImportsAction); computing applicability precisely would need an analysis session, too costly for a synchronous visibility gate. Only cross-branch overlap is the KotlinCodeActionsMenu list append (trivial keep-both).

On a concrete class or object, generate override stubs for the abstract
functions and properties that must be implemented. Diagnostic-free: recomputes
from the enclosing declaration via a fresh analysis session. Stub text is fully
indented with the indent unit detected from context (existing members, else the
file's predominant indent, else a tab), and handles generics, multiple
supertypes, extension receivers and varargs. Adds AbstractMemberStubsTest and
ImplementMembersEndToEndTest.
@itsaky-adfa itsaky-adfa self-assigned this Jul 17, 2026

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@itsaky-adfa
itsaky-adfa requested a review from a team July 17, 2026 14:33
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@itsaky-adfa, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 35 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e8007401-87c9-4ade-83dd-3fa8bb643101

📥 Commits

Reviewing files that changed from the base of the PR and between 8077407 and 4cd34d6.

📒 Files selected for processing (6)
  • lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/KotlinCodeActionsMenu.kt
  • lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/actions/ImplementMembersAction.kt
  • lsp/kotlin/src/main/java/com/itsaky/androidide/lsp/kotlin/utils/AbstractMemberStubs.kt
  • lsp/kotlin/src/test/java/com/itsaky/androidide/lsp/kotlin/utils/AbstractMemberStubsTest.kt
  • lsp/kotlin/src/test/java/com/itsaky/androidide/lsp/kotlin/utils/ImplementMembersEndToEndTest.kt
  • resources/src/main/res/values/strings.xml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ADFA-4612

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.

Signed-off-by: Akash Yadav <akashyadav@appdevforall.org>
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.

2 participants