Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to jump to JavaScript library source?

Tags:

I'm using PyCharm for developing my webApp (I am from python word) and noticed: I cannot jump to react source.

For example: I want to look hot to extend Component, set cursor on Component press Cmd + right mouse click and see cannot find declaration to go to.

import React, { Component } from 'react'

Is there a way to do this or maybe there are other editors with such ability?

Update: Seems like it works only in WebStorm but not in Pycharm. For Pycharm need load library in settings.

like image 757
Tany Avatar asked Sep 08 '16 08:09

Tany


1 Answers

I'm able to do this using following setup:

  • WebStorm -> Preferences -> Languages & Frameworks -> JavaScript -> JavaScript language version: ReactJS (JSX Harmony)
  • Cmd + hover mouse over the library, wait until it turns blue and underlined and then (normal, left) click
  • WebStorm 2016.2.3

This is the state where I've just did cmd + hover. To jump to source you have to click also. This is the state where I've just did cmd + hover. To jump to source you have to click also.


Here is the same answer from the official source

From there you can also jump to the component definition with Cmd-click (Ctrl+click on Windows and Linux) on component name or see a definition in a popup with Cmd-Y (Ctrl+Shift+I).

like image 137
Lyubomir Avatar answered Sep 26 '22 17:09

Lyubomir