Skip to content

feat(swift): add Swift Package Manager ecosystem support#74

Merged
bug-ops merged 6 commits intomainfrom
feature/swift-ecosystem
Feb 23, 2026
Merged

feat(swift): add Swift Package Manager ecosystem support#74
bug-ops merged 6 commits intomainfrom
feature/swift-ecosystem

Conversation

@bug-ops
Copy link
Owner

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

Summary

  • Add deps-swift crate with full Swift Package Manager support
  • Regex-based Package.swift parser covering all 9 .package() call patterns (from, upToNextMajor, upToNextMinor, exact, range, branch, revision, path)
  • GitHub API registry for version resolution (tags) and package search (repos)
  • Package.resolved lockfile support for all 3 schema versions (v1/v2/v3)
  • Owner/repo identity validation to prevent URL injection (SEC-002)

Test plan

  • 89 unit tests for deps-swift (parser, registry, lockfile, formatter, types)
  • 1199 total workspace tests pass
  • cargo +nightly fmt --check clean
  • cargo clippy --workspace --all-targets --all-features -- -D warnings clean
  • Security audit passed (no critical/high findings)
  • Code review approved

Implement deps-swift crate with Package.swift parsing (regex-based,
9 .package() patterns), GitHub API registry for version resolution,
Package.resolved lockfile support (v1/v2/v3), and ecosystem integration.
@github-actions github-actions bot added rust Rust code changes parser Parser changes needs-review Needs review tests Test changes size: XXL >1000 lines changed labels Feb 23, 2026
@bug-ops bug-ops requested a review from Copilot February 23, 2026 14:25
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Feb 23, 2026
Copy link

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

This pull request adds comprehensive Swift Package Manager (SPM) ecosystem support to the deps-lsp project. The implementation provides LSP features for Package.swift manifest files, including dependency parsing, version resolution via GitHub API, lockfile support, and intelligent code completion.

Changes:

  • Adds deps-swift crate with regex-based Package.swift parser supporting all 9 .package() declaration patterns (from, upToNextMajor, upToNextMinor, exact, range variants, branch, revision, path)
  • Implements GitHub API-based registry for version resolution and package search with owner/repo validation (SEC-002)
  • Supports Package.resolved lockfile parsing for all 3 schema versions (v1/v2/v3)

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
crates/deps-swift/src/types.rs Core type definitions for Swift dependencies, versions, and metadata
crates/deps-swift/src/registry.rs GitHub API integration with validation and version resolution
crates/deps-swift/src/parser.rs Regex-based Package.swift parser with comment stripping and position tracking
crates/deps-swift/src/lockfile.rs Package.resolved parser supporting v1/v2/v3 formats
crates/deps-swift/src/formatter.rs Version formatting and package URL generation utilities
crates/deps-swift/src/error.rs Swift-specific error types and conversions
crates/deps-swift/src/ecosystem.rs Ecosystem trait implementation integrating all components
crates/deps-swift/src/lib.rs Module exports and crate documentation
crates/deps-swift/Cargo.toml Dependencies and package metadata
crates/deps-lsp/src/lib.rs Integration of Swift ecosystem into LSP server
crates/deps-lsp/Cargo.toml Swift feature flag and dependency
Cargo.toml Workspace member addition
Test fixtures Example Package.swift files for testing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Parse error objects from GitHub API instead of panicking on unexpected
JSON structure. Rate-limited responses now produce descriptive error
messages instead of cryptic serde deserialization failures.
Add get_cached_with_headers to HttpCache for passing extra headers
(Authorization) to specific registries. SwiftRegistry reads GITHUB_TOKEN
from environment, increasing rate limit from 60 to 5000 requests/hour.
Filter inlay hints by the range requested by the editor to fix
partial hint rendering in Zed. Show actionable GITHUB_TOKEN error
when GitHub API rate limit is hit without authentication.
@github-actions github-actions bot added the lsp Language Server Protocol label Feb 23, 2026
@bug-ops bug-ops merged commit 44ed7fc into main Feb 23, 2026
20 checks passed
@bug-ops bug-ops deleted the feature/swift-ecosystem branch February 23, 2026 16:07
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 lsp Language Server Protocol needs-review Needs review parser Parser changes rust Rust code changes size: XXL >1000 lines changed tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants