0

I nicely indent my HTML files just like I do for my TypeScript files. But, when I save the HTML, ( in one of the projects ) everything goes haywire and I can never get vs-code to honor what I save.

Is there one setting in visual code to say, "please Charlie, don't do this to me."

I got the following in the user settings ( Code -> Preferences -> Settings -> User-Settings )

{
    "html.format.enable": false,
}

The JSON key name there is one of those things that makes you think "OK this must take care of my problem!" Well,... yes and no.

These settings get honored in one project and do not get honored in another one.

What could possibly be overwriting this? Please note that workspace settings is completely empty for both projects.

The misbehaving project is an open source and can be previewed from the following link. It is the dashboard theme of the mighty tera-data covalent.

https://stackblitz.com/edit/covalent-dashboard

Average Joe
  • 4,521
  • 9
  • 53
  • 81

1 Answers1

-1

Pretty Listing might be the reason, try the following

Tools-> Options-> Text Editor-> Basic-> VB Specific' and turn 'Pretty Listing' OFF.

If your using 2015+ then the option would be:

Tools-> Options-> Text Editor-> Basic-> Advanced

If this does not resolve the issue it might be because of ReSharper option. you might have to look into the following

How can I disable ReSharper in Visual Studio and enable it again?

Is there a way to mark up code to tell ReSharper not to format it?

  • Thank you so much for your answer. But, I do not see the `Tools` as an option. All I see is `Code - File - Edit - Selection - View - Go - Debug - Tasks - Window - Help`. You are sure that that is as VS-Code menu item? – Average Joe Nov 24 '17 at 16:10
  • This is an anwer for Visual Studio, not Visual Studio Code. – herrbischoff Nov 24 '17 at 16:36
  • oops my bad, dint notice it was visual code, in user settings search for `"editor.formatOnSave": false` and also check if you have any external plugin like beautify installed if so change the preference for that aswell – Goutham Santhakumar Nov 24 '17 at 18:09
  • It's really unbelievable that this is still an issue for me. The moment I do command-s ( save ). my html is reformatted. As of now, I got `Beautify` disabled. `editor.formtOnSave is set to false`. I also got `"html.format.enable": false`, in both user and work settings. No luck... VS-Code is always comes up as winner and HTML is reformatted. I have no words to say. – Average Joe Nov 25 '17 at 03:11