Noam-Dori / ros-integrate

Extends IntelliJ-Based IDEs with ROS specific development tools
Apache License 2.0
22 stars 3 forks source link

Somehow interferes with CMake project loading. #39

Closed peci1 closed 3 years ago

peci1 commented 4 years ago

Describe the bug After CLion is started and loading a previous project, all project files are reported as not belonging to the project.

To Reproduce

  1. Have a CMake C++ project, set up the ROS plugin for it.
  2. Exit CLion
  3. Start clion
  4. load the previous project

Expected behavior The project files should be recognized as project files. Sometimes, the non-recognized project files get a weird yellowis-brownish background in the project view, sometimes they have normal background. When I press the "reload cmake project" button, project files are recognized correctly.

Environment Information:

Additional context Add any other context about the problem here.

Noam-Dori commented 4 years ago

Could you send a screenshot of the bugged project view? Also, what are your ROS settings? more specifically, the three "Environment" paths (ROS Path, Workspace, Additional Package Paths)?

peci1 commented 4 years ago

Snímek obrazovky pořízený 2020-04-06 19-31-50 I've also opened the CMake window so that you can see what happened during the project load. Nothing interesting seems to be there.

ROS Path: /opt/ros/melodic Workspace: /media/data/subt/thirdparty/ws Additional package path: empty

Here's CLion console output: clion.txt. I see there's a lot of hatchery-related bugs, but I thought this plugin is aware of hatchery and tries to cooperate...

Noam-Dori commented 4 years ago

Are you talking about the warning war above the file that says "This file does not belong to any project target, code insight features might not work properly?"

peci1 commented 4 years ago

Yes, this warning. CLion is then unable to suggest project-related inspections and only suggests syntax-based things.

Noam-Dori commented 4 years ago

This is actually an extension of a CLion bug: https://youtrack.jetbrains.com/issue/CPP-10204 The root of the issue is that CLion uses the CMake load action to index information used for most of its code insight features, and thus requires loading the CMake project every time you open CLion. I think this can be solved by turning on auto-reload in Build, Execution, Deployment > CMake but I am not too sure.

peci1 commented 4 years ago

I tested the plugin with Hatchery disabled. The bug is still there. I reloaded the project, quit clion, started it again, and project files are not recognized.

When I disable ROS integrate and enable Hatchery, the bug is not there.

Auto-reloading CMake project is not an option for me, that would eat up my CPU...

peci1 commented 4 years ago

Are you able to replicate this issue?

Noam-Dori commented 4 years ago

I stand corrected. Will get to working on a fix.

peci1 commented 4 years ago

Thanks!

Noam-Dori commented 4 years ago

The issue seems to be fixed, and is available on a separate branch for now. However:

  1. this was tested in a WSL, not directly on Ubuntu.
  2. In order for the fix to work for all IntelliJ-based IDEs, I created a new module type. This might interfere with the functionality of the original modules of the IDEs in ways I am not aware of, so any tests on actual workspaces in CLion, IntelliJ IDEA, and PyCharm would be greatly appreciated. It is for these reasons that I posted this fix in a seperate branch, f-stable-model (see #41) and added a specific pull request to see if any more problems are raised.
peci1 commented 4 years ago

Great. How can I test it?

Noam-Dori commented 4 years ago

First clone this repository from branch f-stable-model. then open the commandline of your system and change directory to the root of this repository (ros-integrate) If you are on windows, run gradlew buildPlugin If you are on linux, run ./gradlew buildPlugin this should create a new library in build/distributions named ros-integrate-0.1.6.zip Next, open your IDE and go to the "plugins" tab in the IDE/project settings. in the top you should see a gear icon next to the Marketplace and Installed tab names. Click on that gear and select the "install plugin from disk" option. in the menu that opens select the ros-integrate-0.1.6.zip library you just created. This should enable the new development version of the plugin. If you cannot find the .zip library, there is another library in build/libs named ros-intrgrate-0.1.6.jar that could work as well.

peci1 commented 4 years ago

Gradlew doesn't work for me because this repo is missing gradle/wrapper/gradle-wrapper.jar file. I tried with system gradle, but:

> Task :compileJava 
/tmp/ros-integrate/src/main/java/ros/integrate/pkg/ROSWorkspacePackageFinder.java:33: error: reference to Module is ambiguous
     private Module loadedModule = null;

Could you maybe provide the built zip instead?

Noam-Dori commented 4 years ago

the built zip is available here: https://github.com/Noam-Dori/ros-integrate/releases/tag/v0.1.6b1 I also updated the branch with the gradle wrappers if you still wish to compile from source.