Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext Checks, Markers and Quick Fixes(Xtext FAST checks marker creation only on save which also effects quickfixes)
Xtext Checks, Markers and Quick Fixes [message #938947] Wed, 10 October 2012 09:45
Sam Spring is currently offline Sam SpringFriend
Messages: 6
Registered: October 2012
Junior Member

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 Sad
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...

Previous Topic:Get all nodes of a given grammar construct type
Next Topic:Extension method picked over instance method
Goto Forum:

Current Time: Thu Apr 22 03:38:52 GMT 2021

Powered by FUDForum. Page generated in 0.02014 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top