JSClass and other Psi-likes.

Hi guys.
I'm writing a plugin for Robotlegs users allowing them to navigate to related RL classes.

Because this is actionscript code, the PsiFile for my Action is filled with elements like: JSClass, JSReferenceList, JSReferenceExpression etc.

With the openapi, i don't have access to these classes, but more suprising, JSClass instanceof PsiClass is false..
All the nice helper tools like psiClass.getInterfaces and the PsiTreeUtil seem to fail me at every turn.

Am I doing something fundamentally wrong, or is what I'm trying to do outside the scope of the devkit (because JS-ECMA support is a part of Ultimate?)

Any help would be appreciated.

4 comments

Hello Rasheed,

The JavaScript PSI is indeed completely distinct from the Java PSI and does
not implement the same interfaces. You can add the JavaScript plugin to the
dependencies of your plugin and write code that works with the JavaScript
PSI, but at the moment we don't provide any OpenAPI interfaces or documentation
for the JavaScript PSI.

Hi guys. I'm writing a plugin for http://www.robotlegs.org/ users
allowing them to navigate to related RL classes.

Because this is actionscript code, the PsiFile for my Action is filled
with elements like: JSClass, JSReferenceList, JSReferenceExpression
etc.

With the openapi, i don't have access to these classes, but more
suprising, JSClass instanceof PsiClass is false.. All the nice helper
tools like psiClass.getInterfaces and the PsiTreeUtil seem to fail me
at every turn.

Am I doing something fundamentally wrong, or is what I'm trying to do
outside the scope of the devkit (because JS-ECMA support is a part of
Ultimate?)

Any help would be appreciated.

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

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


0

Thankyou Dmitry..

For other N00bs like myself, you should note that plugins have their own ClassLoader. To advise the PluginClassLoader to load the classes you need, you may need the plugin.xml node <depends>.

Here's my plugin.xml


<idea-plugin version="2">   <name>Robotlegs MVCS Plugin</name>   <description>Helper plguin for Robotlegs MVCS developers</description>   <version>0.1</version>   <vendor url="http://www.robotlegs.org" logo="icons/rl.png">Robotlegs</vendor>   <idea-version since-build="8000"/>   <depends>JavaScript</depends>   <application-components>     <!-- Add your application components here -->   </application-components>   <project-components>     <!-- Add your project components here -->   </project-components>   <actions>     <!-- Add your actions here -->   </actions>   <extensions defaultExtensionNs="com.intellij">     <!-- Add your extensions here -->   </extensions> </idea-plugin>

0

Has there been any thought given to exposing the Javascript API through OpenAPI?

0

For anyone passing through - for details on working with the JS psi tree see here:

http://devnet.jetbrains.com/message/5490721#5490721

0

Please sign in to leave a comment.