Skip to content

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

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bugjavascriptJavaScript support issuesupstreamIssue identified as 'upstream' component related (exists outside of VS Code)verifiedVerification succeeded

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions