Skip to content

Pasting TS code removes indentation #167299

Description

@hediet

Copy this TS code:

export type IncludeReference =
	| BaseReference
	| SelfReference
	| RelativeReference
	| TopLevelReference
	| TopLevelRepositoryReference;

export const enum IncludeReferenceKind {
	Base,
	Self,
	RelativeReference,
	TopLevelReference,
	TopLevelRepositoryReference,
}

Create an new TS file, disable all auto formatters and paste the copied source.

Actual result:

export type IncludeReference =
| BaseReference
| SelfReference
| RelativeReference
| TopLevelReference
| TopLevelRepositoryReference;

export const enum IncludeReferenceKind {
Base,
Self,
RelativeReference,
TopLevelReference,
TopLevelRepositoryReference,
}

Expected result: Indentation should be preserved.

Maybe this was caused by a community PR that changed how enter rules are applied to pasted text.

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bugformattingSource formatter issues

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions