|Xtext Checks, Markers and Quick Fixes [message #938947]
||Wed, 10 October 2012 05:45
| Sam Spring
Registered: October 2012
Hopefully someone out there can answer a few questions for me please.
I have recently migrated from using Eclipse Galileo and Xtext 0.7 to Eclipse Indigo and Xtext 2.3 and have some questions regarding the xtext checks, marker creation and quick fixes.
1) With xtext 0.7 the FAST checks create problems view markers instantly. However with xtext 2.3 the markers only seem to be created when you save the editor. Is this normal or can I change the FAST checks to create markers instantly? I tried the xtext examples that come with Eclipse Indigo and this functionality seem standard with xtext 2.3.
2) I want to add a quick fix to update the editor and for this I thought I would use the textual modification approach that uses the offset to know where to replace the text and uses the function XtextDocument.replace() to apply the change to the editor. However this does not work with the following steps:
a) Update the editor so you see the fast error in the editor and then save the file so the marker is created.
b) Add some data in the editor that is before the quick fix error and DONT save.
c) Apply the quickfix via the problems view marker.
The above quickfix overwrites part of the editor that it is not supposed to
Now I assume this must be due to the fact that the editor was not saved so the marker contains the "old" offset value. Is there a way of getting the correct offset value without saving the editor first. If you trigger the quickfix directly on the editor it works.
I hope someone can help...
Powered by FUDForum
. Page generated in 0.01722 seconds