ThexXTURBOXx / clion-embedded-esp32

OpenOCD + ESP32 support for CLion
https://plugins.jetbrains.com/plugin/18760-openocd--esp32-support-for-embedded-development
Other
14 stars 5 forks source link

Fix root path used by some functions #10

Closed jeongyeham closed 1 year ago

jeongyeham commented 1 year ago

Why PR?

I've found that the intent of these variables, whether String root or VirtualFile contentRoot, is to get the currently open project directory. However, because of CMake, the current project directory is compiled into modules and merged into ESP-IDF. So in fact, it points to the root directory of the entire ESP-IDF, not the project directory we opened.

How?

CMake's build directory is globally unique, so I found the build directory first and then got the parrent directory to find the current working directory. Also I added some code to make it faster to index relevant directories.

ThexXTURBOXx commented 1 year ago

Hi, thanks for the PR! Could you please try the following version if it works correctly? OpenOCD + ESP32 Support for embedded development-0.3.2.jar.zip

jeongyeham commented 1 year ago

It works well! I first checked that the command line from plugin to OpenOCD was correct. And paths are shown as relative path. Screenshot 2023-07-19 092328

ThexXTURBOXx commented 1 year ago

Thank you very much for testing! I have changed a few more things because string comparison like this does not work in Java. You need to use String#equals instead. I will upload the new version in a few minutes

jeongyeham commented 1 year ago

Thanks for pointing out the syntax and grammar errors of my code, it helps me a lot when I'm learning java!