ADFA-5048 (3/5): Split the region analysis primitives into one file per concern - #1819
Open
Daniel-ADFA wants to merge 1 commit into
Open
Conversation
The three concerns extract method's analysis needs before it can derive a signature, each independent of the others and of the plan model: - AnchorMember.kt - the class member the new method becomes a sibling of. "Nearest ancestor that is a direct member of a ClassTree" covers method, constructor, initializer and field uniformly, and decides `static`. - RegionReferences.kt - what the region names: every identifier in source order, which of those are locals declared inside the anchor but outside the region (the future parameters), and whether the region reassigns one it does not declare. - RegionTypes.kt - rendering a type as source, shortened only where the file already resolves the short form, plus the two shapes that cannot be written out: a local or anonymous class, and a type variable owned by the anchor. Split into three files rather than one because they only meet in the entry point that follows, and 1000 lines in one file is not reviewable. No caller yet; the analysis that uses them lands next.
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.
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.
Stack 3 of 5 for ADFA-5048. Base: #1818. Mechanical split, no logic change; no caller until PR 4.
Splits the analysis primitives out of what would otherwise be a single 1000-line file, one file per concern, where a concern is a set of functions that only meet at the entry point:
AnchorMember.kt- where the new declaration goes, and whether it must be static.RegionReferences.kt- what the region names, which of those are captures, and what it reassigns.RegionTypes.kt- rendering a type as source, and the shapes that cannot be written out.The functions are moved verbatim by a block parser rather than retyped, so no comment is orphaned and no import dropped.
privatewas promoted tointernalonly for the symbols now referenced across a file boundary;isStaticMemberandMAX_TYPE_DEPTHstayed private.This branch compiles on its own (
:lsp:java:compileV8DebugKotlin), which is the point of cutting here.