The LWC Apex Definition VSCode extension enhances your development experience by providing hover and definition support for Apex methods imported in Lightning Web Components (LWC). When you hover over or Ctrl+Click an imported Apex method, this extension retrieves and displays the method's signature from the corresponding Apex class.
Features
Hover Support: Displays the method signature from the Apex class when hovering over an imported Apex method.
Go to Definition: Ctrl+Click on an imported Apex method to navigate directly to its definition in the Apex class.
Precise Symbol Lookup: Uses VSCode's symbol provider to efficiently locate the method without searching the entire workspace.
Usage
Open a Lightning Web Component file (JavaScript or TypeScript).
Hover over an imported Apex method to see its signature.
Ctrl+Click on an imported Apex method to navigate to its definition in the Apex class.
Example
LWC Import:
import someMethod from "@salesforce/apex/someClass.someMethod";
Hover Output:
public static List<String> someMethod(String someParam);
Apex Class:
public with sharing class someClass {
public static List<String> someMethod(String someParam) {
// Method implementation
}
}