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

Rename file via rename on import paths #24501

Closed
DanielRosenwasser opened this issue May 30, 2018 · 1 comment
Closed

Rename file via rename on import paths #24501

DanielRosenwasser opened this issue May 30, 2018 · 1 comment
Labels
Fixed A PR has been merged for this issue Suggestion An idea for TypeScript

Comments

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented May 30, 2018

I want to be able to rename a file based on an import or export specifier:

import "./foo";

import * as foo from "./foo.ts";

export * from './bar';

In other words, F2 in VS Code on "./foo", "./foo.ts, and './bar' should allow me to rename the file if it originates from the appropriate workspace. Ideally this doesn't mess with .d.ts files that aren't considered hand-authored, but that's tough to differentiate.

My expectations:

  • we should maintain the extension for the new file if unspecified in the import/export specifier (i.e. keep it as .js, .jsx, .ts, .tsx if not mentioned in the resulting string)
  • we should change the extension if explicitly specified in the new specifier
  • for affected import/export specifiers, we should maintain whether or not an extension was ever specified.
@mhegazy mhegazy added the Suggestion An idea for TypeScript label May 30, 2018
@mhegazy mhegazy added this to the TypeScript 3.0 milestone May 30, 2018
@mhegazy mhegazy assigned ghost May 30, 2018
@ghost ghost added the Fixed A PR has been merged for this issue label Jun 5, 2018
@mhegazy mhegazy modified the milestones: TypeScript 3.0, TypeScript 3.1 Jul 2, 2018
@omril1
Copy link

omril1 commented Sep 4, 2018

Does it mean we will be able to change the path as well?

@ghost ghost closed this as completed in #24702 Sep 10, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed A PR has been merged for this issue Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants