Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Narrow Text edits #374

Merged
merged 1 commit into from
Feb 2, 2024
Merged

Narrow Text edits #374

merged 1 commit into from
Feb 2, 2024

Conversation

MichaReiser
Copy link
Member

Summary

Try to narrow text edits to changed lines only. The implemented algorithm is very basic. It only trims the common suffix and postfix (line based) but doesn't do any diffing beyond that.
The idea is to have a fast (with predictable performance) algorithm that at least avoids transmitting the entire formatted file when doing range formatting.

Test Plan

I played with range formatting, code fixes, and normal formatting in the VS code extension to verify that it doesn't truncate text.

@MichaReiser MichaReiser linked an issue Feb 1, 2024 that may be closed by this pull request
@MichaReiser MichaReiser force-pushed the narrow-edits branch 5 times, most recently from 29d0ef8 to 12b9548 Compare February 1, 2024 11:50
Copy link
Member

@dhruvmanila dhruvmanila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I think you'd need to rebase to get the version requirement update.

@MichaReiser MichaReiser added the enhancement New feature or request label Feb 2, 2024
@MichaReiser MichaReiser merged commit d7f8b43 into main Feb 2, 2024
20 checks passed
@MichaReiser MichaReiser deleted the narrow-edits branch February 2, 2024 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use narrow edits when possible
3 participants