Spell checking for Strings [message #551406] |
Fri, 06 August 2010 10:07 |
Benjamin Schwertfeger Messages: 53 Registered: July 2009 |
Member |
|
|
Hello,
I'ld like to enable spell checking in my dsl for some Elements, like Strings. I think about two possible ways.
1. Writing a cusom reconciler, which enable spell checking and delegates to the XtextReconciler. In this approach I've to access the parsed model, to see the elements at the changed positions.
2. Write a custom Validator which calls the spell checker, for the Strings of one element. Because the spell checking result is neither a error nor a warning or an information, but an additional type of marker, I need a way to get the annotationModel in the validator.
Is there a third, better way, for doing this?
Regards,
Benjamin
|
|
|
Re: Spell checking for Strings [message #551414 is a reply to message #551406] |
Fri, 06 August 2010 10:36 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Benjamin,
I'ld try to collect the regions of all strings and comments, that should
be checked, in the validator. Use SpellingService#check() with a mocked
document that supports the minimal required methods (like
getLegalLineDelimiters and get(offset, length)) and a
ISpellingProblemCollector that transforms the spelling problems into
warnings.
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 06.08.10 12:07, schrieb Benjamin Schwertfeger:
> Hello,
> I'ld like to enable spell checking in my dsl for some Elements, like
> Strings. I think about two possible ways.
>
> 1. Writing a cusom reconciler, which enable spell checking and delegates
> to the XtextReconciler. In this approach I've to access the parsed
> model, to see the elements at the changed positions.
>
> 2. Write a custom Validator which calls the spell checker, for the
> Strings of one element. Because the spell checking result is neither a
> error nor a warning or an information, but an additional type of marker,
> I need a way to get the annotationModel in the validator.
>
> Is there a third, better way, for doing this?
>
> Regards,
>
> Benjamin
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03856 seconds