Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 517073

Summary: Completion and validation for VSM fields representing feature names can be improved
Product: [Modeling] Sirius Reporter: Laurent Redor <laurent.redor>
Component: CoreAssignee: Florian Barbin <florian.barbin>
Status: CLOSED FIXED QA Contact: Jessy Mallet <jessy.mallet>
Severity: enhancement    
Priority: P3 CC: florian.barbin, jessy.mallet, maxime.porhel
Version: unspecifiedKeywords: triaged
Target Milestone: 5.1.0   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=479049
https://git.eclipse.org/r/103806
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=e65a98deb661e81239613231cbab291d76e21736
https://git.eclipse.org/r/105464
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=7fbc92f3910f06816448ffdf8a495bf429bd3a2e
Whiteboard:
Attachments:
Description Flags
my.project.design.zip none

Description Laurent Redor CLA 2017-05-22 09:11:23 EDT
Created attachment 268504 [details]
my.project.design.zip

The completion and validation have been added for VSM fields representing feature names (thanks to bug 479049). They can be improved. Indeed, the completion (and validation) does not check that the "Reference Name" can contains elements of "Type Name".
Completion improvment:
* If "Type Name" is not set, all references of container must be listed in "Reference Name" field (as today).
* If "Type Name" is set, only references that can contain elements of this type must be listed.
Validation improvment:
* The validation must check that elements of type "Type Name" can be contained in reference "Reference Name".

Steps to reproduce:
* Import project my.project.design from "my.project.design.zip"
* Open project.odesign
* Launch the validation on root element
* KO: The validation should fail as reference "eSubpackages" can not contain elements of type "ecore::EClass".
* Select the "Create Instance" operation
* In the properties view, launch the completion on the field "Reference Name", only "eClassifiers" must be listed (to be coherent with "Type Name" "ecore::EClass")
* In the properties view, launch the completion on the field "Type Name", only "ecore::EPackage" must be listed (to be coherent with "Reference Name" "eSubpackages") --> This does not really match with the issue but it is linked.
Comment 1 Jessy Mallet CLA 2017-08-29 03:26:07 EDT
I've just pushed a draft at https://git.eclipse.org/r/103806/, which simply validate feature referenceName by checking type of the feature with the typeName (no other changes like completion).
Comment 2 Florian Barbin CLA 2017-09-15 08:54:17 EDT
A last test is missing to check that the "Type Name" completion is consistent with the feature specified in "Reference Name"
Comment 4 Eclipse Genie CLA 2017-09-20 04:15:09 EDT
New Gerrit change created: https://git.eclipse.org/r/105464
Comment 6 Jessy Mallet CLA 2017-09-25 08:41:56 EDT
Validated on Sirius Stable 5.1.0.201709221508
Comment 7 Pierre-Charles David CLA 2017-11-08 03:37:07 EST
Available in Sirius 5.1.0, see https://wiki.eclipse.org/Sirius/5.1.0.