Auto indentation problem when saving to Vscode

Asked

Viewed 1,846 times

2

With a problem in auto-indentation of Vscode, I have tried to disable even then the problem remains. When saving a file Vscode automatically changes the indentation, follows the image before saving and after saving: Código antes de salvar Código depois de salvar

  • Face the first step is to disable all extensions you have installed to see if it solves...

  • It worked friend, I disabled all the extensions and I was enabling and testing one by one, the one that was changing the indentation was JS-CSS-HTML Formatter, I believe I did not know how to configure it correctly. I left it disabled and now it’s 100%, thank you very much!

  • No problem my dear! If you allow me I can post as answer? Ai you can tag it and leave your question with a accepted answer, so it does not stay on the site as a pending answer etc

  • 1

    Yes friend!!

  • It’s worth the strength Meydson, if the answer suits you you can consider mark it with accepted in the icon below the arrows next to the answer ;)

  • 1

    of course my friend, you don’t know how much you helped me, I was spending a lot of time analyzing the code when I bugged!!! Thank you very much!!!!

Show 1 more comment

3 answers

1


Guy talked in the comments this is not the standard behavior of VS Code, which leads us to believe strongly that it was Extensão, probably one that has code formatting options, which you installed and defaced the indentation.

Apparently the extension JS-CSS-HTML Formatter that bugged your environment. According to her documentation she uses internally the formatting of js-beautify https://marketplace.visualstudio.com/items?itemName=lonefy.vscode-JS-CSS-HTML-formatter

You can change the setting not to change anymore when saving "onSave": false,

inserir a descrição da imagem aqui

In the latter case you can simply uninstall this extension and install another that does not have auto-format while saving

-1

I had to uninstall the JS-CSS-HTML Formatter extension in order to get it back to work. It seems to be bugged. I installed another.

-2

The same thing happened to me and it was the HTML extension CSS Support - CSS Intellisense. I disabled and ready, back to normal.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.