Tracker: Feature Requests

5 Add interface for syntax/spelling checker - ID: 2490272
Last Update: Comment added ( 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 07:22:26 PST

5

Closed

None

Robert Futrell

None

None

Public


Comments ( 4 )

Date: 2009-12-01 21:27:27 PST
Sender: robert_futrellProject Admin

Added in 1.4.0.


Date: 2009-08-24 16:16:25 PDT
Sender: robert_futrellProject Admin

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


Date: 2009-07-29 06:21:48 PDT
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 12:30:42 PST
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.


Attached File

No Files Currently Attached

Changes ( 6 )

Field Old Value Date By
status_id Pending 2009-12-01 21:27:27 PST robert_futrell
allow_comments 1 2009-12-01 21:27:27 PST robert_futrell
close_date 2009-08-24 16:16 2009-12-01 21:27:27 PST robert_futrell
status_id Open 2009-08-24 16:16:27 PDT robert_futrell
close_date - 2009-08-24 16:16:27 PDT robert_futrell
assigned_to nobody 2009-01-17 12:30:42 PST robert_futrell