Skip to content

Razor pages with preprocessor directives don't format #11372

Closed
@vsfeedback

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


When adding a razor script in a Blazor page or component

For example such as:

<EditForm Model="SomeModel">
<DataAnnotationsValidator />
@{#if DEBUG}
 <ValidationSummary />
@{#endif}
</EditForm>
  

The code will not be formatted no matter what, and not just in Visual Studio 2022, also in VS Code
I have attached VS 2022 version info:

VS_2022_Version.txt

VS Code:

> Version: 1.96.2 (user setup)
> Commit: fabdb6a30b49f79a7aba0f2ad9df9b399473380f
> Date: 2024-12-19T10:22:47.216Z
> Electron: 32.2.6
> ElectronBuildId: 10629634
> Chromium: 128.0.6613.186
> Node.js: 20.18.1
> V8: 12.8.374.38-electron.0
> OS: Windows_NT x64 10.0.22631


Original Comments

Nicole Hu [MSFT] on 30/12/2024, 05:00 PM:

We have converted this feedback item to a problem. This change was done to better reflect the feedback’s nature. It will allow other developers to easily find it and engage on it.

Feedback Bot on 30/12/2024, 05:09 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions