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

Fix corrupted diffs in formatting responses #876

Merged
merged 2 commits into from
Apr 14, 2022
Merged

Conversation

radeksimko
Copy link
Member

Fixes #793

The diff may be confusing to understand but here's another representation of it, confirming the upstream library works pretty much as expected:

--- test.tf
+++ test.tf
@@ -1,8 +1,8 @@
 resource "aws_lambda_function" "f" {
-    environment {
-        variables = {
-            a = "b"
-        }
+  environment {
+    variables = {
+      a = "b"
     }
+  }
 }

Perhaps the algorithm could have joined the two hunks into one, but the result would be pretty much the same.

@radeksimko radeksimko added bug Something isn't working textDocument/formatting labels Apr 14, 2022
@radeksimko radeksimko added this to the v0.27.0 milestone Apr 14, 2022
@radeksimko radeksimko self-assigned this Apr 14, 2022
@radeksimko radeksimko requested a review from a team as a code owner April 14, 2022 12:07
@radeksimko radeksimko force-pushed the b-formatting-diff-bug branch from bf12034 to 63218f0 Compare April 14, 2022 12:21
Copy link
Member

@dbanck dbanck left a comment

Choose a reason for hiding this comment

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

👍 Nice catch!

@radeksimko radeksimko merged commit 535c288 into main Apr 14, 2022
@radeksimko radeksimko deleted the b-formatting-diff-bug branch April 14, 2022 13:21
@github-actions
Copy link

This functionality has been released in v0.27.0 of the language server.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working textDocument/formatting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Corrupted output from code formatting
2 participants