fortran-plugin
fortran-plugin copied to clipboard
No syntax highlighting within preprocessor statements
Hi,
I noticed that syntax highlighting within preprocessor statements no longer works. It worked just fine in earlier versions, but after opening a Fortran project for the first time after ~ 8 months I just saw it no longer does (hence I cannot say in which version exactly it stopped working).
Thanks!
Edit: It seems that it works occasionally and I haven't found out yet when it breaks. I attached an actual file I am using in my project (rename to .F90), which renders in Clion as shown in below.
Edit 2: I should also add that in the debugger within some code sections contained in preprocessor directives the variable window remains empty, even though I can still print the variables using gdb commands directly.
Edit 3: Trying out older versions of Clion from snap I see that things work as expected with Clion/Fortran plugin versions 2019.2.5/2019.2.1, but no longer work with the most recent versions 2019.3.4/2019.3.3.
Just as a follow-up on this:
The issue arises when one compiles TWO different executables from the same source code, but one has the pre-processor definition turned on and the other off.
Then there does not seem to be a way to have the code highlighted/inactive depending on which executable one is debugging.
I've attached a minimal working example (rename main.txt to main.F90 to get around GH's file type restrictions). CMakeLists.txt
It would be helpful to have the option to turn this feature off completely if it cannot be resolved in any reasonable way, otherwise I am stuck on CLion 2019.2 forever. Thanks!
Hi. I was trying to improve preprocessor support, but I failed, because to do so I have to refactor CLion core to be able to integrate with their CMake support. This is quite difficult for me as I'm not member of CLion team. I understand that current verison is quite bad and I'll look for a possibility of option that will disable it.
Ok, thanks! Such an option would be highly appreciated.
Your comment prompted me to investigate whether this works for a C project, and there Clion behaves as expected. The highlighting/inactive region changes depending on which target one selects in the drop-down box:
This is not the case for the Fortran project though. So maybe the Clion core has some mechanism in place to support something equivalent in Fortrran?
Minimal working example: CMakeLists.txt main.txt
CLion itself knows nothing about Fortran preprocessor therefore I'm sure there is no such mechanism in current version. And there is absolutely no way to change this without updating CLion core. I'm saying it because I've tried.
I see, that's unfortunate. Thanks for looking into it!