Lightning Components: <ctrl+click> navigate to controller from markup file

Issue #808 resolved
Doug Ayers created an issue

When editing a Lightning Component's markup file (.cmp), would be nice to have feature where I could <ctrl/cmd>+click a function reference specified by {!c.methodName}

For example, in below snippet, <ctrl/cmd>+click on "handleSaveButtonClick" of {!c.handleSaveButtonClick} would open/navigate me to the controller js file of that same component bundle where that function name is defined:

                        <lightning:button
                            label="Save"
                            title="Save"
                            variant="brand"
                            onclick="{!c.handleSaveButtonClick}"/>

By extension, if in the js controller and click on methods of the helper argument, that would be great if the click navigation opened the helper js file too ^_^

Thanks

Comments (10)

  1. Scott Wells repo owner
    • changed version to 2.0

    A little birdie told me that you might just have this in the next week or so along with a boatload of other stuff...

  2. Scott Wells repo owner

    Oh, and just to clarify what the little birdie told me, for navigation across JavaScript references in controllers, renderers, and helpers, you would need IntelliJ IDEA UE or WebStorm. That won't be available in IntelliJ IDEA CE, though navigation across references to server-side Apex controllers will work in CE (and UE/WS).

  3. Scott Wells repo owner

    I believe this should work in IC2, but if you find instances that don't, please just reopen and list them here.

  4. Brad Vidal

    Hey @RoseSilverSoftware, I'm using IC2 (2.0.1.5) with WebStorm 2018.1 and this feature isn't working for me.

  5. Scott Wells repo owner

    Hey, Brad. I'll take a look. There are currently some missing references and code completions in Lightning, in particular from markup to JavaScript. You may be hitting one of those. Now that I have method extraction refactoring out (and once I add occurrences support), I plan to finish out the Lightning completion/references so that any place those should work, they do.

  6. Shmuel Sochet

    Hi @RoseSilverSoftware I'm using IC2 (2.0.3.9) and this isn't working. Although being that I'm using Pycharm, that may be the problem, as per issue: #1138

    I just tried this with Webstorm and I'm still having the same issue. Do you have an update on your previous comment, regarding missing references and code completions?

  7. Log in to comment