Share

RSyntaxTextArea

Tracker: Feature Requests

5 Add interface for syntax/spelling checker - ID: 2490272
Last Update: Settings changed ( robert_futrell )

Can you please add a simple interface which allows to plug in a
syntax/spelling checker?

The interface should look like this:

CheckResult[] check(RTextAreaBase editor,
int start, int end);

start and end are the offsets where the text has been changed (end > start
if something was inserted, start == end if something was deleted). This
should be run in a background thread and the editor should make sure that
check() is only called from a single thread.

The method returns the an (possibly empty) array of problems. CheckResult
is a simple data container:

class CheckResult {
int start, end;
Object data;
}

For each checker, you can install a renderer. The default renderer should
draw a squiggly line and display data.toString() when the mouse hovers over
it (unless data == null).

Other checkers can put a list of corrections or compiler error messages in
the data field and use custom renderers to hook into the context menu.


Aaron Optimizer Digulla ( digulla ) - 2009-01-06 15:22

5

Pending

None

Robert Futrell

None

None

Public


Comments ( 3 )




Date: 2009-08-24 23:16
Sender: robert_futrellProject Admin

The SpellChecker add-on will be released alongside the next RSyntaxTextArea
release.


Date: 2009-07-29 13:21
Sender: robert_futrellProject Admin

A first pass at a spell checker "add-on" is now in the SVN repository:

http://svn.fifesoft.com/svn/RSyntaxTextArea/

This will be a small extra jar (under the LGPL) that adds spell checking
to RSTA through its addParser() method. The README file in the
SpellChecker project has some usage instructions, and the project also has
an example program showing usage.

I've got some more changes to push still, but after that the add-on should
be mostly usable. Of course, it'll be fleshed out as feedback comes in
before the next RSTA release.


Date: 2009-01-17 20:30
Sender: robert_futrellProject Admin

Not a bad idea. There is already a (unused)
SquiggleUnderlineHighlightPainter that draws a wavy underline like those
commonly used for errors in IDE's. That could be used to underline
spelling mistakes.

There was once (still is?) a half-baked interface to add "parsers" that
would parse the code in RSTA, and would allow it to squiggle underline
programming errors. At first glance, a spell checker could be added to
this interface as well.


Log in to comment.

Attached File

No Files Currently Attached

Changes ( 3 )

Field Old Value Date By
close_date - 2009-08-24 23:16 robert_futrell
status_id Open 2009-08-24 23:16 robert_futrell
assigned_to nobody 2009-01-17 20:30 robert_futrell