Open ewillink opened 6 months ago
Not saying the proposed approach is not the right one, but reformulating to be sure I understand correctly, what you need/want is a way to tell Sirius to ignore some resources as potential semantic resources (even though they are loadable EMF models), and do so with configuration only to avoid any hard dependency. Is that correct?
Yes. Many extension points, such as e.g org.eclipse.emf.ecore.uri_mapping allow functionality to be defined purely by parameters. Others such as org.eclipse.core.contenttype.contentTypes may need a functional class that may often be general purpose. org.eclipse.sirius.resourceStrategy has a very general purpose strategy but users are forced to define a custom implementation. This imposes undesirable dependencies at build time and further inconvenience at install time.
As a workaround for 2024-03, OCL and QVTd have to add Sirius dependencies to support e.g. https://git.eclipse.org/r/plugins/gitiles/mmt/org.eclipse.qvtd/+/refs/heads/master/plugins/org.eclipse.qvtd.xtext.qvtbase.ui/src/org/eclipse/qvtd/xtext/qvtbase/ui/QVTdNotAResourceStrategyImpl.java
(Of course one might question why an exception is needed at all. Why can't I draw a diagram that depicts the .aird content? For .aird the answer might be inadequate implementation. For .oclas the answer may be over-aggressive loading. I'm not a fan of proactive indexes. If there was a per-model diagram file just like the original Ecore tools we would not need the .aird index and its many problems.)
OCL provides an AS counterpart to Xtext/CS resources analoguously to Java's class files and java files. If the AS file is saved, bad things, such as no transaction, happen when Sirius processes both CS and AS. Simple solution: register a ResourceStrategy to inhibit Sirius's semantic resource recognition of OCL AS files.
Unfortunately Sirius does not provide a parameterisable extension point; it is necessary for application code such as OCL to provide a derived Sirius class even though OCL has no Sirius dependencies.
If the following was supported:
OCL and QVTd could configure Sirius without adding a dependency.
And in the spirit of eating one's own dog food, Sirius could replace isVsmModel and isRepFIle by