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

Format document after each provider #59091

Merged
merged 4 commits into from
Jan 27, 2022

Conversation

davidwengier
Copy link
Contributor

Fixes #58974

@davidwengier davidwengier requested a review from a team as a code owner January 26, 2022 23:35
@davidwengier davidwengier enabled auto-merge (squash) January 27, 2022 00:35
@@ -40,6 +40,14 @@ internal Task TestAsync<T>(string testCode, string expected, (Option2<T>, T)[]?
parseOptions);
}

internal Task TestAsync(string testCode, string expected, (OptionKey, object)[]? options = null, ParseOptions? parseOptions = null)
Copy link
Member

Choose a reason for hiding this comment

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

(OptionKey, object)[]? options = null

In the future, I recommend OptionsCollection for this. Very easy to initialize a new instance and set strongly-typed values. I'll look into updating this case after this PR merges.

Copy link
Member

@sharwell sharwell left a comment

Choose a reason for hiding this comment

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

Question before approving

@davidwengier davidwengier disabled auto-merge January 27, 2022 02:23
@davidwengier davidwengier requested a review from sharwell January 27, 2022 03:27
// before we call the next provider, otherwise they might not see things as they are meant to be.
// Because formatting providers often re-use code fix logic, they are often written assuming this will
// happen.
document = await CodeAction.CleanupDocumentAsync(document, cancellationToken).ConfigureAwait(false);
Copy link
Member

Choose a reason for hiding this comment

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

much nicer. thanks!

@davidwengier davidwengier merged commit 6d5668e into dotnet:main Jan 27, 2022
@davidwengier davidwengier deleted the FixNewDocumentFormatting branch January 27, 2022 21:10
@ghost ghost added this to the Next milestone Jan 27, 2022
333fred added a commit to YairHalberstadt/roslyn that referenced this pull request Jan 28, 2022
…ess-instance-members

* upstream/main: (669 commits)
  Fix 'hasStaticConstructor' check in MethodCompiler (dotnet#59116)
  Update dependencies from https://github.com/dotnet/arcade build 20220127.8 (dotnet#59134)
  Update StreamJsonRpc (dotnet#59073)
  Resources
  Filter cancellation exceptions in generator driver (dotnet#58843)
  Revert "Remove dependency on EditorFeatures from Remote.ServiceHub project (dotnet#59059)"
  Strings
  Inline
  Convert to switch expression
  Explicitly test empty string case.
  Fix comment
  Simplify test code
  Run all
  Add tests
  Delete test generator
  Add support for specifying server in tests
  Remove options
  review feedback
  Format document after each provider (dotnet#59091)
  [main] Update dependencies from dotnet/arcade (dotnet#59015)
  ...
@RikkiGibson RikkiGibson modified the milestones: Next, 17.2.P1 Feb 4, 2022
@mwasson74
Copy link

@davidwengier I see this was closed on 17.2.P1 but is there a workaround or alternative until that's released?

@davidwengier
Copy link
Contributor Author

17.2 is released in the preview channel, so if you install Visual Studio Preview this will work. The preview channel will be promoted to the non preview channel soon, and there is no real way for an individual fix to jump ahead I'm afraid.

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

Successfully merging this pull request may close these issues.

Creating a new C# class from item template is missing a space between the access modifier and 'class' keyword
5 participants