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

Return nil if document is already formatted #216

Merged
merged 3 commits into from
Jul 25, 2022

Conversation

vinistock
Copy link
Member

Motivation

If the documented is already formatted, we should not return text edits to VS Code as it may delay saving the file.

Implementation

If the formatted text matches the source, then return early.

Automated Tests

Added an example.

@vinistock vinistock self-assigned this Jul 22, 2022
@vinistock vinistock requested a review from a team as a code owner July 22, 2022 14:28
lib/ruby_lsp/requests/formatting.rb Outdated Show resolved Hide resolved
@vinistock vinistock merged commit 00a5508 into main Jul 25, 2022
@vinistock vinistock deleted the vs/return_nil_if_document_is_already_formatted branch July 25, 2022 13:14
vinistock added a commit that referenced this pull request Jul 27, 2022
…eady_formatted

Return nil if document is already formatted
@shopify-shipit shopify-shipit bot temporarily deployed to production August 26, 2022 20:47 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants