1

When I open a file in VS Code and press Alt + Shift + F, the opened file gets formatted. The 2 spaces indentation gets used in html, js, etc. even though my configurations specify 4 spaces. How could I fix it?

enter image description here

enter image description here

0

2 Answers 2

2

I can refer the same issue in Visual Studio. Relevent changes for each type of file extesion exist in different section with the same heading. For example C# and JavaScript/TypeScript has the same settings. So make sure you are modifying correct one.

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

0

In my case, I had somehow togged a setting (Edit -> Advanced -> Set Indentation) to be 'Spaces' and not 'Tabs'. When I set it to Tabs, the editor changed my indentation back to 4 spaces and tabs. enter image description here

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.