Skip to content

ADFA-5048 (3/5): Split the region analysis primitives into one file per concern - #1819

Open
Daniel-ADFA wants to merge 1 commit into
feat/ADFA-5048-extraction-regionfrom
feat/ADFA-5048-region-analysis-primitives
Open

ADFA-5048 (3/5): Split the region analysis primitives into one file per concern#1819
Daniel-ADFA wants to merge 1 commit into
feat/ADFA-5048-extraction-regionfrom
feat/ADFA-5048-region-analysis-primitives

Conversation

@Daniel-ADFA

@Daniel-ADFA Daniel-ADFA commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

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. private was promoted to internal only for the symbols now referenced across a file boundary; isStaticMember and MAX_TYPE_DEPTH stayed private.

This branch compiles on its own (:lsp:java:compileV8DebugKotlin), which is the point of cutting here.

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.

@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.

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