How do I reuse java-impl refactoring classes?

I am writing a plugin and wish to reuse the refactoring classes in com.intellij.refactoring in the java/java-impl module of IC-93.94 (Community Edition 9.0.1).

When I try to import a class from this package (for example, com.intellij.refactoring.methodPushDown.PushDownProcessor), the class cannot be found.

From my investigation, it seems that it is not included in any of the jars in my IDEA SDK (the plugin SDK that I created using C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 9.0.1\lib).

I can see the classes from the com.intellij.refactoring package in the platform/lang-api module - these are in openapi.jar.

Perhaps this is because I am using the Community Edition - should I instead make a  plugin for the Ultimate Edition?  Or perhaps these classes are not meant to be accessed by plugins.  Any help would be much appreciated.

4 comments

Hello John,

You can add idea.jar to the classpath of your IDEA SDK - then the classes
will be available. There is no difference between Community and Ultimate
Edition in this regard.

I am writing a plugin and wish to reuse the refactoring classes in
com.intellij.refactoring in the java/java-impl module of IC-93.94
(Community Edition 9.0.1).

When I try to import a class from this package (for example,
com.intellij.refactoring.methodPushDown.PushDownProcessor), the
class cannot be found.

From my investigation, it seems that it is not included in any of the
jars in my IDEA SDK (the plugin SDK that I created using C:\Program
Files\JetBrains\IntelliJ IDEA Community Edition 9.0.1\lib).

I can see the classes from the com.intellij.refactoring package in the
platform/lang-api module - these are in openapi.jar.

Perhaps this is because I am using the Community Edition - should I
instead make a  plugin for the Ultimate Edition?  Or perhaps these
classes are not meant to be accessed by plugins.  Any help would be
much appreciated.

---
Original message URL:
http://www.jetbrains.net/devnet/message/5258895#5258895

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Thanks, Dmitry.

I see now what my problem was.  I created the IDEA SDK and assumed that everything from C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 9.0.1\lib was included.  It all seemed to be included because the lists of jars are almost exactly the same length - in fact, only idea.jar is missing.  (There is also one text file - trove4j_changes.txt - but that should obviously be excluded.)  I discovered this now by comparing the two lists of files (the one in the IDEA SDK, and the one in my file system).

Is there a reason that it is not picked up by the 'Add SDK' wizard?  (i.e., File > Project Structure > SDKs > Add New SDK > IntelliJ IDEA Plugin SDK)

0

Hello John,

The thinking is that idea.jar contains implementation classes, rather than
API, and we want to discourage third-party plugin developers from relying
on classes in idea.jar.

Thanks, Dmitry.

I see now what my problem was.  I created the IDEA SDK and assumed
that everything from *C:\Program Files\JetBrains\IntelliJ IDEA
Community Edition 9.0.1\lib* was included.  It all seemed to be
included because the lists of jars are almost exactly the same length
- in fact, only idea.jar is missing.  (There is also one text file -
trove4j_changes.txt - but that should obviously be excluded.)  I
discovered this now by comparing the two lists of files (the one in
the IDEA SDK, and the one in my file system).

Is there a reason that it is not picked up by the 'Add SDK' wizard?
(i.e., File > Project Structure > SDKs > Add New SDK > IntelliJ IDEA
Plugin SDK)

---
Original message URL:
http://www.jetbrains.net/devnet/message/5259139#5259139

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Thanks again, Dmitry.  This is very useful to know as it will shape my design.  I will try not to use these classes unless I have no choice.

0

Please sign in to leave a comment.