[ANN] IntelliLang

IntelliLang provides a convenient way for anybody to make use of the new Language
Injection API in IDEA 6.0 - without writing any code! It makes it possible to declare
Strings as well as XML-text and -attributes to contain certain languages which enables
IDEA's full support for editing such language fragments in totally new places.

It also provides a possibility to validate Strings against a regular expression pattern -
both in the editor as well as during runtime by instrumenting the complied classes
(IDEADEV-2599).

The plugin is available for IDEA 6.0 through IDEA's built-in plugin manager or directly
from http://plugins.intellij.net/plugin/?id=1105

You can learn more about the plugin here:
http://www.jetbrains.net/confluence/display/CONTEST/IntelliLang

Any feedback is very much appreciated.

Enjoy.

Sascha

10 comments

great plugin, a leap forward for me
By the way I have had the same idea some time ago...

Two suggestions here. You can apply @Language annotation for parameters thus we can declare parameters language right in place instead of preferences.

public void testString(@Language("RegExp") String source){}

Second one is if regexp given is a simple enumeration like method parameter below:

public void testString(@Pattern("hello|world|other") String data){}

then it would be great to have enumeration options autocomplete from that regexp in method invoke statement.

Keep doing the great job,

0

Great, finally I can get JS working where I need it.Did anybody get EL language to work in XML attributes (despite IDEADEV-9205 being marked as resolved I get NPEs all the time) ?

0

Eugene Potapenko wrote:

great plugin, a leap forward for me
By the way I have had the same idea some time ago...


Thanks a lot for your feedback.

Two suggestions here. You can apply @Language annotation for parameters thus we can declare parameters language right in place instead of preferences.
public void testString(@Language("RegExp") String source){}


This is actually already possible. The configuration is only meant for library
methods or cases where annotations cannot be used. If it doesn't work with the
annotation, it's a bug. Can you confirm this?

Maybe I should make the documentation more clear about this as well.

Second one is if regexp given is a simple enumeration like method parameter below:

public void testString(@Pattern("hello|world|other") String data){}

then it would be great to have enumeration options autocomplete from that regexp in method invoke statement.


This is a great idea, but would suffer from the fact that completion inside
String literals is/can be quite polluted by things IDEA suggests itself, i.e.
file- and property names. I'll keep investigating this.

Going one step further, I could imagine an @Enumeration annotation that would
let the user specify plain Strings as possible values. That would make handling
embedded escape-characters more convenient than having to escape them for a
regular expression.

Sascha

0

Yann Cebron wrote:

Did anybody get EL language to work in XML attributes (despite IDEADEV-9205 being marked as resolved I get NPEs all the time) ?


IDEADEV-9205 is marked as resolved for Demetra Minor Release, so it won't work
for 6.0. This is because AFAIK, the EL language doesn't create PsiFiles, which
is required by the Language Injection API.

Sascha

0

Sascha Weinreuter wrote:
>> Second one is if regexp given is a simple enumeration like method parameter below:
>>
>> public void testString(@Pattern("hello|world|other") String data){}
>>
>> then it would be great to have enumeration options autocomplete from that regexp in method invoke statement.


This is a great idea, but would suffer from the fact that completion inside
String literals is/can be quite polluted by things IDEA suggests itself, i.e.
file- and property names. I'll keep investigating this.


Small update: I found a workaround by making such enum-completions high-priority
lookup values that appear on the top of the completion list. This feature will
be available soon.

Sascha

0

Hello Sascha,

As I've been tinkering with completion for some time, I'll ask: how?

Regards,
-tt


0

Taras Tielkes wrote:

As I've been tinkering with completion for some time, I'll ask: how?


As I said, it's just a workaround that puts the "good" completion suggestions at
the top of the list by returning instances of this class from getVariants():

class MyLookupValue implements PresentableLookupValue, LookupValueWithPriority,
Iconable {
private final String myId;
private final Icon myIcon;

public MyLookupValue(String s, Icon icon) {
myIcon = icon;
myId = s;
}
public MyLookupValue(String s) {
myId = s;
myIcon = null;
}

public int getPriority() {
return HIGH;
}

public String getPresentation() {
return myId;
}

public Icon getIcon(int flags) {
return myIcon;
}
}

Sascha

0

Second one is if regexp given is a simple enumeration like method parameter below:

public void testString(@Pattern("hello|world|other")
String data){}

then it would be great to have enumeration options autocomplete from that regexp in method invoke statement.


This is available now in version 0.9 which I just uploaded.

Sascha

0

Please sign in to leave a comment.