Skip to content

"Move to a new file" quick fix won't properly separate default and named imports and leaves dangling comma #31195

@ChristianIvicevic

Description

@ChristianIvicevic
  • VSCode Version: 1.33.1
  • OS Version: Windows 10 1809

Steps to Reproduce:

  1. Install the debug and @types/debug packages in a fresh typescript project.
  2. Create a file with the following content:
import debug, { Debugger } from "debug";

export const log = debug("app");
export const foo = (logger: Debugger = log) => 0;
  1. Run the "Move to a new file" quick fix on the foo object.
  2. You are left with a dangling comma in the first line:
import debug, from "debug";

export const log = debug("app");

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

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: Refactoringse.g. extract to constant or function, rename symbolFix 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