Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ChristianIvicevic opened this issue Apr 28, 2019 · 1 comment · Fixed by #32663
Assignees
Labels
Bug A bug in TypeScript Domain: Refactorings e.g. extract to constant or function, rename symbol Fix Available A PR has been opened for this issue

Comments

@ChristianIvicevic
Copy link

  • 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

@isidorn isidorn assigned mjbvz and unassigned isidorn Apr 29, 2019
@mjbvz mjbvz transferred this issue from microsoft/vscode May 1, 2019
@mjbvz mjbvz removed their assignment May 1, 2019
@mjbvz
Copy link
Contributor

mjbvz commented May 1, 2019

Confirmed with TS 3.5.0-dev.20190501

@weswigham weswigham added Bug A bug in TypeScript Domain: Refactorings e.g. extract to constant or function, rename symbol labels May 8, 2019
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.6.0 milestone Jun 12, 2019
orta added a commit to orta/TypeScript that referenced this issue Aug 1, 2019
@orta orta added the Fix Available A PR has been opened for this issue label Aug 1, 2019
orta added a commit to orta/TypeScript that referenced this issue Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Refactorings e.g. extract to constant or function, rename symbol Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants