How to access build errors in CLion via Plugin

Hello ,

I am currently developing a plugin for CLion and I've encountered a challenge. I need to access the error messages that are generated after a build attempt in CLion, specifically from within the plugin code I'm writing.

From my research, I have found that there are classes such as com.intellij.openapi.compiler.CompileContext in IntelliJ IDEA that can be used to access compiler messages. However, this doesn't seem to be available in the CLion plugin development context.

My main goal is to programmatically access the content that would normally appear in the Build tool window after a build attempt, especially when there are compilation errors. The purpose is to provide additional functionality in my plugin that is based on the build result.

I would appreciate any guidance or pointers you can provide on how I can achieve this. Is there a specific API or method available in the CLion plugin development context that would allow me to access these error messages?

Thank you in advance for your help!


Do you need the full text of the errors reported by the compiler or just the status of the build process?

In general, CLion doesn't provide an API to get the exact build errors, reported by the compilers. Unlike IntelliJ IDEA, CLion doesn't parse compiler output. So if you need to get the full text of the compiler error, you will need to create your own `Filter` that will be attached to the `Build` tool window. In this filter, you can parse compiler and output. This would be one solution. Another way you can try is to try attaching `ProcessListener` to the build process itself.

However, if you just need to get a status of the build process (e.g. if the build succeeded), you can use `CidrBuildListener`