When using PlatformIO, CLion and ESP-IDF cannot be used together, as they conflict with both wanting to define the CMakeLists.txt file. See Newly generated espidf project doesn't build in CLion - #15 by valeros.
But in VSCode it should work.
PlatformIO internally uses CMake during for the ESP-IDF build process, but you do not have to / should not install the CMake VSCode extension for building. Did you do that?