microsoft/vscode

Can't find the settings for YAML tab/indent size

devuxer opened this issue · 4 comments

  • VSCode Version: 1.31.1
  • OS Version: Windows 10

Related Issues

Steps to Reproduce

  1. In preferences > settings, set the following values:
    • Editor: Tab Size = 4
    • Editor: Insert Spaces = On
    • Editor: Detect Indentation = Off
  2. Open a .yml file
  3. Note that "Spaces: 2" appears in blue footer bar and guide lines appear every 2 characters (see image below).
  4. Set Spaces to 4 in blue footer bar.
  5. Close and reopen .yml file.

Observed Results

  • "Spaces" has reverted back to "2" in blue footer bar
  • Guide lines once again appear every 2 characters

2019-02-19 14_53_48-docker-compose yml - sdtf workspace - visual studio code

Expected Results

  • The tab size should always be 4 and not need to be reset since "detect indentation" is off.
  • Resetting "Spaces: 2" to "Spaces: 4" should stick.

Does this issue occur when all extensions are disabled?: Yes

Yaml has language specific default settings that wins over global settings:

	// Configure editor settings to be overridden for [yaml] language.
	"[yaml]":  {
		"editor.insertSpaces": true,
		"editor.tabSize": 2,
		"editor.autoIndent": false
	},

You'll have to add a similar section to your user settings.

@aeschli,

Interesting, thank you.

Is this documented anywhere? It seems almost completely undiscoverable within VSCode. When I search the available settings using Preferences > Open Settings (UI), nothing appears for "yaml" or "yml".

I now see that if I search for "tabsize", there's a little note at the bottom that directs you to edit the settings JSON file. This is barely noticeable, though.

Why aren't the YAML settings integrated into the settings UI?

Reopening and renaming as a request to improve the settings UI.