Problem with Indentation

2

Recently I switched from editor to development.

With VS Code everything has become easier and more intuitive, but I often have a problem with older classes in relation to indentation.

When I open the first time all the code seems to be well organized, but during use I see that some parts have not been indented correctly. It appears a "strange space", as if it were 4 spaces in one, this causes that the indentation does not work perfectly, there I have to go out adjusting manually.

This is annoying because there are hundreds of "classes" with thousands of command lines.

I've already looked at and the automatic indentation of VS Code stowed.

    
asked by anonymous 14.02.2018 / 15:47

1 answer

0

I think this is because the VS Code has an indentation setting but your old files have another.

You can use the standard VS code formatting option. Here's a video of 15 seconds explaining. link

Then you can use some Beautify extension, install and read the documentation. With this extension you can easily identify the entire file. link

Another option is changing by configuring the use of Tab in the VS Code settings. Go to File > Preferences > Settings and search for "Tab", as shown

YoucanalsogiveCtrl+Atoselectalllinesinthefile.Thengototheindentationconfigasintheimagebelowandchoosetheformatyouwant.

    
14.02.2018 / 16:08