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

Fixes for refactor "Annotate with type from JSDoc" #19304

Merged
merged 7 commits into from
Oct 18, 2017

Conversation

sandersn
Copy link
Member

  1. Collapse both refactors down to one. The message only differed by one character, so the hassle wasn't worth it. This fixes the duplicate available refactors.
  2. Transform JSDoc index signatures (Object<string, T>) to TS index signatures.
  3. Only make the refactor available when it could add types. It's not available when there's a type already, or when there's no applicable JSDoc type.
  4. Remove an erroneous error on JSDoc index signatures on @param tags saying that "Object is not generic".

Fixes #19266
Fixes #19238
Fixes #19258

Previously there were two, and two always fired.
1. Object literals are single-line now.
2. Index signatures transform to TS index signatures.
3. The refactoring is only available when it could add types.
The test case shows that the errorenous error no longer appears.
1. Transform index signatures to TS index signatures.
2. Print object literals on a single line.
3. Only offer the refactor when it could add types. (There must not be a
type annotation already, and there must be a JSDoc that applies.)
@sandersn sandersn merged commit b40e18d into master Oct 18, 2017
@sandersn sandersn deleted the dedupe-jsdoc-annotation-refactors branch October 18, 2017 21:50
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants