镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Compiler should rewrite namespaced types found in JSDoc #8120

Description

@evmar

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.)

Activity

  1. added
    Won't FixThe severity and priority of this issue do not warrant the time or complexity needed to fix it
    Out of ScopeThis idea sits outside of the TypeScript language design constraints
    and removed on May 17, 2016
  2. mhegazy commented on May 17, 2016

    @mhegazy
    Contributor

    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.

  3. locked and limited conversation to collaborators on Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Out of ScopeThis idea sits outside of the TypeScript language design constraintsSuggestionAn idea for TypeScriptWon't FixThe severity and priority of this issue do not warrant the time or complexity needed to fix it

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions