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

[JavaScript/Node.js] Support for "Go to definition" of code located in "node_modules" #10808

Closed
waderyan opened this issue Sep 9, 2016 · 12 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@waderyan
Copy link

waderyan commented Sep 9, 2016

From @drywolf on January 29, 2016 15:54

I am using "npm link ../../lib/my-lib" to symlink a local module that is shared across several apps into the "node_modules" directory of each of the apps. This is nice for developing the shared lib in combination with all the apps.

// a standard npm module, can't navigate to its definition
var shortid = require('shortid');
// some functions from a symlink-ed local module inside node_modules, can't navigate to it either
var ModelMountUtils = require('@ipp/loopback-lib').ModelMountUtils;
var RemoteMethodUtils = require('@ipp/loopback-lib').RemoteMethodUtils;

VS-Code does not allow me to navigate to this shared libraries' code by pressing F12 or "Go to definition". The same applies for all other npm modules inside the node_modules directory.

Is this restricted functionality intentional ? or should it be working and I am running to a JS parsing bug that prevents the "Go to definition" to do its work ?
If the "Go to definition" feature is not supposed to work for all things "node_modules" ... could we integrate an exception for symlink directories inside node_modules ?

Thanks

Copied from original issue: microsoft/vscode#2550

@waderyan
Copy link
Author

waderyan commented Sep 9, 2016

From @jrieken on January 29, 2016 18:6

That's a bug. We will soon ship with a revamped JS language support and such things should be fixed then

@waderyan
Copy link
Author

waderyan commented Sep 9, 2016

From @drywolf on January 31, 2016 19:5

Nice, I'm looking forward to the next release 😄

@waderyan waderyan self-assigned this Sep 9, 2016
@waderyan waderyan added Bug A bug in TypeScript js labels Sep 9, 2016
@waderyan
Copy link
Author

waderyan commented Sep 9, 2016

From @girvo on August 17, 2016 4:25

Just checking, this still seems to be broken in the latest Insider build. Is that expected behaviour? It's a React Native Javascript project, if that matters :)

@waderyan
Copy link
Author

waderyan commented Sep 9, 2016

From @zjaml on September 9, 2016 7:1

Subscribed to this too. The feature could be very useful.

@waderyan
Copy link
Author

waderyan commented Sep 9, 2016

From @jrieken on September 9, 2016 8:16

@waderyan This is an issue with the typescript brain

@waderyan
Copy link
Author

waderyan commented Sep 9, 2016

@jrieken just to make sure I understand, when you say "typescript brain" you mean the TypeScript language service, correct?

@waderyan
Copy link
Author

waderyan commented Sep 9, 2016

From @jrieken on September 9, 2016 15:27

yes

@mhegazy
Copy link
Contributor

mhegazy commented Sep 21, 2016

Should be working correctly in latest drop of TypeSript (TS 2.0.2 or later). VSCode ships with an older version of TypeScript. Please see Using Newer TypeScript Versions documentation for more details on updating your VSCode to use a different version of TypeScript.

@mhegazy mhegazy closed this as completed Sep 21, 2016
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Sep 21, 2016
@mhegazy mhegazy modified the milestones: Community, TypeScript 2.0, TypeScript 2.0.3 Sep 21, 2016
@rockswang
Copy link

How to enable this feature? I have upgrade the TypeScript to 2.1.5, however when I highlight an external import and click F12, nothing happened.
Is this also fixed for javascript service?

@mhegazy
Copy link
Contributor

mhegazy commented Feb 3, 2017

can you share a project?

@danielmhanover
Copy link

It seems F12 jumps to the TypeScript definition file but not into the actual source code. Is there any intention of supporting a direct-to-source jump?

@mhegazy
Copy link
Contributor

mhegazy commented May 7, 2018

please see #22658

@microsoft microsoft locked and limited conversation to collaborators Jul 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

4 participants