Skip to content

TypeScript symbols is empty inside closure (like jQuery plugins) #8218

Closed

Description

From Jari Pennanen (@Ciantic) on January 2, 2016 8:38

I tried developing basic jQuery plugin with TS, looks like the symbols list is totally empty if I use following code:

/// <reference path="./typings/tsd.d.ts" />
(function ($: JQueryStatic) {

    interface Anything {
        something : string
    }

    function func() {
    }

})(jQuery);

I think it should recgonize the whole file spanning closure and not let it ruin the symbols listing.

Copied from original issue: microsoft/vscode#1741

Activity

  1. jrieken commented on Apr 20, 2016

    @jrieken
    ContributorAuthor

    From Felix Becker (@felixfbecker) on January 3, 2016 12:5

    I also think this is annoying. Symbols view only shows symbols in the global scope, also for Javasript. If you use class expressions for Angular, like .controller('MyController', class MyController { ... }) you will never get any methods of that class show up in the symbol view.

  2. jrieken commented on Apr 20, 2016

    @jrieken
    ContributorAuthor

    From Paramvir Dhindsa (@paramquery) on April 20, 2016 14:5

    +1

    much needed feature.

  3. jrieken commented on Apr 20, 2016

    @jrieken
    ContributorAuthor

    This is an issue with TypeScript. For JavaScript this actually works a lot better then for TypeScript despite using the same language service...

  4. added
    BugA bug in TypeScript
    Domain: APIRelates to the public API for TypeScript
    and removed on Apr 20, 2016
  5. mhegazy commented on Apr 20, 2016

    @mhegazy
    Contributor

    Bill Ticehurst (@billti) had a fix for the JS case. we need to unify the two implementations. #7523 tracks some of this work.

  6. mhegazy commented on Jun 6, 2016

    @mhegazy
    Contributor

    Andy (Andrewkraft) (@Andy-MS) would this be handled by your refactor?

  7. mhegazy commented on Jun 6, 2016

    @mhegazy
    Contributor

    i think that is a better place to be in. if that turned out to be another source of complains, may be we should allow all function declarations regardless if they are containers or not.

  8. ghost closed this as completedon Jun 20, 2016
  9. 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

    BugA bug in TypeScriptDomain: APIRelates to the public API for TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions