The constraint annotation uses a string as the argument for the location, but I don't see any reference to why this is. The hint says that it should contain the name of one of the parameters. Why is this not an actual reference to one of the declared parameters? It seems that you could catch typo's more easily that way (and automatic refactoring could potentially provide better results).
So, is there a use of this location argument that I'm missing? Or is this perhaps a placeholder for future functionality?
--
Hi,the location argument is used in the generated constraint class and is used for exactly what the name implies. The EObject in the given match parameter will get the marker if the constraint is violated. This allows you to navigate to the element in many editors by double-clicking the marker.It is a string mainly for legacy reasons, the annotation was created before direct reference to parameters were allowed in annotation parameters.
You can post a bug report on BugZilla if you believe that it would be important to change it to direct reference.
Finally, the validator does check that it is a valid parameter name (if it doesn't that's a bug that should also be reported), and refactoring of pattern and parameter names doesn't work too well at the moment anyway.
(I see that Zoltán already answered, but decided that you might like to get some further details)Best regards,
It's not a dealbreaker, but what are your thoughts on this: is it better to use only strings in annotations (for consistency), or is it better to do direct references (as then code completion and quick fixes become easier?)
--
You received this message because you are subscribed to the Google Groups "EMF-IncQuery Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to incquery-user...@googlegroups.com.
To post to this group, send email to incquer...@googlegroups.com.