IC2 Not recognizing some Objects, methods and properties annotated with @NamespaceAccessible from sister-package.

Issue #2604 open
Sebastian Kessel created an issue

I have a hub-and-spoke architecture for my packaging. For various reasons, I can’t include both types of package (extensions and core) in the same repo. That forces me to create a core package, mark it as a dependency and install it in the scratch orgs where I develop the extension packages.

My problem is that I have objects, methods and properties annotated with @NamespaceAccessible in the core package, but somehow the code inspector is not recognizing it.

To complicate things, one of the things I am doing is implementing a class in the extension package that implements a base class in the core package.

To clarify, this compiles, deploys and works well. The code inspector, however, has the red squiggly lines in places I wouldn’t expect them to be.

In the screenshots attached you will see:

  1. The class DealerSelector (Core)
  2. The base class SchedulerBase (Core)

    1. Note that the schedule method here is properly detected by the code inspector in the extension package
  3. The class FerrariGetSalesLeadsBatchable with the “errors” marked (Extension)

It’s really annoying, but definitely not a blocker at this point….. or maybe it’s a “me” problem?

Comments (11)

  1. Scott Wells repo owner
    • changed status to open

    Hi. Can you please confirm that you have the latest build of IC2 installed. A change was made in 2.3.2.0 to include @NamespaceAccessible symbols from installed packages with the same namespace in the generated OST. Once on a 2.3.2.0+ version of IC2, you will need to regenerate your OST, and it will be critical that the current project/scratch org have the same namespace as the installed package.

    If that's all the case, let me know and we can go through a quick checklist to make sure that the project/connection are set up properly, and if the issue is still present, I'll need additional details about these packages/orgs.

  2. Sebastian Kessel reporter

    Hey Scott, I am in 2.3.2.2…. I have regen’d the OST quite a few times, including manually deleting the zip file and doing it again. The only thing I have not done is set up a net-new project.

  3. Scott Wells repo owner

    Okay. If you open Illuminated Cloud | Configure Project, do you see the correct org namespace reflected there, e.g.

    If not, please open the IC2 connection manager, click Test on the associated connection to force it to re-query the org namespace, then OK to commit those changes, and try to regenerate the OST with the correct org namespace.

    Please let me know whether or not that helps. If not, I’ll likely need to get a debug log from OST generation from you.

  4. Scott Wells repo owner

    Okay, can you please enable debug logging for Offline Symbol Table Generation, regenerate this project’s OST, and provide all resulting idea*.log* files with timestamps from the duration of OST generation for review? If you’d prefer not to attach those files here for privacy reasons, feel free to email them to me instead.

  5. Scott Wells repo owner

    Thanks for the logs. They aren’t 100% complete for the OST generation, but it does look like they may have at least some of what I need as I do see it finding quite a few @NamespaceAccessible symbols, e.g.:

    2024-07-29 13:30:19,585 [17623449]   INFO - #com.illuminatedcloud.intellij.ost.OfflineSymbolTable - Obfuscated class body found for SparkHaus__MakeSelector.
    2024-07-29 13:30:19,585 [17623449]   INFO - #com.illuminatedcloud.intellij.ost.OfflineSymbolTable - @NamespaceAccessible interface found for obfuscated class SparkHaus__MakeSelector.
    ...
    2024-07-29 13:30:19,586 [17623450]   INFO - #com.illuminatedcloud.intellij.ost.OfflineSymbolTable - Obfuscated class body found for SparkHaus__InventoryVehicleService.
    2024-07-29 13:30:19,586 [17623450]   INFO - #com.illuminatedcloud.intellij.ost.OfflineSymbolTable - @NamespaceAccessible interface found for obfuscated class SparkHaus__InventoryVehicleService.
    ...
    2024-07-29 13:30:19,586 [17623450]   INFO - #com.illuminatedcloud.intellij.ost.OfflineSymbolTable - Obfuscated class body found for SparkHaus__UserService.
    2024-07-29 13:30:19,586 [17623450]   INFO - #com.illuminatedcloud.intellij.ost.OfflineSymbolTable - @NamespaceAccessible interface found for obfuscated class SparkHaus__UserService.
    

    and many more.

    Can you provide one or more specific examples of things that are denoted as @NamespaceAccessible but aren’t ending up in the generated OST stub types? Can you also provide the interfaces for those from the original source so I can see how they’re declared vs. how they’re reflected in the queried SymbolTable information and resulting OST?

  6. Scott Wells repo owner

    Also, one thing that would be exceptionally helpful if possible would be an accessible scratch org with one of these packages installed where I could try to generate the OST from it directly, but I certainly understand if that’s not possible for privacy reasons. If it is possible, that would make understanding this issue much simpler, though.

  7. Sebastian Kessel reporter

    I just emailed you credentials to the scratch org. Dude, I dont know what I would do without IC2, least I can do is make your life easier

  8. Sebastian Kessel reporter

    Take a look a the class FerrariLeadService as well as FerrariGetSalesLeadsBatchable and follow the red squiggles.

  9. Log in to comment