CLion 2020.1 does not recnognize (PlatformIO) sources anymore

Completed

I just updated to 2020.1 and my PlatformIO sources are not even more recognized as belonging to a project target. 

There is the horrible yellow row reporting:

"The file does not belong to any project target, code insight features might not work properly"

I tried to add

MESSAGE(INFO "Sources: ${SRC_LIST}")
add_executable(Z_DUMMY_TARGET ${SRC_LIST})

and, actually, the sources are correctly added to the SRC_LIST glob, but CLion does not recognize the file as part of the project.

Everything was working fine before updating to 2020.1.

I tried to

  • remove .idea/ folder
  • clear caches and restart IDE

 

1
10 comments

Hello!

Please do Tools | CMake | Reset Cache and Reload Project. Does it help?

Also please be aware that in collaboration with the PlatformIO team, we’ve recently started some work in CLion to improve integration and help CLion users benefit from this new generation ecosystem for embedded development. There is now an experimental plugin you can install and try using.

0
Already tried, 
this do not solve the problem.
 
I already installed the experimental PlatformIO plugin and tried to 'Re-init' the project.
 
Anyway, this seems a CLion/CMake integration issue.
The CMakeListsPrivate.txt generated by PlatformIO is fine and works correctly with the previous version of CLion.
 

--

0

I'm afraid for the further investigation we need your project. Is it possible to provide it?

0

I can shrink it to a minimal setup, how can I send the project to you?

0

Please create an issue in our tracker (https://youtrack.jetbrains.com/issues/CPP) and attach the project there. You can attach it privately (with visibility to CLion team), the instruction is here.

Please also specify the link to this thread in the issue. Thanks!

0

I solved my problem!

The issue was due to the fact that I was opening the project folder using an intermediate folder which is a symlink.

/home/myuser/workspace/my-project 

where 

/home/myuser/workspace is a symlink pointing to /workspace

So (I think) CLion (the new version?)  was not recognizing that the opened files were the same reported by CMake.

 

To solve:

  • I deleted the .idea folder (another one time)
  • I re-opened the project directly from the real-path (without the intermediate symlink)

 

 

0

I have the same problem, I am under Windows10, latest version of CLion, PIO and its plugin

I use normal directories (no alias)

All the function of the lib (Adafruit Unified Sensor_ID31, U8g2_ID942, Streaming_ID560,...NeoPixelBus_ID547...) are not syntax highlighted.

Though the compilation and upload is fine, so I guess it is a problem from the CLion side, not the PIO one.

I right click on the Src dir and Mark it as Project Sources and Headers

but this is just took off the "This file does not belong to..." which is great but I need the navigation through the functions of the libraries!

Thanks

1

Ok, in my case the option Mark it as Project Sources and Headers were not available on any folder.

0

do you have the latest version ?

You have to right click on src directory, not the files ! in the project hierarchy

 

look at my post : https://youtrack.jetbrains.com/issue/CPP-20192

also vote for it so the issue could be addressed by the CLion team

CLion is a great tool to programm the ESP32 and Arduino

 

 

0

Please sign in to leave a comment.