Javascript language plugin sources

Hi,

I am trying to play with the open api of IDEA to write support for a
different language (D). So i took the latest sources of the Javascript
plugin and tried to actually compile. However i keep getting this error:

Information: Note: Some input files use unchecked or unsafe operations.
Information: Compilation completed with 100 errors and 0 warnings
Information: 100 errors
Information: 0 warnings
D:\Work\Java\D Plugin\src\com\company\lang\d\psi\impl\DElementImpl.java
Error: Error: line (20)cannot access com.intellij.psi.impl.ElementBase
file com\intellij\psi\impl\ElementBase.class not found
Error: Error: line (31)cannot find symbol variable this
Error: Error: line (34)cannot find symbol variable super
Error: Error: line (40)cannot find symbol method getContainingFile()
D:\Work\Java\D Plugin\src\com\company\lang\d\psi\DFile.java
Error: Error: line (20)cannot access
com.intellij.psi.impl.source.PsiFileImpl
file com\intellij\psi\impl\source\PsiFileImpl.class not found
D:\Work\Java\D
Plugin\src\com\company\lang\d\psi\impl\DParameterListImpl.java
Error: Error: line (18)com.company.lang.d.psi.impl.DParameterListImpl is
not abstract and does not override abstract method getNode() in
com.intellij.psi.PsiElement
Error: Error: line (26)cannot find symbol method getNode()



This is the DElementImpl class declaration
public class DElementImpl extends ASTWrapperPsiElement implements DElement {
public DElementImpl(final ASTNode node) {
super(node);
}

public Language getLanguage() {
return DLanguageSupportLoader.D.getLanguage();
}

public void accept(PsiElementVisitor visitor) {
if (visitor instanceof DElementVisitor) {
((DElementVisitor)visitor).visitJSElement(this);
}
else {
super.accept(visitor);
}
}

public SearchScope getUseScope() {
//This is true as long as we have no inter-file references
return new LocalSearchScope(getContainingFile());
}

}

The ASTWrapperPsiElement class is available in the openapi.jar but it
extends com.intellij.psi.impl.ElementBase which does not seem to be
available. Are the javascript languages plugin sources supposed to compile ?
Is the source package outdated ? Am i doing something very wrong here? Do i
need to use another class instead of the ASTWrapperPsiElement in there ?

Sincerely,
ToMiC




9 comments
Comment actions Permalink

ToMiC,

you should add idea.jar to your classpath (i.e. add it to the IDEA-JDK in case you're
using the DevKit).

Sascha

0
Comment actions Permalink

Thansk .. it worked. But wasn't the DevKit supposed to do that ?


"Sascha Weinreuter" <sascha.weinreuter@NOSPAM-cit.de> wrote in message
news:daqti2$25i$1@is.intellij.net...

ToMiC,

>

you should add idea.jar to your classpath (i.e. add it to the IDEA-JDK in
case you're using the DevKit).

>

Sascha


Sincerely,
ToMiC


0
Comment actions Permalink

Not really. All published API are in 'openapi.jar' and 'extensions.jar', which are included on the DevKit. It's just that the javascript plugins cheats and uses unpublished API in 'idea.jar'.

0
Comment actions Permalink

Hello Marcus,

MB> Not really. All published API are in 'openapi.jar' and
MB> 'extensions.jar', which are included on the DevKit. It's just that
MB> the javascript plugins cheats and uses unpublished API in
MB> 'idea.jar'.

It's not that the javascript plugin cheats - in fact, it is not currently
possible to implement a custom language plugin without using APIs from idea.jar.
Hopefully this limitation will be removed in a future version of IDEA.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

It's not that the javascript plugin cheats - in fact, it is not
currently possible to implement a custom language plugin without using
APIs from idea.jar. Hopefully this limitation will be removed in a
future version of IDEA.

I think this information should be officially published so that all
users that try to make language plug-ins don't expect too much :).

I hope that "future version of IDEA" means "future versions of IRIDA".

IMHO you should make another small language plug-in: like Velocity
(since you are using yourself Velocity alot for Fabrique).
This way - from 2 language plug-ins(or more), it would be easier to find
out what really needs to go into an Language Open API.

Ahmed.

0
Comment actions Permalink

Hello Ahmed,

>> It's not that the javascript plugin cheats - in fact, it is not
>> currently possible to implement a custom language plugin without
>> using APIs from idea.jar. Hopefully this limitation will be removed
>> in a future version of IDEA.
>>
AM> I think this information should be officially published so that all
AM> users that try to make language plug-ins don't expect too much :).

Well, as soon as we have a good place for publishing such information, it
will be published.

AM> I hope that "future version of IDEA" means "future versions of
AM> IRIDA".

This limitation is quite difficult to remove, so there's little chance that
we'll do this before the final release of Irida.

AM> IMHO you should make another small language plug-in: like Velocity
AM> (since you are using yourself Velocity alot for Fabrique).
AM> This way - from 2 language plug-ins(or more), it would be easier to find
AM> out what really needs to go into an Language Open API.

In fact, we plan to release a sample language plugin for Python. It will
be a separate sample, not included in the Irida distribution.

Also, don't miss the javadocs that started to appear in and around the com.intellij.lang
package. :)

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

AM> I think this information should be officially published so that all
AM> users that try to make language plug-ins don't expect too much :).

Well, as soon as we have a good place for publishing such information,
it will be published.

Sorry, but I thought that that's what Confluence was made for: a few
pages about IDEA Plugin Dev won't break the server - right?
The intellij.org wiki is very ugly and messy for such a thing, but
Confluence would be OK - IMHO the Fabrique docs pages there are very nice.

AM> I hope that "future version of IDEA" means "future versions of
AM> IRIDA".

This limitation is quite difficult to remove, so there's little chance
that we'll do this before the final release of Irida.

So than you can't really say that final IRIDA will have Language API
support since it "really" works only with tricks.

AM> IMHO you should make another small language plug-in: like Velocity
AM> (since you are using yourself Velocity alot for Fabrique).
AM> This way - from 2 language plug-ins(or more), it would be easier to
find
AM> out what really needs to go into an Language Open API.

In fact, we plan to release a sample language plugin for Python. It will
be a separate sample, not included in the Irida distribution.

Sorry but how much Python do Java developers(IntelliJ users) need?
IMHO Velocity (Fabrique is using it) FreeMarker ONGL(with bridge like
the JsHtmlBridge) or something that is used in many java projects would
be a better choice.

Also, don't miss the javadocs that started to appear in and around the
com.intellij.lang package. :)

I'm not missing it :). It's a step in the right direction. You should
also look at the Eclipse plug-in dev docs for a sample.

Ahmed.


0
Comment actions Permalink

Hello Ahmed,

>> AM> I think this information should be officially published so that
>> all AM> users that try to make language plug-ins don't expect too
>> much :).
>>
>> Well, as soon as we have a good place for publishing such
>> information, it will be published.
>>
AM> Sorry, but I thought that that's what Confluence was made for: a few
AM> pages about IDEA Plugin Dev won't break the server - right?
AM> The intellij.org wiki is very ugly and messy for such a thing, but
AM> Confluence would be OK - IMHO the Fabrique docs pages there are very
AM> nice.

Indeed, Confluence is a possible place for publishing such information. OnBoard
is another. We'll discuss what we're actually going to use.

>> AM> I hope that "future version of IDEA" means "future versions of
>> AM> IRIDA".
>>
>> This limitation is quite difficult to remove, so there's little
>> chance that we'll do this before the final release of Irida.
>>
AM> So than you can't really say that final IRIDA will have Language API
AM> support since it "really" works only with tricks.

Does it really matter that much? It works, and the only trick is to add an
extra jar to the classpath.

>> In fact, we plan to release a sample language plugin for Python. It
>> will be a separate sample, not included in the Irida distribution.
>>
AM> Sorry but how much Python do Java developers(IntelliJ users) need?
AM> IMHO Velocity (Fabrique is using it) FreeMarker ONGL(with bridge like
AM> the JsHtmlBridge) or something that is used in many java projects would
AM> be a better choice.

Well, the Python language plugin already exists. It was developed by me as
a spare time project because Python is a language that I use for my other
spare-time projects. And we don't have the resources to develop another language
plugin right now.

Support for Velocity or other template languages is considered for future
versions of IDEA.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0
Comment actions Permalink

Dmitry Jemerov (JetBrains) wrote:

In fact, we plan to release a sample language plugin for Python. It will
be a separate sample, not included in the Irida distribution.


Excellent 8)

Ciao,
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://www.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: (416) 933-5046 | Fax: (416) 933-5001

0

Please sign in to leave a comment.