OST doesn't include information about packaged LWC/Aura/Visualforce components

Issue #2412 duplicate
Jason Clark created an issue

Updated the title to more accurately reflect the enhancement request nature of this for future reference.

I’m using IC2 with WebStorm.

I am working in an org with a couple of unlocked packages installed; the packages contain LWCs. Because the code is developed and packaged in a separate packaging org, I don’t retrieve the LWC source locally (I don’t want it in the repo for this client’s org). The issue is that even after rebuilding the full symbol table, I can’t use autocomplete to reference those installed LWCs when editing an LWC HTML file. This is in contrast to Apex classes from an unlocked package, which I can reference after rebuilding the symbol table, even if I don’t fetch the source.

Is this expected behavior? I’m guessing that IC2 can fetch symbol table info from the org for Apex Classes without fetching the class, but cannot get the same info for LWC JS files, and must always use local JS files for autocompletion? Do I need to fetch the LWC files and .gitignore them?

If this should be working but is not, I have captured the Idea log from a full symbol table rebuild. I can send it, but I’d prefer not to attach it publicly as it could contain client info.

Official response

  • Scott Wells repo owner

    Hi. Yes, you’re correct that this is expected behavior. The APIs used by IC2 to build the OST don’t include information about packaged LWC(/Aura/Visualforce) components. At present, the only way to get that information would be to retrieve it, even if just to inspect it sufficiently to emit stubs into the OST that could then be used for completion, navigation, documentation, etc.

Comments (6)

  1. Scott Wells repo owner

    Hi. Yes, you’re correct that this is expected behavior. The APIs used by IC2 to build the OST don’t include information about packaged LWC(/Aura/Visualforce) components. At present, the only way to get that information would be to retrieve it, even if just to inspect it sufficiently to emit stubs into the OST that could then be used for completion, navigation, documentation, etc.

  2. Jason Clark reporter

    @Scott Wells Thanks for confirming. I went ahead and fetched all package code, added to .gitignore, and rebuilt the OST, and now my completion is working fine. Probably should have thought of the .gitignore trick sooner.

  3. Scott Wells repo owner

    Yeah, as a workaround I was going to recommend retrieving into a separate module that you set up as a dependency, then adding to .gitignore (and potentially .forceignore once retrieved). It’s far from ideal, but then I noticed that you’re using WebStorm and, while technically it can process modules, you can’t manage them in the UI like you can in IntelliJ IDEA. And that workaround will only work for components from the same namespace as the local project…

    Anyway, glad you were able to get things going. Given that more and more people are starting to split up things across multiple unlocked packages, it may be time to revisit this enhancement.

  4. Log in to comment