question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Disable formatting a region of code using directives

See original GitHub issue

From: 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:open
  • Created 6 years ago
  • Reactions:75
  • Comments:14

github_iconTop GitHub Comments

11reactions
tomhanaxcommented, May 31, 2022

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.

7reactions
ackvfcommented, Jan 27, 2020

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found