Skip to content

fix(lsp): correct inlay hints after lock file or manifest changes#53

Merged
bug-ops merged 1 commit intomainfrom
fix/inlay-hints-stale-versions
Jan 27, 2026
Merged

fix(lsp): correct inlay hints after lock file or manifest changes#53
bug-ops merged 1 commit intomainfrom
fix/inlay-hints-stale-versions

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Jan 27, 2026

Summary

Fixes two related bugs where inlay hints incorrectly showed all dependencies as up-to-date (green checkmarks) after cargo update or applying code actions.

Root Cause

cached_versions (latest from registry) were being overwritten with resolved_versions (from lock file), causing the comparison logic to always return true.

Changes

  • Remove incorrect update_cached_versions call in handle_lockfile_change (server.rs)
  • Remove for loop merging resolved_versions into cached_versions in handle_document_change (lifecycle.rs)
  • Add two-tier check for dependencies not in lock file (fallback to version requirement check)
  • Update dependencies (aws-lc-rs, colored, cc, etc.)
  • Update resolver to version 3
  • Bump version to 0.5.5

Test Plan

  • cargo update now correctly preserves red crosses for outdated dependencies
  • Code actions (Cmd+.) now correctly preserve red crosses for outdated dependencies
  • Dependencies missing from Cargo.lock (dev-dependencies in workspace members) now show correct status based on version requirement satisfaction
  • All tests pass (840 tests)

@github-actions github-actions Bot added documentation Improvements or additions to documentation rust Rust code changes lsp Language Server Protocol needs-review Needs review size: L 200-500 lines changed labels Jan 27, 2026
This fixes two related bugs where inlay hints incorrectly showed all
dependencies as up-to-date (green checkmarks) after cargo update or
applying code actions.

Root cause: cached_versions (latest from registry) were being
overwritten with resolved_versions (from lock file), causing the
comparison logic to always return true.

Changes:
- Remove incorrect update_cached_versions call in handle_lockfile_change
- Remove for loop merging resolved_versions into cached_versions in handle_document_change
- Add two-tier check for dependencies not in lock file (fallback to version requirement check)
- Update dependencies (aws-lc-rs, colored, cc, etc.)
- Update resolver to version 3

Fixes issue where dev-dependencies in workspace members showed
incorrect status when missing from Cargo.lock.
@bug-ops bug-ops force-pushed the fix/inlay-hints-stale-versions branch from 8b7f74a to 66ff9e3 Compare January 27, 2026 11:36
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 27, 2026

Codecov Report

❌ Patch coverage is 71.85185% with 38 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/deps-core/src/lsp_helpers.rs 71.85% 38 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #53      +/-   ##
==========================================
+ Coverage   84.58%   84.87%   +0.28%     
==========================================
  Files          56       56              
  Lines       16593    16634      +41     
==========================================
+ Hits        14036    14118      +82     
+ Misses       2557     2516      -41     
Flag Coverage Δ
deps-cargo 79.47% <ø> (+0.29%) ⬆️
deps-core 88.16% <71.85%> (-0.34%) ⬇️
deps-go 84.87% <71.85%> (+0.28%) ⬆️
deps-lsp 78.70% <ø> (+0.81%) ⬆️
deps-npm 89.58% <ø> (+0.56%) ⬆️
deps-pypi 87.23% <ø> (+0.25%) ⬆️
overall 84.87% <71.85%> (+0.28%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
crates/deps-lsp/src/document/lifecycle.rs 62.52% <ø> (+1.24%) ⬆️
crates/deps-lsp/src/server.rs 30.00% <ø> (+0.36%) ⬆️
crates/deps-core/src/lsp_helpers.rs 73.24% <71.85%> (+0.12%) ⬆️

... and 17 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bug-ops bug-ops merged commit 37f78f3 into main Jan 27, 2026
20 checks passed
@bug-ops bug-ops deleted the fix/inlay-hints-stale-versions branch January 27, 2026 11:45
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 rust Rust code changes size: L 200-500 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants