|Re: Quick fix for OCLinEcore [message #1739945 is a reply to message #1739930]
||Fri, 05 August 2016 19:01
| Ed Willink
Registered: July 2009
Quickfixes is one of many things on my todo list.
Currently the validation is done by typically
The underlying technology has been improved so that an invariant can
'return' a projection of a rich Tuple rather than just a Boolean. so you
could rewrite the Pivot.ocl constraints as e.g.
isSafe implies not ownedSource?.type.oclAsType(CollectionType).isNullFree
status : Boolean = isSafe implies not
message : String = 'Unnecessary safe navigation - the souc
collection is null-free',
quickfix : String = 'org.eclipse.ocl.pivot.ui.RemoveSafeNavigation'
The rewrite should have little effect since naive use just ignores the
non-status fields. But a tweak to AbstractConstraintEvaluator or one of
its derivations should enable the code to activate the
Alternatively a tweak to AbstractConstraintEvaluator or one of its
derivations should be able to use the invariant name as a key. You will
find that there is already support for per-constraint severity control
in the Window->Preferences-<>OCL->Unified Pivot Binding. If you look at
the generated code in IterateExp you can see
public boolean validateSafeIteratorIsRequired(final DiagnosticChain
diagnostics, final Map<Object, Object> context)
final /*@NonInvalid*/ org.eclipse.ocl.pivot.values.@NonNull
IntegerValue severity_0 =
using PivotTables.STR_IterateExp_c_c_SafeIteratorIsRequired as a key to
lookup the severity.
If you fancy working on this please do. The auto-generation of Java from
QVTc / QVTr is getting close to useable, so I would like the quickfixes
to be QVTc / QVTr transformations. However for initial prototype
Java-coded transfornations will do fine.
On 05/08/2016 19:00, Anetta van der Walt wrote:
> I implemented constraint on a meta model level by making use of
> OCLinEcore. Everything works perfectly and in my problem view I get an
> error message if one of my constraints is violated.
> However, now I would like to implement quick fixes for these constraints
> in xtext. The only problem is I am not sure how to obtain the unique
> identification/ID of each of the errors in order to link a quick fix to
> it. Is there anybody who can advise me on this?
> Thank you
This email has been checked for viruses by Avast antivirus software.
Powered by FUDForum
. Page generated in 0.02205 seconds