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

Add quick fix to install module definitions from @types #14423

Closed
mhegazy opened this issue Mar 2, 2017 · 6 comments
Closed

Add quick fix to install module definitions from @types #14423

mhegazy opened this issue Mar 2, 2017 · 6 comments
Labels
Domain: Quick Fixes Editor-provided fixes, often called code actions. Fixed A PR has been merged for this issue Suggestion An idea for TypeScript

Comments

@mhegazy
Copy link
Contributor

mhegazy commented Mar 2, 2017

If a module was not found, or only js file was found, a quick fix can be offered to install the module from @types.

@mhegazy mhegazy added Domain: Quick Fixes Editor-provided fixes, often called code actions. Bug A bug in TypeScript Salsa labels Mar 2, 2017
@mhegazy mhegazy added this to the TypeScript 2.3 milestone Mar 2, 2017
@mhegazy mhegazy self-assigned this Mar 24, 2017
@mhegazy mhegazy added Domain: Refactorings e.g. extract to constant or function, rename symbol and removed Domain: Quick Fixes Editor-provided fixes, often called code actions. labels Mar 24, 2017
@mhegazy mhegazy modified the milestones: TypeScript 2.4, TypeScript 2.5 Jun 5, 2017
@mhegazy mhegazy assigned ghost and unassigned mhegazy Jun 8, 2017
@mhegazy
Copy link
Contributor Author

mhegazy commented Jun 8, 2017

We need to support this both as:

  • Quick fix for noImplictAny error on modules
  • refactoring for untyped module imports

For both the quick fix and the refactor, the edit will be empty, since there is no code change, so we will need to add a new property on the API to signal the editor to call back to install types with some arguments (being the type to install, and the location of the package.json).

//CC @mjbvz

@mhegazy
Copy link
Contributor Author

mhegazy commented Jun 13, 2017

We also need to handle case if the package does not have any definitions available. in this case we need to create a new .d.ts file for it..
ideally something like what users would publish to DT, and add a path mapping for the module.

@andy-ms please check with @DanielRosenwasser about details of this one.

@DanielRosenwasser DanielRosenwasser added Domain: Quick Fixes Editor-provided fixes, often called code actions. and removed Domain: Refactorings e.g. extract to constant or function, rename symbol labels Jul 12, 2017
@ragtime
Copy link

ragtime commented Jul 19, 2017

Would the install command be configurable?
e.g. for yarn users.

@mhegazy mhegazy added Suggestion An idea for TypeScript and removed Bug A bug in TypeScript labels Aug 31, 2017
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Oct 16, 2017
@mhegazy
Copy link
Contributor Author

mhegazy commented Oct 17, 2017

Fixed by #19130

@ghost
Copy link

ghost commented Oct 17, 2017

@mhegazy Do we want to open a new issue for yarn support?

@mhegazy
Copy link
Contributor Author

mhegazy commented Oct 17, 2017

created #19269 to track that.

@mhegazy mhegazy closed this as completed Oct 17, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Domain: Quick Fixes Editor-provided fixes, often called code actions. Fixed A PR has been merged for this issue Suggestion An idea for TypeScript
3 participants