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

Allow Razor to format new documents via Roslyn #6329

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

davidwengier
Copy link
Contributor

@davidwengier davidwengier commented Sep 11, 2023

Part of dotnet/razor#4330

Plumbing!

Connects dotnet/razor#9263 to dotnet/roslyn#69878 in VS Code

Currently untested due to unrelated changes running a locally build Roslyn server, which hopefully will be solved soon.

@davidwengier davidwengier requested review from a team as code owners September 11, 2023 07:11
davidwengier added a commit to dotnet/razor that referenced this pull request Sep 14, 2023
Fixes #4330
Fixes #8766
Includes #9262 so just review from
8a2b8af
onwards

Goes with dotnet/roslyn#69878 and
dotnet/vscode-csharp#6329

I logged #9264 to follow up with a
better test, though strictly speaking the one I've added id exhaustive
:)

Behaviour of Extract to Code Behind before this change. Note the many
using statements and block scoped namespace.

![ExtractToCodeBehindBefore](https://github.com/dotnet/razor/assets/754264/10ac5595-b3b2-44c2-a1a7-66664d3c8f1b)

Behaviour after this change. Note the file scoped namespace, and file
header.

![ExtractToCodeBehindAfter](https://github.com/dotnet/razor/assets/754264/65160715-bc98-4336-b19d-37f9b14adf94)

The squiggle on `NavigationManager` is due to an `.editorconfig` rule I
have on in that project, requiring `this.` qualification, so is
unrelated.
@davidwengier davidwengier merged commit d9f01b5 into dotnet:main Sep 15, 2023
8 checks passed
@davidwengier davidwengier deleted the RazorNewFileFormat branch September 15, 2023 01:18
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.

2 participants