GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fixes for refactor "Annotate with type from JSDoc" by sandersn · Pull Request #19304 · microsoft/TypeScript

Conversation

@sandersn

@sandersn Nathan Shively-Sanders (sandersn) commented Oct 18, 2017

Copy link
Copy Markdown
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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Nathan Shively-Sanders (sandersn) added 7 commits October 17, 2017 16:33
@sandersn
Collapse jsdoc annotation refactors to one
64fc495
Previously there were two, and two always fired.
@sandersn
Update baselines
e962e4a
@sandersn
Remove erroneous error for JSDoc object literals
f374117
appears with checkJS.
@sandersn
Update annotateWithTypeFromJSDoc tests
c13506e
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.
@sandersn
Add a better test for jsdoc index signatures.
2473ffc
The test case shows that the errorenous error no longer appears.
@sandersn
Fix bugs in jsdoc annotation refactor
aa73ed8
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
Move isJSDocIndexSignature to utilities
f82dd7b
@sandersn
Nathan Shively-Sanders (sandersn) requested review from Daniel Rosenwasser (DanielRosenwasser) and Mohamed Hegazy (mhegazy) October 18, 2017 20:21
mhegazy
Mohamed Hegazy (mhegazy) approved these changes Oct 18, 2017
View reviewed changes
@sandersn
Nathan Shively-Sanders (sandersn) merged commit b40e18d into master Oct 18, 2017
@sandersn
Nathan Shively-Sanders (sandersn) deleted the dedupe-jsdoc-annotation-refactors branch October 18, 2017 21:50
@microsoft 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.

Reviewers

@DanielRosenwasser Daniel Rosenwasser (DanielRosenwasser) Awaiting requested review from DanielRosenwasser
1 more reviewer
@mhegazy Mohamed Hegazy (mhegazy) mhegazy approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

JSDoc extraction doesn't work for index signature object maps JSDoc to TS annotation refactoring is always available in annotated functions Duplicate 'annotate from JSDoc' suggestion'

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@sandersn @mhegazy
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.