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

Compiler should rewrite namespaced types found in JSDoc #8120

Closed
evmar opened this issue Apr 16, 2016 · 1 comment
Closed

Compiler should rewrite namespaced types found in JSDoc #8120

evmar opened this issue Apr 16, 2016 · 1 comment
Labels
Out of Scope This idea sits outside of the TypeScript language design constraints Suggestion An idea for TypeScript Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it

Comments

@evmar
Copy link
Contributor

evmar commented Apr 16, 2016

Consider input code like:

import {Foo} from './foo';

/**
 * @type {Foo}
 */
var foo = new Foo();

TypeScript imports the module under a generated name (foo_1 when I tried it), producing code like:

    /**
     * @type {Foo}
     */
    var foo = new foo_1.Foo();

But now the JSDoc refers to a type that doesn't exist -- it should instead say @type {foo_1.Foo}. (Another way they could match is if the import created a new variable Foo instead of using foo_1.Foo everywhere.)

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Apr 18, 2016
@mhegazy mhegazy added Suggestion An idea for TypeScript In Discussion Not yet reached consensus and removed Bug A bug in TypeScript labels Apr 18, 2016
@mhegazy mhegazy added Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it Out of Scope This idea sits outside of the TypeScript language design constraints and removed In Discussion Not yet reached consensus labels May 17, 2016
@mhegazy
Copy link
Contributor

mhegazy commented May 17, 2016

The compiler should not be messing up with comments it did not create. The correct solution here is to ask the compiler to emit the JSDoc comments for you, including the type information, and it should emit valid names that will match the emitted JS code. that is tracked by #10.

@mhegazy mhegazy closed this as completed May 17, 2016
@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
Out of Scope This idea sits outside of the TypeScript language design constraints Suggestion An idea for TypeScript Won't Fix The severity and priority of this issue do not warrant the time or complexity needed to fix it
Projects
None yet
Development

No branches or pull requests

3 participants