feat(composer): add PHP/Composer ecosystem support#75
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class PHP/Composer support to deps-lsp by introducing a new deps-composer crate and wiring it into the LSP’s ecosystem registry.
Changes:
- Introduce
deps-composercrate (composer.json parser with position tracking, Packagist registry client, Composer constraint formatting/matching, composer.lock parsing). - Register the new ecosystem in
deps-lspand enable it by default via Cargo features. - Update workspace manifests/lockfile to include the new crate.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/deps-lsp/src/lib.rs | Declares and registers the new composer ecosystem behind a feature flag. |
| crates/deps-lsp/Cargo.toml | Adds deps-composer optional dependency and enables composer in default features. |
| crates/deps-composer/src/lib.rs | Exposes the public surface for the Composer ecosystem crate. |
| crates/deps-composer/src/ecosystem.rs | Implements Ecosystem for Composer and hooks up parsing/registry/completions/lockfile provider. |
| crates/deps-composer/src/parser.rs | Parses composer.json and tracks LSP ranges for dependency names/versions (filters platform packages). |
| crates/deps-composer/src/registry.rs | Implements Packagist v2 registry/search client and expands minified metadata. |
| crates/deps-composer/src/formatter.rs | Adds Composer-specific requirement matching and formatting behavior. |
| crates/deps-composer/src/lockfile.rs | Parses composer.lock into ResolvedPackages. |
| crates/deps-composer/src/types.rs | Defines dependency/version/metadata types and trait impls for deps-core integration. |
| crates/deps-composer/src/error.rs | Defines Composer-specific errors and conversion to deps_core::DepsError. |
| crates/deps-composer/Cargo.toml | New crate manifest and dependencies. |
| Cargo.toml | Adds deps-composer to workspace dependencies. |
| Cargo.lock | Records the new crate in the workspace lockfile. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add deps-composer crate implementing Packagist registry integration with Composer v2 metadata de-minification, composer.json parser with position tracking, composer.lock support, and Composer-specific version constraint matching (tilde, caret, wildcard, OR operators).
925d133 to
3b3f4d7
Compare
- Fix abandoned flag: treat only `true` or string as abandoned, not `false` - Scope position search per section to prevent cross-section false matches - Strip v-prefix and non-digit chars in version comparison segments
Packagist returns versions like "v1.24.1" while requirements use "^1.24". The v-prefix caused version_satisfies_requirement to fail matching.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
deps-composercrate with full PHP/Composer ecosystem supportcomposer.jsonparser with position tracking forrequireandrequire-devsectionscomposer.locklock file supportphp,ext-*,lib-*)Test plan
cargo +nightly fmt --checkcleancargo clippy --workspace --all-targets --all-features -- -D warningscleancomposer.jsonfiles