Search code examples
javascriptdjangobackbone.jspycharmmarionette

Pycharm: Navigating to JS source specified in require('path/to/file')


Is there a way in pycharm to directly navigate to a file specified as a part of the require?

For instance, I have the import of the model randomFile.js

 var RandomFile = require('./path/to/file/randomFile');

When I create a instance like this:

 var rf = new RandomFile({'val': 'xyz'});

I would like to navigate to the randomFile.js when I hover & click on RandomFile.

For Django application mark directory as -> Sources root helped but this does not work for js files. Thoughts?

Thanks in advance


Solution

  • Solution:

    1) Select RandomFile in this line

    var RandomFile = require('./path/to/file/randomFile');
    

    2) Click Shift twice