Skip to content

SymbolCandidates reads a symbol's documentation through the ResolvedSymbol::getDocumentation() interface method - #487

Merged
Firehed merged 5 commits into
mainfrom
step/29
Sep 3, 2026
Merged

SymbolCandidates reads a symbol's documentation through the ResolvedSymbol::getDocumentation() interface method#487
Firehed merged 5 commits into
mainfrom
step/29

Conversation

@Firehed

@Firehed Firehed commented Sep 3, 2026

Copy link
Copy Markdown
Owner

step-29 acceptance

  • SymbolCandidates does not name ->docblock or DocblockParser directly. Proof: grep -n 'docblock\|DocblockParser' src/Completion/SymbolCandidates.php returns nothing; PHPStan disallowedMethodCalls for DocblockParser::extractDescription (already scoped to HasSymbolLocation.php) drains the baseline entry that pointed at this file.
  • A future change to getDocumentation() (e.g. tag stripping) reaches completion detail the same way it reaches hover. Proof: SymbolCandidates::functionDetail calls $info->getDocumentation() — the same interface method ExpressionResolver reads (step-25) and the same one the step-30 presenter will normalise once for every surface.

Notes

  • ResolvedSymbol::getDocumentation() returns the raw docblock text. Completion documentation for user-defined functions now carries /** ... */ markers, matching hover's step-25 behaviour. The function-surface parity golden is recaptured to freeze that.
  • The baseline entry for SymbolCandidates.php flips from the extractDescription ban to the getDocumentation ban; step-30 (presenter) will absorb this and the other getDocumentation callers together. Total baseline count unchanged (5 → 5).

🤖 Written by AI, reviewed by human.

Firehed and others added 4 commits September 2, 2026 22:20
Route docblock access through the ResolvedSymbol interface method
instead of the raw ->docblock field and DocblockParser::extractDescription.
A future normalisation of getDocumentation (e.g. tag stripping) reaches
completion detail the same way it reaches hover.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Documentation for user-defined functions now carries the raw docblock,
matching hover's step-25 pattern. The step-30 presenter will strip
tags for both surfaces uniformly.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The extractDescription entry drained (SymbolCandidates no longer calls
it). The new getDocumentation entry is step-30 territory: the presenter
will absorb this and the other getDocumentation callers together.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.39%. Comparing base (f14027e) to head (409e913).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #487      +/-   ##
============================================
- Coverage     99.39%   99.39%   -0.01%     
+ Complexity     1865     1862       -3     
============================================
  Files           133      133              
  Lines          4788     4783       -5     
============================================
- Hits           4759     4754       -5     
  Misses           29       29              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Step-29 temporarily regresses the completion-detail output from
extracted description to raw docblock (see the function-surface parity
golden update on this branch). Extend step-30 to name the fix so the
regression is scheduled, not implicit: the presenter owns docblock text
preparation, and its Done clause pins the golden's `documentation`
fields back to extracted descriptions.

Notes that `getDocumentation()` must keep returning the raw docblock so
`ExpressionResolver`'s foreach element-type inference (which reads
`@var`) keeps working, so extraction lives at the presenter, not in
`HasSymbolLocation`.
@Firehed
Firehed marked this pull request as ready for review September 3, 2026 18:19
@Firehed

Firehed commented Sep 3, 2026

Copy link
Copy Markdown
Owner Author

Needs step 30 to land first to hit the exactly-described acceptance criteria; instead, taking the baseline trade and fast-following in the next step.

@Firehed
Firehed enabled auto-merge (squash) September 3, 2026 18:20
@Firehed
Firehed merged commit 7571daa into main Sep 3, 2026
9 checks passed
@Firehed
Firehed deleted the step/29 branch September 3, 2026 18:21
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