-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Format document after each provider #59091
Conversation
src/Features/Core/Portable/Formatting/AbstractNewDocumentFormattingService.cs
Outdated
Show resolved
Hide resolved
@@ -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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question before approving
src/Features/Core/Portable/Formatting/AbstractNewDocumentFormattingService.cs
Outdated
Show resolved
Hide resolved
// 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much nicer. thanks!
…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) ...
@davidwengier I see this was closed on 17.2.P1 but is there a workaround or alternative until that's released? |
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. |
Fixes #58974