If you are removing the whole folder you are also removing the package.json file and the platformio folder for versionkeeping and compilation scripts. However, even if you do keep these folders and add the new ESP-IDF in, I highly doubt this will result in a succesful compilation, since the build structure of ESP-IDF has changed significantly, and adapted python build scripts would be needed.
Hm porting the build scripts could be done but then that’s double work with what the PlatformIO team will do anyways once a stable version is released. You’re always free to roll your own though.
The path of least resistance would however be to take the current working framework-espidf package, duplicate in your github, then backport the patch / bugfix you’re talking about to the ESP IDF 3.x version (if that’s even applicable), and use that by using the platform_packages override to obtain framework-espidf from there. What specific patch are you reffering too in ESP-IDF?
I am working on an issue with the uart driver. The proposed fix was shown in a version of 4. But version 4 has changed significantly from 3. (I think it was the addition of the hal layer that resulted in some #define changes, so it wasn’t real straight forward to use the proposed fix in 3.x.
I have managed to modify my local 3.x version of uart.c to include the proposed fix and it does seem to work.
The short description: if the driver detects a break before the FIFO has reached it’s full threshold, the existing FIFO content is lost.