Developing a plugin seems too hard

I worked through the tutorial and learnt to make a simple "Hello World" dialog. Seemed easy enough. Then suddenly...the help ends. Just Javadoc API with mostly uncommented methods and classes. I've had to resort to trial and error to see what each method might do.

I suspect I might be missing something important, because quite clearly a large number of people have created plugins, simple and complex. Is there some secret source of documentation someone can point me towards? or sample source code that does things far more complicated than displaying a string in a dialog?

10 comments
Comment actions Permalink

if you download the plugin dev pack (look at the EAP download page),you'll find the sources for several different plugins inside, including CVS and SVN ones.

THis could give help you.
Included is also javadoc (although not as complete as one would hope I guess) for the Open API

0
Comment actions Permalink

Thanks for the reply. The Javadoc API I was complaining about was indeed the one in the plugin dev pack. Typically, the documented methods have parameters with no description of what the parameters are, and with no example of usage.

0
Comment actions Permalink

Gah! You should have tried doing it four years ago!

Seriously, your best bet really is to try to find examples of things you wish to do in other, similar plugins, whether in the dev kit or other open-source plugins. The Javadoc is much better than it was, but it's still got quite a ways to go. It doesn't sound like you're doing anything wrong. The process really does have a tougher learning curve than it needs to.

--Dave Griffith

0
Comment actions Permalink

For me (I've written four plugins) the best approach is to download the source code of various plugins that do similar things your plugin will need to do. Learn from what others have done. It's much easier to copy existing code and tweak it than it is to write it from scratch.

Good luck.

Rick

0
Comment actions Permalink

Hey, compared to today's number and complexity of the IDEA-APIs it was rather easy to get started back then. I remember when simple support for doing plain-text modifications to Editors was added to the OpenAPI back in the 3.0 EAP ;)

Unfortunately, even the best Javadoc will not tell how to write a specific plugin. It can only provide a rough guideline of what functionality is available and how it can be used. To get started, the best way is indeed to study existing plugins and trying to understand the idea and architecture behind the OpenAPI. It's quite consistent, and once you get used to it, finding stuff is just a matter of smart usage of Ctrl-N and friends. But it will take time.

Sascha

0
Comment actions Permalink

Sascha Weinreuter wrote:

Unfortunately, even the best Javadoc will not tell how to write a specific plugin. It can only provide a rough guideline of what functionality is available and how it can be used. To get started, the best way is indeed to study existing plugins and trying to understand the idea and architecture behind the OpenAPI. It's quite consistent, and once you get used to it, finding stuff is just a matter of smart usage of Ctrl-N and friends. But it will take time.


Yet, the javadoc could really be more helpful, most importantly what has happened top me often
is that I found an interface that seemed to be useful, and it might even have some javadoc
on its methods, but how for heavens sake can I get hold of an instance of that interface?
(Later I learned that most of the time having a look at *Manager classes helped, but even
that sometimes fails).

BTW: It would be nice if the were some kind of "javadoc wiki" where plugin writers could
amend the javadoc and maybe later JetBrains could generate the real javadoc from this.
This idea doesn't sound too extraordinary I think, but I haven*'t seen such a tool yet.

0
Comment actions Permalink

+BTW: It would be nice if the were some kind of "javadoc wiki" where plugin writers could
amend the javadoc and maybe later JetBrains could generate the real javadoc from this.
This idea doesn't sound too extraordinary I think, but I haven*'t seen such a tool yet+

would that really be necessary? open the sources, add some javadoc and re-submit them for review and inclusion :)

0
Comment actions Permalink

:) 4-5 year ago it was a little bir harder, yeah :)

0
Comment actions Permalink

I'm trying to import an existing plugin from github and just to get the project correctly setup is a nightmare!

Compared to Eclipse writing plugins for IntelliJ is way too awkward...

What is the right way to import "an existing plugin project" which uses gradle to build with the correct project/module setup for running and debugging the code?

Is this explained somewhere properly? Because I'm googling since days and every time I found only "workarounds" and a lot of people having the same issue but no one seems to have the right answers... this really sucks!

0
Comment actions Permalink

@Screg1234 It would be helpful if you could open a new thread and give more specifics about what doesn't work. If it's a Gradle based plugin, you should be able to open it as project without any further steps https://www.jetbrains.com/help/idea/work-with-gradle-projects.html

0

Please sign in to leave a comment.