Autocomplete Trunk Compilation Errors

Questions on using RSyntaxTextArea should go here.

Moderator: robert

Autocomplete Trunk Compilation Errors

Postby Guest » Wed Aug 01, 2012 3:34 pm

First of all, thanks for all the great work on RSyntaxTextArea!

Quick Background:
I'm using RSTA in KojoLite (http://www.kogics.net/kojolite), the (under development) online version of Kojo (http://www.kogics.net/kojo).
Kojo is a Scala based learning environment for children. Kojo is based on the Netbeans Platform, and get's its sytax highlighting, code completion, etc. from there. KojoLite does not depend on the Netbeans Platform, and that's where RSTA has come in (to provide syntax highlighting etc).

You can play with KojoLite, and see RSTA in action within it, by running the programs submitted to the Kojo Code Exchange (http://www.kogics.net/codeexchange)

I'm currently adding code completion to KojoLite, and TemplateCompletions seem like the perfect way to plug my Netbeans Platform templates into RSTA. Unfortunately, the AutoComplete trunk (that's the only place I can get TemplateCompletions, right?) does not compile for me:

~/work/autocomplete$ ant
Buildfile: /home/lalit/work/autocomplete/build.xml

compile:
[delete] Deleting directory /home/lalit/work/autocomplete/ant-classes
[mkdir] Created dir: /home/lalit/work/autocomplete/ant-classes
[javac] Compiling 38 source files to /home/lalit/work/autocomplete/ant-classes
[javac] /home/lalit/work/autocomplete/src/org/fife/ui/autocomplete/ParameterizedCompletionInsertionInfo.java:64: org.fife.ui.rsyntaxtextarea.DocumentRange is abstract; cannot be instantiated
[javac] replacementLocations.add(new DocumentRange(start, end));
[javac] ^
[javac] /home/lalit/work/autocomplete/src/org/fife/ui/autocomplete/TemplateCompletion.java:184: getLeadingWhitespace(java.lang.String) in org.fife.ui.rsyntaxtextarea.RSyntaxUtilities cannot be applied to (javax.swing.text.Document,int)
[javac] leadingWS = RSyntaxUtilities.getLeadingWhitespace(doc, dot);
[javac] ^
[javac] 2 errors

BUILD FAILED
/home/lalit/work/autocomplete/build.xml:43: Compile failed; see the compiler error output for details.

Total time: 2 seconds

My environment:
Ubuntu 12.04
Java 1.6.0_33

Any thoughts on what the problem might be?

Thanks,
- Lalit
::
Lalit Pant
Creator and Lead Dev,
The Kojo Project
Guest
 

Re: Autocomplete Trunk Compilation Errors

Postby Guest » Wed Aug 01, 2012 3:45 pm

As soon as I hit the Submit button on the previous post, I realized that I wasn't compiling AutoComplete against the RSTA trunk.
So I got the RSTA trunk and tried to build it. I get this error:

~/work/RSyntaxTextArea$ ant
Buildfile: /home/lalit/work/RSyntaxTextArea/build.xml

compile:
[mkdir] Created dir: /home/lalit/work/RSyntaxTextArea/ant-classes
[javac] Compiling 148 source files to /home/lalit/work/RSyntaxTextArea/ant-classes
[javac] /home/lalit/work/RSyntaxTextArea/src/org/fife/ui/rtextarea/RTATextTransferHandler.java:17: warning: [deprecation] java.io.StringBufferInputStream in java.io has been deprecated
[javac] import java.io.StringBufferInputStream;
[javac] ^
[javac] /home/lalit/work/RSyntaxTextArea/src/org/fife/ui/rsyntaxtextarea/RtfTransferable.java:41: warning: [deprecation] plainTextFlavor in java.awt.datatransfer.DataFlavor has been deprecated
[javac] DataFlavor.plainTextFlavor // deprecated
[javac] ^
[javac] /home/lalit/work/RSyntaxTextArea/src/org/fife/ui/rsyntaxtextarea/parser/XmlParser.java:219: unreported exception java.io.IOException; must be caught or declared to be thrown
[javac] return super.resolveEntity(publicId, systemId);
[javac] ^
[javac] /home/lalit/work/RSyntaxTextArea/src/org/fife/ui/rtextarea/RTATextTransferHandler.java:356: warning: [deprecation] java.io.StringBufferInputStream in java.io has been deprecated
[javac] return new StringBufferInputStream(data);
[javac] ^
[javac] 1 error
[javac] 3 warnings

BUILD FAILED
/home/lalit/work/RSyntaxTextArea/build.xml:42: Compile failed; see the compiler error output for details.

Total time: 5 seconds

But I think that I can work with this by fixing the error in XmlParser.java.

Will report back on how it all goes...

Cheers,
- Lalit
Guest
 

Re: Autocomplete Trunk Compilation Errors

Postby robert » Thu Aug 02, 2012 1:05 pm

Hi Lalit,

You have probably already seen it, but when you get to that line in XmlParser, you'll see a comment describing what is going on. For maximum compatibility, I compile all RSTA libraries against the ancient 1.4 JDK. There is a binary incompatibility between Java 1.4 and 1.5 that causes the compilation error you describe when building with Java 5 or greater. All you need to do is add IOException to the throws clause of that method and you'll be good to go (or build RSTA with 1.4).

More people complain about this as time goes on. I did plan on eventually dropping 1.4 compatibility but didn't feel the need to right now, simply because there's nothing RSTA actually needs in newer JDKs. It does make RSTA appear a little unpolished, so perhaps if enough people complain I'll take the plunge. :)
User avatar
robert
 
Posts: 789
Joined: Sat May 10, 2008 5:16 pm

Re: Autocomplete Trunk Compilation Errors

Postby Guest » Fri Aug 03, 2012 2:13 pm

Hi Robert,

Yes, I did see the comment, and added IOException to the throws clause of that method. Everything built fine after that.

I'm now set up with the RSTA and Autocomplete trunks, and have made good progress in adding template based code completion to KojoLite. I have run into some minor issues (possibly based on my particular usage of template completions). More on that in another thread...

It does make RSTA appear a little unpolished


There's a risk that it will drive a casual user off, but then again, somebody who's building RSTA from source (as opposed to getting the prebuilt jars) will probably be inclined to dig deeper and figure out the issue.
Maybe a message from the build file telling the user what's going on is the next step?

And once again, congratulations for all the great work on RSTA!
Guest
 


Return to Help

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron