How are they interpreted differently? I can only see what "editor.tabSize" does, which is the number of spaces that a tab occupies.
Thank you.
From the configuration file:
{
// Controls the rendering size of tabs in characters.
// If set to auto, the value will be guessed based on the opened file.
"editor.tabSize": 4,
// Controls if the editor will insert spaces for tabs.
// If set to auto, the value will be guessed based on the opened file.
"editor.insertSpaces": true
}
As you can see editor.tabSize
sets the size of space occupied when you enter tab
. While editor.insertSpaces
configures the stored key code in file.
If editor.insertSpaces
equals false
then Visual Studio Code will insert one #09
character for each tab
. When you change editor.tabSize
your existing code will change indentation in all lines a #09
character is stored.
If editor.insertSpaces
equals true
then Visual Studio Code will insert space
characters for each tab
instead of #09
characters. The amount of inserted spaces
is configured in editor.tabSize
. When you change editor.tabSize
your existing code will not change indentation since there is no #09
character being stored in the file. Only new tab
strokes will be affected by the new value of editor.tabSize
.
If you and other team members use only tab
for indentation then it is no problem to set editor.insertSpaces
to false.
If you and other team members use space
or tab
for indentation then you should set editor.insertSpaces
to true. Otherwise your files can look awkward when somebody opens a file with a different value of editor.insertSpaces
.
editor.insertSpaces: Controls if the editor will insert spaces for tabs. Accepted values: "auto", true, false. If set to "auto", the value will be guessed when a file is opened.
editor.tabSize: Controls the rendering size of tabs in characters. Accepted values: "auto", 2, 4, 6, etc. If set to "auto", the value will be guessed when a file is opened.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With