Skip to content

'move to new file' can add two new lines between methods  #37948

@mjbvz

Description

@mjbvz

TypeScript Version: 3.9.0-dev.20200413

Search Terms:

  • move to new file
  • refactor / refactoring

Code
For a TS file:

class Foo {

	constructor() {
	}

	public runCommand(): void {
		let focusedEditor = 1;
		// Only if editor text focus (i.e. not if editor has widget focus).
		if (focusedEditor) {
			return;
		}
	}

	public run(): void { }
}
export const a = new Foo();
  1. Select Foo and run move to new file

Bug:
The new file duplicates the new line between the methods in the class

export class Foo {
	constructor() {
	}


	public runCommand(): void {
		let focusedEditor = 1;
		// Only if editor text focus (i.e. not if editor has widget focus).
		if (focusedEditor) {
			return;
		}
	}


	public run(): void { }
}

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions