Skip to content

Typescript Incorrect line indentation braces inside of Case statement blocks #41358

@jon-valliere

Description

@jon-valliere
  • VSCode Version: 1.19.1
  • OS Version: 10.13.2

Steps to Reproduce:

  1. Setup workspace config
{
	// Exclude specific files from the explorer
	"files.exclude": {
		"**/.git": true,
		"**/.DS_Store": true,
		"src/**/*.js": {
			"when": "$(basename).ts"
		},
		"src/**/*.js.map": {
			"when": "$(basename)"
		}
	},
	// Format the document when saved
	"editor.formatOnSave": true,
	// Enables/Disables using spaces instead of tabs
	"editor.insertSpaces": false,
	// Enables/Disables automatic indentation detection
	"editor.detectIndentation": false,
	// Defines whether an open brace is put onto a new line for functions or not.
	"typescript.format.placeOpenBraceOnNewLineForFunctions": true,
	// Defines whether an open brace is put onto a new line for control blocks or not.
	"typescript.format.placeOpenBraceOnNewLineForControlBlocks": true,
	// Defines whether an open brace is put onto a new line for functions or not.
	"javascript.format.placeOpenBraceOnNewLineForFunctions": true,
	// Defines whether an open brace is put onto a new line for control blocks or not.
	"javascript.format.placeOpenBraceOnNewLineForControlBlocks": true
}
  1. Create Typescript file with Switch and Case statements. Add block braces inside of the Case block and format the document. The braces are indented beyond the Case statement level. They should align with Case.

See Attachment:
screen shot 2017-12-30 at 2 11 31 pm

screen shot 2018-01-12 at 1 04 30 pm

Metadata

Metadata

Assignees

Labels

formattingSource formatter issuesjavascriptJavaScript support issuestypescriptTypescript support issuesupstreamIssue identified as 'upstream' component related (exists outside of VS Code)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions