Ability to open class/method by ctrl+click on import from @salesforce/apex/

Issue #2341 resolved
Dmytro Kurylo created an issue

In Aura, you’re able to Ctrl+LMB on the 'c.methodName' to go to the method in the Apex controller.

Hovewer, in LWC it does not allow doing the similar thing.

The request is at least to have an ability to go to the Apex method by using Ctrl+LMB on the 'MyApexClass.myMethod' part of the “import myMethodName from '@salesforce/apex/MyApexClass.myMethod';” line.

Also it would be great to have a more complex behavior: ability to go to the Apex method if imported 'myMethodName' is called in the JS code. Or at least jump to the import line to be able to traverse to the Apex method from the import line.

Also, in Aura by using Ctrl+RMB you are able to preview the method called.

Would be great to have the same in LWC in places where the ability to use Ctrl+LMB is requested.

Thanks!

Comments (5)

  1. Scott Wells repo owner

    Hi. Can you please elaborate on the LWC Apex references that aren’t working for you? Here is an import of an @AuraEnabled method that properly hyperlinks to the Apex declaration:

    And here are @wire and imperative usages of the imported method that hyperlink to the import:

    Perhaps I’m missing another usage?

    Or I guess I didn’t ask, but are you using IC2 with a Community Edition IDE? If so, that would explain it as these types of references require the first-class JavaScript support offered by commercial JetBrains IDEs.

  2. Dmytro Kurylo reporter

    I’m indeed using the Community Edition IDE. It explains everything then.

    I didn’t even know these things already exist at the first place, since I never saw them.

    Sorry for bothering!

    P.S. Maybe it’s worth adding an IDE version when creating a ticket to immediately know whether the issue is connected to the IDE itself?

  3. Scott Wells repo owner

    Yeah, unfortunately there’s not much I can do there aside from creating my own JavaScript parser or integrating an existing one (which I’ve already kind of done, but it doesn’t understand ES6+). Sorry.

    And I can’t add custom fields to this issue tracker, but I’ll update the requested details to include that. Good suggestion!

  4. Log in to comment