Skip to content

fix(indexing): keep resource startup progress moving - #408

Open
sidux wants to merge 19 commits into
PHPantom-dev:mainfrom
sidux:fix/indexing-resource-startup-progress
Open

sidux wants to merge 19 commits into
PHPantom-dev:mainfrom
sidux:fix/indexing-resource-startup-progress

Conversation

@sidux

@sidux sidux commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • count autoload files only after parsing finishes
  • give framework resource discovery and indexing a visible, counted startup phase
  • build one line-offset index per resource instead of rescanning from the start for every match

Why

Startup could appear frozen while expensive work continued behind a percentage that no longer described the active phase. Large configuration files also paid repeatedly to convert byte offsets into line and column positions. Reporting completed work and reusing one line index makes progress smoother and removes avoidable repeated scanning.

Dependencies

Validation

  • cargo test --all-targets on this branch and its semantic-indexing successor
  • cargo clippy --fix --allow-dirty -- -D warnings
  • cargo fmt

@codecov-commenter

codecov-commenter commented Aug 27, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 83.21460% with 377 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/framework.rs 84.71% 168 Missing ⚠️
src/code_lens.rs 85.29% 101 Missing ⚠️
src/definition/resolve.rs 32.60% 31 Missing ⚠️
src/references/dispatch.rs 38.46% 24 Missing ⚠️
src/rename/prepare.rs 77.77% 22 Missing ⚠️
src/backend/documents.rs 20.00% 12 Missing ⚠️
src/references/member_scope.rs 95.19% 10 Missing ⚠️
src/indexing/watch.rs 33.33% 8 Missing ⚠️
src/backend/startup.rs 91.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

sidux added 7 commits August 30, 2026 17:12
Use the coarse reference index for conclusive zero counts and cache bounded exact member locations for non-zero lenses. Refresh-capable clients avoid eager resolve storms while older clients retain lazy resolution.
Stop reference counts and CodeLens resolves from repeating the full workspace walk for every declaration. Internal annotation requests share the initial index, including callers queued behind it, while an explicit Find References command keeps its single refresh for files created without watcher notifications.
@sidux
sidux force-pushed the fix/indexing-resource-startup-progress branch from 5b1be6f to e561797 Compare August 30, 2026 15:33
sidux added 10 commits August 30, 2026 17:40
Resolve fully-qualified classes and Class::member references from arbitrary YAML and XML positions without schema-specific rules.
Feed schema-free class and member occurrences into Find References and CodeLens, including transparent-proxy metadata aliases.
Index semantic framework relationships alongside generic YAML and XML class references.
Pass every indexed target to editor-native navigation and ignore empty PHP resource strings.
Generic YAML and XML navigation now returns early only when it resolves a PHP symbol. Otherwise the semantic Symfony resolver still handles aliases, form fields, validation mappings, and configuration keys.
Build entity-to-repository pairs alongside the framework resource index and update them per URI. CodeLens and reference lookups now read the derived index instead of reopening and rescanning every YAML/XML resource for each declaration.
@sidux
sidux force-pushed the fix/indexing-resource-startup-progress branch from e561797 to 7370ea9 Compare August 30, 2026 15:54
@sidux sidux mentioned this pull request Aug 30, 2026
6 tasks
@AJenbo AJenbo added this to the Sprint 8 milestone Sep 8, 2026
sidux and others added 2 commits September 28, 2026 10:27
The reference CodeLens and YAML/XML navigation this branch was built on
landed upstream (PHPantom-dev#392, PHPantom-dev#394) and were reworked there, so this applies
only the branch's own changes on top of main.

- Member-scope resolution moved to references/member_scope.rs; the
  Doctrine getRepository() receiver resolution now lives there, using
  the namespace-aware use map, and framework member lookups filter
  through MemberScope.
- Document open/change/close and startup indexing moved to
  backend/documents.rs and backend/startup.rs; the framework resource
  index hooks follow them. YAML/XML watchers already exist upstream.
- Code lenses use the request's LineIndex; the framework method lens
  skips methods no resource names and builds its class scope once.
- Rename keeps working across file types: YAML/XML class and namespace
  occurrences are rewritten by the framework index in each document's
  own spelling and verified one by one, so an escaped name can no longer
  cancel a rename. A rename started in a resource renames the PHP
  declaration it names.
- Fix namespace segment indexing for escaped (App\\Domain) and rooted
  (\App\Domain) spellings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tartup-progress

Brings in main through the updated framework-resource-navigation branch.

- The progress hand-off follows startup indexing to backend/startup.rs,
  where the framework resource walk now runs on a blocking thread like
  the other startup indexes instead of on the async runtime.
- The preload counter moves after the parse inside upstream's parallel
  map, so reported progress never runs ahead of the work.

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

This branch has not been deployed

No deployments
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.

3 participants