Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

fix(rome_lsp): fix the calculation of offsets in the diff to LSP text edit conversion #3350

Merged
merged 1 commit into from
Oct 6, 2022

Conversation

leops
Copy link
Contributor

@leops leops commented Oct 6, 2022

Summary

There was a bug in the code handling the conversion of text diff operations to LSP text edits, where the text positions where calculated as relative to the new revision of the text when they should have been offsets in the old revision instead.

Test Plan

This issue was not caught in the existing test because it replaced the sequence old with new, which happened to have the same length so there was no mismatch in offset between the two revisions. I've added an additional test case to cover this.

@leops leops requested a review from ematipico as a code owner October 6, 2022 08:41
@netlify
Copy link

netlify bot commented Oct 6, 2022

Deploy Preview for rometools canceled.

Name Link
🔨 Latest commit ba7d517
🔍 Latest deploy log https://app.netlify.com/sites/rometools/deploys/633e94ba59127c0009311d7c

@leops leops temporarily deployed to netlify-playground October 6, 2022 08:41 Inactive
@github-actions
Copy link

github-actions bot commented Oct 6, 2022

@ematipico ematipico added this to the 10.0.0 milestone Oct 6, 2022
@ematipico ematipico added E-VScode Editors: VSCode A-Editors Area: editors labels Oct 6, 2022
@leops leops merged commit 68ebe59 into main Oct 6, 2022
@leops leops deleted the fix/lsp-edit-ranges branch October 6, 2022 09:02
@ematipico ematipico removed this from the 10.0.0 milestone Oct 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Editors Area: editors E-VScode Editors: VSCode
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants