debug info, annotations, editing

General Discussion on RSyntaxTextArea.

Moderator: robert

debug info, annotations, editing

Postby ebbp » Sat Feb 01, 2014 9:12 pm

Hello,

I have couple of questions so I will try to ask them all in one topic (hope it's not a problem):
1. I am trying to use language support for java but even if I am following your guide I am always getting the same debug info > "[DEBUG]: Couldn't find ClassFile for: java.lang.Object" (or another class). It does not even basic keywords.

2. Another problem I have encountered is with annotations. In the following code snippet I always get this error: "java.io.IOException: Expected identifier, found: [TokenImpl: type=67108864; lexeme="@"; line=7; col=39; offs=227; invalid=false]". Is there a way to fix it?

Code: Select all
public final class Mul extends BinaryOperation {
    @Operator(priority = 2)
    public Mul(Expression expression1, @Before("STAR") Expression expression2) {
        super(expression1, expression2);
    }}

3. My last question is rather strange. I would like to ask if it is possible to disable editing of some parts of the code. In my case I would like to disable editing of java constructors. Is it possible?

Thanks :)
ebbp
 
Posts: 1
Joined: Sat Feb 01, 2014 8:54 pm

Re: debug info, annotations, editing

Postby robert » Sun Feb 02, 2014 3:15 pm

Hi ebbp,

For your first question, how have you configured the library to point to your JDK?

I assume the location it's complaining about is the @Before annotation, not the @Operator one, correct? If so, sounds like a bug. Please [url=https://github.com/bobbylight/RSTALanguageSupportreport it on GitHub[/url].

As for preventing the editing of Java constructors, do you mean actually making that part of the editor read-only? If so then that would be tricky. You'd probably want to install a custom [url=http://docs.oracle.com/javase/7/docs/api/javax/swing/text/DocumentFilter.html]DocumentFilter[/url], and on all edits, check whether the caret position, or any part of the selected text range, is in the constructor. If so, prevent the edit. You'd probably have to reach into RSTALanguageSupport's AST (or do your own parsing) to know what parts of the document are parts of the constructor.
User avatar
robert
 
Posts: 801
Joined: Sat May 10, 2008 5:16 pm


Return to Open Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron