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

Refactoring: Extract Type #24017

Closed
DanielRosenwasser opened this issue May 10, 2018 · 5 comments
Closed

Refactoring: Extract Type #24017

DanielRosenwasser opened this issue May 10, 2018 · 5 comments
Labels
Duplicate An existing issue was already created

Comments

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented May 10, 2018

Background

I hate offhandedly writing a type out in one location that I'll need to cut/paste later.

Proposal

Given a selected type segment, provide the ability to extract that type into

  • an interface if given a type literal or
  • a type alias otherwise

in any scope where each captured type is available.

Optionally, a parameterized type alias can be made available in scopes where captured types are not available.

extracttypealias

@DanielRosenwasser DanielRosenwasser added Suggestion An idea for TypeScript Domain: Refactorings e.g. extract to constant or function, rename symbol labels May 10, 2018
@Kingwl
Copy link
Contributor

Kingwl commented May 10, 2018

👍 a useful feature

@mhegazy
Copy link
Contributor

mhegazy commented May 10, 2018

Duplicate of #23869

@mhegazy mhegazy marked this as a duplicate of #23869 May 10, 2018
@mhegazy mhegazy added Duplicate An existing issue was already created and removed Domain: Refactorings e.g. extract to constant or function, rename symbol Suggestion An idea for TypeScript labels May 10, 2018
@DanielRosenwasser
Copy link
Member Author

DanielRosenwasser commented May 10, 2018

Mine is better. It has a GIF.

@mhegazy
Copy link
Contributor

mhegazy commented May 10, 2018

mine now has the GIF 😛

@DanielRosenwasser
Copy link
Member Author

Thief!

@microsoft microsoft locked and limited conversation to collaborators Jul 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants