Code inspection plugin for C/C++
Answered
Hi All,
I am trying to build a code inspection plugin for C/C++.
I have developed plugin for Java so wanted to build a plugin for C/C++.
I am trying to use LocalInspectionTool to build my code pattern scanner
I tried the sample plugin provided for CLion but none of is helpful for my case.
Does anyone had build inspection plugin using PSI framework?
Any hint would be helpful.
Thanks in Advance.
Shantanu
Please sign in to leave a comment.
Hi Shantanu,
thanks for the interest in CLion plugins.
Generally, the C/C++ PSI is not considered the public API, and is subject to a change in the future. If you still want to proceed with the plugin, you might take a look at the `OCVisitor` interface (using it should be similar to using Java PSI, you also can get the list of PSI classes from there), also feel free to ask any specific questions here.
Hi Dmitry
Thanks for reply
What should be the language I should specify for localInspection
and how I can include OCVisitor class into build.gradle?
For now I am not able to see its available in community version for the intellji.
Also How I can enable the plugin development itself into CLion?
Thanks alot
Hey
I found the issue with my build.gradle. This is the correct one some how figured it out.
Now I am getting OCVisitor. Thanks
intellij {version = '2021.2'
type = 'CL'
downloadSources = true
plugins = ['com.intellij.clion','com.intellij.cidr.base','com.intellij.cidr.lang','clion-ctest']
}
This can help others, if facing same type of issues.
Include the required modules in plugin.xml and into build.gradle in plugin section so you can get desired fetures