Source code for actions like implement function

Hey there!

I'm trying my hand at making plugins for CLion, but there's not a whole lot of documentation for CLion at this stage, and it seems like some classes and methods differ from IntelliJ plugins. While I managed to create a plugin it's very rudimentary and I undoubtedly made some errors.

I guess it comes down to two questions: are actions like "implement function" written using the plugin API or some similar syntax? If so, is it possible to view the source code for these actions somehow? It would be so much easier to get started with plugin development if I could just look at existing code for CLion.

2 comments
Comment actions Permalink

Hi David.

Could you please provide more details about the functionality which you want to implement via plugin?

It might be not so easy, because CLion has not open-source code in many parts crucial.

0
Comment actions Permalink

Really I was just thinking about making anything. I figured that if the source code was available I could have a look at how things are implemented and then go from there and implement small things.

I would like to just learn whatever I can, really. Finding references, going to them, modifying them, all that. I managed to figure out that if I have  PsiFile I can use a PsiElementFactory in Intellij to generate elements, but I'm not really sure how to create, say, a method declaration which would involve going to the class' header file, creating the PsiElement for the declaration, and inserting it into the file.

I also noticed that PsiElementFactory (for instance) isn't used when developing plugins for CLion, it's called OCElementFactory or something like that. With the minimal documentation available for the Intellij plugin API it's hard enough to figure out how to create plugins, and that combined with the nonexistent documentation for CLion makes it pretty hard to create plugins at all. I suppose I could wait for at least 1.0 and maybe someone will have written some documentation.

0

Please sign in to leave a comment.