microsoft / microsoft/TypeScript

GTD not working between ES5-style classes

Open
#31,315 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Awaiting More Feedback Domain: JavaScript Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

Reported in VS, repros in VS Code.

https://developercommunity.visualstudio.com/content/problem/556364/javascript-go-to-definition-or-f12-doesnt-work-wit.html

(function () {

    my.namepsace.myclass = function () {
        something: function something() {

        };
    };

    my.namespace.mystaticmethod = function () {
        return false;
    };

})();

(function () {

    another.namespace.class = function () {
        init: function init() {
            var myclass = new my.namepsace.myclass(); // GTD on myclass
            var result = my.namespace.mystaticmethod(); // GTD on mystaticmethod
        }
    };

})();

GTD does not work on the references to myclass and mystaticmethod.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the supplied JavaScript reproduction in VS Code and compare Go to Definition behavior for the myclass and mystaticmethod references. Review the linked Visual Studio report for additional context; done means both ES5-style class references navigate to their definitions.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.