SObjects are blank when creating a new trigger if project is imported from Eclipse or checked out from Version Control

Issue #121 resolved
June Bischoff created an issue

My first attempts at creating a project I imported my project from Eclipse. I also tried checking it out from Git.

For these projects, when I go to create a new trigger, the SObject dropdown is empty. I also get no changes when I attempt to pull metadata from the server. (I created a trigger directly on the server as an attempt to get around the empty SObject.)

My OST is generated and appears to be correct; I've invalidated the caches and restarted from the file menu, as well as rebuilt them and restarted from the settings menu.

From your suggestions on issue #75:

  • Looking at the OST, I do see files I'd expect at the project root.

  • Project Settings/Libraries does have the Illuminated Cloud (connection name) with both Classes and Sources mapped to the OST root directory.

  • The library is configured as a dependency of my module.

I've attached my idea.log.

The priority of this is not terribly high, as I think I'm set creating a brand new project; the create new trigger SObjects field has contents, and I get my new trigger from Force.com when I do the pull.

I'm still working out the details where git thinks I have all new files because of the change in module/folder names for my new project. Any instructions you can point me to on creating a new Illuminated Cloud project and hooking it up to Git would be greatly appreciated.

Comments (8)

  1. Scott Wells repo owner

    Hi, June. Yeah, you definitely need to create the project using File>New>Project and not by importing directly from an Eclipse project or VCS repository. This is because the other way doesn't create the appropriate module type for Illuminated Cloud. However, you can create a project on top of an existing source root, and it seems like that's working okay for you.

    I know as long as your .git directory is at the top of your project and your module directory is a descendant of your project directory, things work well. That's how I have all of my projects set up. If you're trying to sit on top of an existing directory structure where the src directory is right under the project root and a peer to the .git directory, it may not work without some fiddling. Can you let me know the top-level directory structure of your project so I can provide a more complete answer to that question? Thanks!

  2. June Bischoff reporter

    C:\Apps\IlluminatedCloud\TempDev has folders .git .idea IlluminatedCloud SalesforceSandbox .gitignore

    where SalesforceSandbox is my module directory, if I'm understanding the terminology correctly.

    SalesforceSandbox contains the following: .settings Referenced Packages src .project salesforce.schema SalesforceSandbox.iml

    When I created the project, I set the project location up as C:\Apps\IlluminatedCloud\TempDev, the Module Name as SalesforceSandbox, and the content root and module file locations as C:\Apps\IlluminatedCloud\TempDev\SalesforceSandbox.

    After ignoring a bunch of mostly-whitespace diffs when retrieving the metadata (I think the rest of the changes were branch issues on my part) and one restart due to a Java Heap Space error, I was able to generate the OST.

    I've done my first little bit of coding, with requisite joyous weeping for code completion and navigation.

    I do have a question about code completion for managed packages. (Let me know if I should start a new ticket) We use a managed package PBSI containing a custom object PBSI__Parent_Lot__c.

    I'm writing the following line of code: PBSI__Parent_Lot__c sourceLot = new PBSI__Parent_Lot__c(PBSI__Item__c = item.Id);

    The autocomplete recognizes the object when I type "Parent_Lot" and completes it correctly with the PBSI__ prefix. It does NOT autocomplete for the field PBSI__Item__c; I've tried typing both Item and PBSI in the parentheses as well as starting a new line with sourceLot.PBSI and sourceLot.Item. No go either way.

    I've attached the generated OST file for Parent Lot. Any advice on making autocomplete work for fields on custom objects within a managed package namespace?

  3. Scott Wells repo owner

    Thanks for the details, June. Curious that it's not completing the field based on "Item". That should work fine. I might recommend that you rebuild caches and indices just in case something got into a bad state with the bailed first attempt to generate the OST. You can find that option in the connection configuration screen.

    If that doesn't address it, can you do me a favor and see if it completes properly when you enter the following SOQL query using this same type of namespace-defaulting completion:

    PBSI__Parent_Lot__c[] parentLots =
    [
        SELECT Id, PBSI__Item__c
        FROM PBSI__Parent_Lot__c
    ];
    

    I'm just curious as to whether it's a general issue with that SObject and its fields or a specific issue determining the completion context when you're inside of the SObject constructor params.

    Regarding the diffs on retrieve, the built-in directory comparison tool is decent but definitely not best-in-class. I would recommend you install an external tool such as Beyond Compare (my personal favorite), Araxis Merge, or even WinMerge and configure it as the default external diff tool. You can then tell it to ignore unimportant differences, show context diffs, etc., and get a MUCH more refined view of the actual diffs not only on retrieve but also when comparing revisions in git itself. Once one of these tools is installed, you can register it with IntelliJ IDEA under Settings>Tools>Diff>External Diff Tools.

    Let me know if any of this helps!

  4. June Bischoff reporter

    Rebuilding the caches/indices did the trick!

    Thanks as well for the suggestions on the external diff tools.

  5. Log in to comment