Skip to content

Unify source navigation and handle generated Java constructs - #39

Merged
Pelotrio merged 2 commits into
1.21.1from
codex/shared-source-navigation
Sep 14, 2026
Merged

Pelotrio merged 2 commits into
1.21.1from
codex/shared-source-navigation

Conversation

@Pelotrio

Copy link
Copy Markdown
Member

Find Usages could find bytecode members that have no explicit declaration in decompiled Java, then throw when opening them. This replaces the separate navigation, MCP, and debugger lookups with a shared SourceDocument backed by stock Vineflower symbol metadata, JDT structure, and the existing line mappings.

The resolver finds visible occurrences and declarations, maps record accessors and supported lambdas to their source constructs, and falls back to the owning class when provenance is unavailable or ambiguous. Exact MCP member requests and debugger breakpoint validation retain their stricter guarantees.

Constructor usages search the constructor body first, then the current type's instance fields and initializer blocks. Constructors that delegate through this(...) do not search the target constructor's initialization. Static initializers and nested lambda/class bodies remain separate.

Source metadata is prepared on the existing loading workers before publication to Swing and persists with its matching source. Anonymous member identities establish their owning class, and ConstantValue metadata distinguishes constant fields from executable final-field initializers.

Validation:

  • All 617 Companion tests passed on this PR branch, with no failures or skips.
  • Compiled Java fixtures cover overloads, records, annotations, nested/anonymous classes, constructor chaining, and lambda provenance, with and without debug metadata and after cache reload.
  • Replayed all 44 Keyframe usage results from a saved runtime: 26 source occurrences, 8 related constructs, and 10 class fallbacks; no navigation errors.
  • Independent standards and behavior reviews completed. All three findings were fixed and rechecked.

Code footprint relative to 1.21.1:

  • Production: 749 lines added, 882 removed, net -133.
  • Tests and fixtures: 558 lines added, 42 removed, net +516.
  • Removes SourceFileNavigation and SourceReferenceLocator and consolidates their consumers' duplicated lookup logic.

Generated record methods, array-constructor helpers without provenance, and other erased or ambiguous constructs retain class fallbacks. This change does not modify Vineflower or include the separate editor-tab work.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-14T22:26:14.560615Z 0c8824b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Pelotrio
Pelotrio merged commit 2ea7e55 into 1.21.1 Sep 14, 2026
2 checks passed
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.

1 participant