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

[WIP] Only Send Updates When Formatting Changed #1188

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

bmarcaur
Copy link
Member

@bmarcaur bmarcaur commented Jan 9, 2025

Before this PR

Every format action caused the current buffer to be marked as modified.

After this PR

This was due to us updating the text on every format even if it was unchanged. Now it only updates when something was formatted.

Way more context than you could ever want: https://youtrack.jetbrains.com/issue/IJPL-162382

@bmarcaur bmarcaur requested review from CRogers and crogoz January 9, 2025 21:04
@bmarcaur bmarcaur changed the title follow the API guidelines and only update when formatted file is changed [WIP] Only Send Updates When Formatting Changed Jan 9, 2025

// The Javadoc of this API says that you should set it to null when the document is unchanged
// We should not be trying to format a document that is already formatted
if (preFormatText.equals(formattedText)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

In this case, does getFormatReplacements return an empty list?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants