Skip to content

feat(indexing): add semantic indexing strategy - #409

Open
sidux wants to merge 18 commits into
PHPantom-dev:mainfrom
sidux:feat/indexing-semantic-strategy
Open

feat(indexing): add semantic indexing strategy#409
sidux wants to merge 18 commits into
PHPantom-dev:mainfrom
sidux:feat/indexing-semantic-strategy

Conversation

@sidux

@sidux sidux commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add semantic alongside the existing indexing strategies.
  • Keep the complete workspace symbol and reference index, then eagerly resolve member receivers in parallel.
  • Accept a session-scoped strategy through LSP initialization options and preserve it across config reloads.
  • Keep full focused on complete indexing without the additional CodeLens prewarm cost.
  • Document the mode in the schema, configuration guide, architecture, and changelog.

Why

A complete workspace index is necessary for exact cross-file navigation and references, but eagerly resolving every member relationship adds startup CPU and memory. Making that work an explicit semantic strategy gives large workspaces a clear choice: retain the default full startup profile, or spend more during indexing to make the first reference CodeLens and later member searches faster.

Validation

  • cargo test indexing_strategy — 9 passed
  • cargo test initialization_options_override_only_the_indexing_strategy
  • cargo test semantic_prewarm_builds_member_targets_before_the_first_lens
  • cargo clippy --all-targets -- -D warnings
  • cargo test — 14,184 passed, 12 ignored

Dependencies

This PR is stacked after #408 and uses the scalable reference CodeLens index from #392. GitHub will reduce the diff as the preceding PRs merge.

@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 85.33894% with 558 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/framework.rs 83.59% 176 Missing ⚠️
src/code_lens.rs 85.77% 133 Missing ⚠️
src/rename/prepare.rs 30.97% 78 Missing ⚠️
src/references/dispatch.rs 43.28% 38 Missing ⚠️
src/indexing/watch.rs 36.20% 37 Missing ⚠️
src/definition/resolve.rs 32.60% 31 Missing ⚠️
src/references/members.rs 94.32% 28 Missing ⚠️
src/reference_counts.rs 95.89% 18 Missing ⚠️
src/resource_navigation.rs 96.81% 8 Missing ⚠️
src/reference_index.rs 94.73% 6 Missing ⚠️
... and 3 more

📢 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 feat/indexing-semantic-strategy branch from 81e8ccd to 0c55ce7 Compare August 30, 2026 15:33
sidux added 11 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 feat/indexing-semantic-strategy branch from 0c55ce7 to dad4f97 Compare August 30, 2026 15:54
@sidux sidux mentioned this pull request Aug 30, 2026
6 tasks
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