|Re: Accessing model context in quickfix [message #987362 is a reply to message #987328]
||Mon, 26 November 2012 09:57
| Jan Koehnlein
Registered: July 2009
in the Quickfix API there is a strict separation on whether the model is
available or not. We have to make that separation because some of the
elements, e.g. the Issues and the IModifcation objects, are persisted
and available without any editor opened. The are needed e.g. to show the
lightbulbs in the problems view.
In the method annotated with @Fix is called when there it is *not*
available, so all decisions you want not make here must be based on
what's in the Issue. The issue has a String array "data" that can be
populated by the validation rule creating the issue to transfer more
information. It is of type String, as it has to be persisted in the
absence of any model.
Hope that clarifies things a bit
Am 26.11.12 08:26, schrieb Cedric Moonen:
> Thanks for your reply. However, I'm not sure you understood what I want
> to do. What I really want is to be access some 'model context' (so,
> similar as the IModificationContext) but not within the 'apply' method
> of a ISemanticModification.
> I want to access that context within the fix method itself: at the
> beginning of my method I would like to retrieve some information from
> the model to be able to know how many quick fixes I have to create (and
> the text I have to display for each of them).
> Unfortunately, I didn't find a way to access that information. I tried
> to look at how Xtext creates the IModificationContext object supplied to
> the ISemanticModification but it is incredibly complex and I'm not too
> sure how to implement this...
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Get professional support from the Xtext committers at www.typefox.io
Powered by FUDForum
. Page generated in 0.01646 seconds