|Re: Spell checking for custom construct - DocumentPartitioner is confused [message #896432 is a reply to message #895957]
||Wed, 18 July 2012 11:42
| Sebastian Zarnekow
Registered: July 2009
this is a diagnostic message that tries to identify a long standing bug
with dangling error markers in Xtext editors. We spotted some suspicious
code in the document partitioner and decided to log a messages as soon
as this code is executed. It was simply to late in the Juno train to
change that crucial component.
I'd say a ticket would be helpful but otherwise you may ignore the
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 16.07.12 18:15, schrieb Stephan Herrmann:
> after happily migrating to Xtext 2.3 and enjoying the compatibility with
> Eclipse 3.7.2 I added support for spell checking into my tool.
> Since I need spellchecking for a custom syntax element (none of the
> predefined COMMENT rules) I had to apply some tweaks which now cause the
> DocumentPartitioner to log this error
> ERROR org.eclipse.xtext.ui.editor.model.DocumentPartitioner - Detected
> unexpected state in document partitioner. Please file a bug with the
> following information attached:
> Document content after the event was applied:
>>>> content of my file
> Document event: offset: 375, length: 1, timestamp: 3
> Is this a bug in xtext or is that caused by one of my customizations?
> Basically I did 3 things:
> 1. write and bind my own AntlrTokenToAttributeIdMapper, copied mainly
> from DefaultAntlrTokenToAttributeIdMapper and adding my elements to
> 2. let the same class implement ITokenTypeToPartitionTypeMapper and bind
> it for this type, too. -- getPartitionType() has the same implementation
> as TerminalsTokenTypeToPartitionMapper
> -- getSupportedPartitionTypes() returns an array of only two elements:
> the id of the element where spell-checking should be supported and
> 3. write my own SpellingReconcileStrategy extends
> XtextSpellingReconcileStrategy and override shouldProcess()
> -- bind this directly plus a factory that creates instances of it.
> - syntax highlighting for this element works OK
> - spell checking works exactly as desired.
> - error is logged as shown.
> Should I worry? Should I file a bug? Should I change my customization
Powered by FUDForum
. Page generated in 0.09803 seconds