Skip to content

feat: rank completion candidates by dependency provenance#218

Merged
AJenbo merged 2 commits into
mainfrom
calebdw/push-xqxxkqnnukzw
Jul 10, 2026
Merged

feat: rank completion candidates by dependency provenance#218
AJenbo merged 2 commits into
mainfrom
calebdw/push-xqxxkqnnukzw

Conversation

@calebdw

@calebdw calebdw commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Class, function, and constant completions are now sorted by origin:

  1. project code
  2. core/stub symbols
  3. explicit Composer dependencies (require / require-dev)
  4. transitive vendor dependencies

The provenance is inferred during indexing from composer.json's require/require-dev sections and vendor/composer/installed.json package roots. A shared ClassCompletionOrigin enum and sort helper avoid duplicating ranking logic across the three symbol kinds.

New fields on Backend: fqn_origin_index, autoload_function_origin_index, autoload_constant_origin_index, vendor_package_origin_roots. The classmap_scanner now tracks per-package origins during vendor scanning and exposes them in WorkspaceScanResult.

Closes #183

@calebdw calebdw force-pushed the calebdw/push-xqxxkqnnukzw branch from 5cd03d2 to cfa3f3c Compare July 10, 2026 02:29
@calebdw calebdw requested a review from AJenbo July 10, 2026 02:29
@calebdw calebdw force-pushed the calebdw/push-xqxxkqnnukzw branch from cfa3f3c to 73ece8f Compare July 10, 2026 02:33
@codecov-commenter

codecov-commenter commented Jul 10, 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 89.13858% with 29 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/classmap_scanner.rs 85.15% 19 Missing ⚠️
src/lib.rs 81.48% 10 Missing ⚠️

📢 Thoughts on this report? Let us know!

Class, function, and constant completions are now sorted by origin:
  1. project code
  2. core/stub symbols
  3. explicit Composer dependencies (require / require-dev)
  4. transitive vendor dependencies

The provenance is inferred during indexing from composer.json's
require/require-dev sections and vendor/composer/installed.json
package roots. A shared ClassCompletionOrigin enum and sort helper
avoid duplicating ranking logic across the three symbol kinds.

New fields on Backend: fqn_origin_index, autoload_function_origin_index,
autoload_constant_origin_index, vendor_package_origin_roots. The
classmap_scanner now tracks per-package origins during vendor scanning
and exposes them in WorkspaceScanResult.

Closes #183
@calebdw calebdw force-pushed the calebdw/push-xqxxkqnnukzw branch from 73ece8f to 1fcf154 Compare July 10, 2026 03:15
@AJenbo AJenbo merged commit b67ad0d into main Jul 10, 2026
7 checks passed
@AJenbo AJenbo deleted the calebdw/push-xqxxkqnnukzw branch July 10, 2026 09:39
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.

Prioritise + Filter completion candidates based on explicit dependencies

3 participants