Skip to content

feat(composer): add PHP/Composer ecosystem support#75

Merged
bug-ops merged 4 commits intomainfrom
feature/composer-ecosystem
Feb 23, 2026
Merged

feat(composer): add PHP/Composer ecosystem support#75
bug-ops merged 4 commits intomainfrom
feature/composer-ecosystem

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Feb 23, 2026

Summary

  • Add deps-composer crate with full PHP/Composer ecosystem support
  • Packagist v2 registry API with metadata de-minification
  • composer.json parser with position tracking for require and require-dev sections
  • composer.lock lock file support
  • Composer-specific version constraint matching (tilde, caret, wildcard, OR operators)
  • Platform package filtering (php, ext-*, lib-*)
  • URL-safe registry queries with proper encoding

Test plan

  • 46 unit tests covering parser, registry, formatter, lockfile, ecosystem
  • 1156/1156 workspace tests pass
  • cargo +nightly fmt --check clean
  • cargo clippy --workspace --all-targets --all-features -- -D warnings clean
  • Manual test with Zed editor on real composer.json files

@github-actions github-actions bot added rust Rust code changes parser Parser changes needs-review Needs review size: XXL >1000 lines changed labels Feb 23, 2026
@bug-ops bug-ops requested a review from Copilot February 23, 2026 14:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-composer crate (composer.json parser with position tracking, Packagist registry client, Composer constraint formatting/matching, composer.lock parsing).
  • Register the new ecosystem in deps-lsp and 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.

Comment thread crates/deps-composer/src/registry.rs Outdated
Comment thread crates/deps-composer/src/parser.rs
Comment thread crates/deps-composer/src/parser.rs
Comment thread crates/deps-composer/src/formatter.rs Outdated
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).
@bug-ops bug-ops force-pushed the feature/composer-ecosystem branch from 925d133 to 3b3f4d7 Compare February 23, 2026 16:10
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Feb 23, 2026
- 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.
@bug-ops bug-ops enabled auto-merge (squash) February 23, 2026 17:17
@bug-ops bug-ops merged commit 241be41 into main Feb 23, 2026
20 checks passed
@bug-ops bug-ops deleted the feature/composer-ecosystem branch February 23, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation needs-review Needs review parser Parser changes rust Rust code changes size: XXL >1000 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants