|Re: Automatic handling of errors/warnings [message #1040336 is a reply to message #1038432]
||Sat, 13 April 2013 11:49
| Marco Naddeo
Registered: November 2012
Henrik Lindberg wrote on Wed, 10 April 2013 17:42|
But why are they errors in the first place? Are they linking errors? If
so, you can write a custom linker an implement the callback method that
is executed after normal linking is done.
Hi and first of all thanks for your answer.
Yes, they are linking errors.
I already tried to call the method that autofixes these errors after normal linking is done, but I don't understand where and how I could hook this call.
I saw that the XtextResource class has a method named updateInternalState whose last instruction is the call of the doLinking method... after this call, I should know the produced errors and so I should be able to trigger the appropriate method to autofix some of them, as I want.
Now, my problem is substantially that what I want to execute is an IModification (or ISemanticModification), as I do in the implementation of my quick fix, but obviously I cannot directly use a UI class from the model package... so I need a way to circumnavigate this problem.
Do you have any hint about this?
|Re: Automatic handling of errors/warnings [message #1040570 is a reply to message #1040341]
||Sat, 13 April 2013 20:40
| Henrik Lindberg
Registered: July 2009
On 2013-13-04 14:01, Marco Naddeo wrote:|
> P.S.: in cloudsmith / geppetto you use the latter of two techniques you
> indicated? if so, could you kindly tell me in that project from which
> package or classes can I take inspiration? :)
Ok, so Geppetto uses a completely different way of linking than the
built in Xtext way. It is not done with EMF References so to "correct"
something, I simply link it the way it is supposed to be linked.
Geppetto's linker kicks in after the regular linker has done its work.
Look at the Geppetto class PPLinker which is responsible for calling
the special PPResourceLinker as well as triggering comment text processing.
The PPResourceLinker that performs the actual linking is based on a
different mechanism than the regular EMF linking, but you can look at it
for inspiration and use regular EReferences instead of the special
linking that is going on in Geppetto.
Powered by FUDForum
. Page generated in 0.01788 seconds