Skip to content

fix(cargo,bundler): remove quotes from format_version_for_text_edit#87

Merged
bug-ops merged 1 commit intomainfrom
fix/85-code-action-doubled-quotes
Mar 28, 2026
Merged

fix(cargo,bundler): remove quotes from format_version_for_text_edit#87
bug-ops merged 1 commit intomainfrom
fix/85-code-action-doubled-quotes

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 28, 2026

Summary

  • CargoFormatter::format_version_for_text_edit returned "1.0.0" (with double quotes); TextEdit range excludes delimiters, causing ""1.0.0"" after apply
  • BundlerFormatter::format_version_for_text_edit returned '1.0.0' (with single quotes); same issue, producing ''1.0.0''
  • Both formatters now return the bare version string; existing delimiters in the document are preserved by the range

Test plan

  • cargo nextest run -p deps-cargo -p deps-bundler — formatter tests updated and passing
  • Full workspace: cargo nextest run --workspace --all-features --no-fail-fast — 1304 tests passed
  • Manual: apply code action on serde = "1.0.0" in Cargo.toml → result is serde = "1.0.228" (no doubled quotes)
  • Manual: apply code action on gem 'rails', '7.0.0' in Gemfile → result is valid Ruby (no doubled single quotes)

Closes #85

@github-actions github-actions Bot added documentation Improvements or additions to documentation rust Rust code changes needs-review Needs review size: S 10-50 lines changed labels Mar 28, 2026
The TextEdit range produced by toml_span (Cargo) and the Bundler parser
covers only the version value content, excluding surrounding delimiters.
format_version_for_text_edit was wrapping the version in quotes, causing
doubled delimiters when the editor applied the edit.

Return the bare version string; the existing delimiters in the document
are preserved by the range.

Closes #85
@bug-ops bug-ops force-pushed the fix/85-code-action-doubled-quotes branch from c856b33 to 592073e Compare March 28, 2026 21:09
@bug-ops bug-ops enabled auto-merge (squash) March 28, 2026 21:09
@bug-ops bug-ops merged commit e11d5f0 into main Mar 28, 2026
20 checks passed
@bug-ops bug-ops deleted the fix/85-code-action-doubled-quotes branch March 28, 2026 21:15
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 rust Rust code changes size: S 10-50 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: code action version update produces doubled quotes (Cargo, Bundler)

1 participant