Disable formatting a region of code using directives
See original GitHub issueFrom: https://github.com/Microsoft/vscode/issues/33772
TypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx)
Feature Request Add a way to disable formatting of a region of code. An example of this is js beatuify’s preserve directive:
// Use preserve when the content is not javascript, but you don't want it reformatted.
/* beautify preserve:start */
{
browserName: 'internet explorer',
platform: 'Windows 7',
version: '8'
}
/* beautify preserve:end */
Issue Analytics
- State:
- Created 6 years ago
- Reactions:75
- Comments:14
Top Results From Across the Web
Disable code formatting for some part of code by using ...
Disable code formatting for some part of code by using specific comments/region - Visual Studio Feedback.
Read more >intellij idea - How to disable code formatting for some part of ...
You must go to Preferences -> Code Style -> General -> Formatter Control and check Enable formatter markers in comments for this to...
Read more >How to stop Visual Studio 2019 to autoformat #region always ...
Hi de Kekse,. You could go to Tools/Options/Text Editor/C\C++/Formatting/Indentation, and then select what you want under 'Position for ...
Read more >13.5 Disable Format for Code Sections - DVT Eclipse IDE
When format is disabled, a code section is completely ignored, that is it is not formatted, nor it contributes to formatting. Disable format...
Read more >Code Style & Formatting - Features | ReSharper - JetBrains
To make your code more readable, you can remove redundant using directives and/or shorten qualified references in your C# and VB.NET code files....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The problem I see here that the whole idea seems not to be interesting enough to be considering / work on. I can not understand why, for us it is “must have” or no automatic formatter at all.
There are formatters in the marketplace that support this, but I don’t like many of them for various other issues. How’s the support for the native formatter going?
I wonder, what is the “More Feedback” that is expected? Can we have the flag removed?