ADFA-4612: Add code action to implement abstract members#1546
ADFA-4612: Add code action to implement abstract members#1546itsaky-adfa wants to merge 3 commits into
Conversation
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.
There was a problem hiding this comment.
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.
|
Warning Review limit reached
Next review available in: 35 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Signed-off-by: Akash Yadav <akashyadav@appdevforall.org>
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+ImplementMembersEndToEndTestgreen (functions, val/var properties, generics incl. bounded, suspend, multiple supertypes, already-implemented no-op, and exact resulting-text insertion cases).:lsp:kotlin:assembleV8Debugbuilds. 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 theKotlinCodeActionsMenulist append (trivial keep-both).