How assosiate module with connection

Issue #57 resolved
Sergey Trusov created an issue

I opened project from another editor in IDEA, create new connection and would like to associate connection with my module, but there is no this option in settings.

Comments (20)

  1. Scott Wells repo owner

    Yeah, this is not the most intuitive part of the configuration because of concessions to development of multiple managed packages in a single dev org. I've been wanting to revisit it for the common/simple use case. In the connection configuration screen you'll see a grid labeled Development Packages. In that grid you'll likely see a single row with Name <default>. The right-most column is labeled Module. Your module should be available in that drop-down. Once that's selected, you can commit the connection. Let me know if that doesn't get you there.

  2. Sergey Trusov reporter

    Error related with sourceFolder tag in .iml

    <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />

    It don't generated after associate project with connection.

  3. Scott Wells repo owner

    Sergey, I'm not entirely sure I understand. Can you provide me with more details on your project and its modules? It would particularly help if you could send me the .idea/modules.xml, each of the *.iml files, and .idea/illuminatedCloud.xml. If you'd prefer not to attach them to the ticket (understandable), you can also email the to me at SCOTT AT ILLUMINATEDCLOUD DOT COM.

  4. Sergey Trusov reporter

    When you open existing project in IDEA and associate it with the connection. Save file to server (Ctrl + S) don't works, but Retrieve All Metadata works properly. I found problem in IDEA project file (.iml) where sourceFolder don't specified.

  5. Scott Wells repo owner

    So are you saying that you had an existing project with existing modules that covered source code? If so, the module type of those existing modules won't be correct because Illuminated Cloud provides its own custom module type, and certain operations are only performed for content from modules of that type. You'd need to create a new IC module to cover the same source roots. Or if you're comfortable hand-editing .iml files, you could try to update the .iml file in-place by comparing it to an existing IC .iml file, but of course the opportunity for errors there is higher if something important is omitted.

  6. Sergey Trusov reporter

    I have project, that contains only src folder. I open that project in IDEA, create connection to my Org, generate IC module, but source folder path don't generated by IC.

  7. Scott Wells repo owner

    Ah, okay. So yeah...the module root must be a child of the project root. The source directories can't be directly under the project itself. One level of indirection is required. So basically this is fine:


    but this is not:

    /path/to/myProject - also configured as the module root

    I've looked at a few ways to enforce this during module creation but the hooks to do that type of validation aren't present in IDEA's plugin SDK (or I haven't found them), so I put up a warning at that point and have included this in the FAQ (see The module content root directory is not a sub-directory of the project root directory):

    The main reasons for this is that the OST library gets added directly under the project and there can't be an intersection between the library root and the module roots or things won't resolve properly using IDEA's search scope mechanisms.

    Does that help?

  8. Sergey Trusov reporter

    Could you please provide a right way how I can import my existing project from VCS to IC?

  9. Scott Wells repo owner

    I just updated my previous comment which wasn't formatted properly. I helped another user with this issue yesterday (if it's the same issue that's impacting you, which it may not be). What that user did was create a subdirectory under the project root for the module root, e.g., /path/to/myProject/default, and then move the src directory to /path/to/myProject/default/src. The module was then recreated (as an Illuminated Cloud module) to have its root at /path/to/myProject/default and its source root at /path/to/myProject/default/src.

  10. Sergey Trusov reporter

    I understand the idea about files and folder structure, but in this case source root don't specify in .iml and go to class (ctrl+N) not working.

  11. Sergey Trusov reporter

    You can reproduce this issue if create following folder structure - /project/module/src/classes and try to open 'project' in IDEA and generate IC module for this project.

  12. Scott Wells repo owner

    Okay. Let me tell you what I'm going to try in detail so you can verify that it's the correct set of steps to reproduce the issue.

    1. Copy one of my existing projects with a src directory and a directory structure of the form /path/to/project/module/src/classes.
    2. Delete the .idea directory, .iml file, and OST so that it's for all practical purposes just the as if I'd pulled it out of some SCM that had never used IDEA or Illuminated Cloud.
    3. Create a new project in IDEA rooted at /path/to/project. I'll use File>New>Project..., not File>New>Project from Existing Sources... for this.
    4. Create a new Illuminated Cloud module in that project rooted at /path/to/project/module. This will require me to configure a connection as well. This will all happen as part of the new project wizard.
    5. Generate the OST for the connection. I can either do this by checking the box during the new project wizard or afterward.
    6. Use navigation features such as CTRL+N which in your experience will not work properly at this point.

    Does that sound right? If not, please let me know the differences with sufficient details so that I can hopefully reproduce this. Thanks!

  13. Scott Wells repo owner

    Okay, I followed the exact steps detailed above and verified that CTRL+N, CTRL+S, etc., all work properly. Please let me know if following these same steps doesn't help you get your existing source going with the plugin.

  14. Sergey Trusov reporter

    Thanks, your way works fine. My steps: 1. File > Open 2. Select the module -> Go to Settings -> Associate module with new connection 3. Generate OST

  15. Scott Wells repo owner

    Gotcha. Yeah, if I understand what you were doing correctly, you were associating an existing non-IC module with the project and then trying to use IC features with it. It's important that the module be created as an IC module. Sounds like I can resolve this issue at this point. Please reopen if for some reason you're not good to go now!

  16. Sergey Trusov reporter

    you were associating an existing non-IC module with the project and then trying to use IC features with it.

    You are right.

  17. Log in to comment