Skip to content

refactor(core): consolidate complete_package_names, seal Ecosystem, remove once_cell#71

Merged
bug-ops merged 2 commits intomainfrom
refactor/remaining-cleanup
Feb 23, 2026
Merged

refactor(core): consolidate complete_package_names, seal Ecosystem, remove once_cell#71
bug-ops merged 2 commits intomainfrom
refactor/remaining-cleanup

Conversation

@bug-ops
Copy link
Owner

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

Summary

Remaining cleanup items from #68:

  • Consolidate complete_package_names across 5 ecosystems (Cargo, npm, PyPI, Bundler, Dart) to use complete_package_names_generic
  • Rename ranges_overlapposition_in_range for semantic clarity
  • Replace once_cell::sync::Lazy with std::sync::LazyLock, remove once_cell dependency
  • Seal Ecosystem trait with private::Sealed supertrait
  • Rename format_version_for_code_actionformat_version_for_text_edit

Closes #68

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo nextest run --workspace --lib --bins (1106 passed)
  • No references to old names (ranges_overlap, format_version_for_code_action, once_cell)

…emove once_cell

Consolidate complete_package_names across Cargo, npm, PyPI, Bundler,
Dart ecosystems to use complete_package_names_generic from deps-core.

Rename ranges_overlap to position_in_range for semantic clarity.

Replace once_cell::sync::Lazy with std::sync::LazyLock, remove once_cell
dependency.

Seal Ecosystem trait with private::Sealed supertrait to prevent external
implementations.

Rename format_version_for_code_action to format_version_for_text_edit
to better reflect its TextEdit context.

Closes #68
Consolidate 4 duplicate DependencySource enums (Cargo, PyPI, Dart,
Bundler) into a single 7-variant enum in deps-core:
Registry, Git, Path, Url, Sdk, Workspace, CustomRegistry.

Eliminates lossy conversions at trait boundaries: PyPI Url and Dart Sdk
variants are now preserved through the Dependency trait. Cargo
workspace_inherited bool replaced by DependencySource::Workspace.

Add #[non_exhaustive] for forward compatibility. Add is_registry() and
is_version_resolvable() convenience methods. Simplify
UnifiedDependency::is_registry() to delegate to core enum.

Ref #68
@github-actions github-actions bot added parser Parser changes size: XL 500-1000 lines changed and removed size: L 200-500 lines changed labels Feb 23, 2026
@bug-ops bug-ops enabled auto-merge (squash) February 23, 2026 03:42
@bug-ops bug-ops merged commit 573ff14 into main Feb 23, 2026
20 checks passed
@bug-ops bug-ops deleted the refactor/remaining-cleanup branch February 23, 2026 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review Needs review parser Parser changes rust Rust code changes size: XL 500-1000 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Architecture improvement plan: reduce duplication, remove legacy traits, leverage modern Rust

1 participant