The easiest way to get to the source is to disable the appropriate library (if the d.ts
files were loaded as a library) / delete typescript definitions from the project. WebStorm will then try to find the definition in the .js files.
There is a function request for the ability to "combine" typescript definitions with available .js
definitions, using d.ts
to complete and .js
to navigate ( WEB-12630 ). The only problem is that WebStorm cannot always find the correct definition in .js
- and that is the reason for using typescript definitions. For example, if module properties are determined by iterating files in the file system:
fs.readdirSync(__dirname + '/middleware').forEach(function(filename){ if (!/\.js$/.test(filename)) return; var name = basename(filename, '.js'); function load(){ return require('./middleware/' + name); } exports.middleware.__defineGetter__(name, load); exports.__defineGetter__(name, load); });
Allow them to complete / navigate is not possible
source share