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

Bug 328829

Summary: [Xtext-uml] Dealing with semantic errors before saving in the xtext specific editor
Product: [Modeling] Papyrus Reporter: David Servat <David.Servat>
Component: CoreAssignee: Arnaud Cuccuru <arnaud.cuccuru>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: David.Servat
Version: unspecified   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:
Attachments:
Description Flags
Patch for org.eclipse.xtext.gmf.glue
sebastien.gerard: iplog+
patch for org.eclipse.papyrus.connectionpointreference.editor.xtext.ui.patch
sebastien.gerard: iplog+
Patch for org.eclipse.papyrus.constraintwithvsl.editor.xtext.ui
sebastien.gerard: iplog+
Patch for org.eclipse.papyrus.marte.vsl
sebastien.gerard: iplog+
Patch for org.eclipse.papyrus.message.editor.xtext.ui
sebastien.gerard: iplog+
Patch for org.eclipse.papyrus.property.editor.xtext
sebastien.gerard: iplog+
Patch for org.eclipse.papyrus.property.editor.xtext.ui
sebastien.gerard: iplog+
Patch for org.eclipse.papyrus.state.editor.xtext
sebastien.gerard: iplog+
Patch for org.eclipse.papyrus.state.editor.xtext.ui
sebastien.gerard: iplog+
Patch for org.eclipse.papyrus.stereotypeapplicationwithvsl.editor.xtext
sebastien.gerard: iplog+
Patch for org.eclipse.papyrus.stereotypeapplicationwithvsl.editor.xtext.ui
sebastien.gerard: iplog+
Patch for org.eclipse.papyrus.transition.editor.xtext.ui sebastien.gerard: iplog+

Description David Servat CLA 2010-10-27 09:52:33 EDT
There should be a dedicated support for semantic error (not only parsing error) before allowing a save, using the xtext editor.

An example of incorrect behavior is the following: when one removes a submachine reference on a submachineState, if ConnectionPointReferences exist, an error is shown in the editor, yet the save is performed (even in cases when user press ESC), yielding to inconsistent model.

Only parsing errors seem to be taken into account in the xtext-gmf glue, see PopupXtextEditorHelper::isDocumentHasErrors
Comment 1 Arnaud Cuccuru CLA 2010-10-28 10:07:09 EDT
Created attachment 181939 [details]
Patch for org.eclipse.xtext.gmf.glue

Adapted to ignore saving when ESC is pressed, and to take into account semantic validation before saving. If validation fails, no reconciliation happens.
Comment 2 Arnaud Cuccuru CLA 2010-10-28 10:08:23 EDT
Created attachment 181940 [details]
patch for org.eclipse.papyrus.connectionpointreference.editor.xtext.ui.patch

Adapted to take into account changes of org.eclipse.xtext.gmf.glue
Comment 3 Arnaud Cuccuru CLA 2010-10-28 10:09:05 EDT
Created attachment 181941 [details]
Patch for org.eclipse.papyrus.constraintwithvsl.editor.xtext.ui

Adapted to take into account changes of org.eclipse.xtext.gmf.glue
Comment 4 Arnaud Cuccuru CLA 2010-10-28 10:09:39 EDT
Created attachment 181942 [details]
Patch for org.eclipse.papyrus.marte.vsl

Adapted to take into account changes of org.eclipse.xtext.gmf.glue
Comment 5 Arnaud Cuccuru CLA 2010-10-28 10:10:54 EDT
Created attachment 181944 [details]
Patch for org.eclipse.papyrus.message.editor.xtext.ui

Adapted to take into account changes of org.eclipse.xtext.gmf.glue
Comment 6 Arnaud Cuccuru CLA 2010-10-28 10:11:26 EDT
Created attachment 181945 [details]
Patch for org.eclipse.papyrus.property.editor.xtext

Adapted to take into account changes of org.eclipse.xtext.gmf.glue
Comment 7 Arnaud Cuccuru CLA 2010-10-28 10:12:04 EDT
Created attachment 181946 [details]
Patch for org.eclipse.papyrus.property.editor.xtext.ui

Adapted to take into account changes of org.eclipse.xtext.gmf.glue
Comment 8 Arnaud Cuccuru CLA 2010-10-28 10:12:42 EDT
Created attachment 181947 [details]
Patch for org.eclipse.papyrus.state.editor.xtext

Adapted to take into account changes of org.eclipse.xtext.gmf.glue
Comment 9 Arnaud Cuccuru CLA 2010-10-28 10:13:36 EDT
Created attachment 181949 [details]
Patch for org.eclipse.papyrus.state.editor.xtext.ui

Adapted to take into account changes of org.eclipse.xtext.gmf.glue
Comment 10 Arnaud Cuccuru CLA 2010-10-28 10:14:05 EDT
Created attachment 181950 [details]
Patch for org.eclipse.papyrus.stereotypeapplicationwithvsl.editor.xtext

Adapted to take into account changes of org.eclipse.xtext.gmf.glue
Comment 11 Arnaud Cuccuru CLA 2010-10-28 10:15:03 EDT
Created attachment 181954 [details]
Patch for org.eclipse.papyrus.stereotypeapplicationwithvsl.editor.xtext.ui

Adapted to take into account changes of org.eclipse.xtext.gmf.glue
Comment 12 Arnaud Cuccuru CLA 2010-10-28 10:15:41 EDT
Created attachment 181955 [details]
Patch for org.eclipse.papyrus.transition.editor.xtext.ui

Adapted to take into account changes of org.eclipse.xtext.gmf.glue
Comment 13 Arnaud Cuccuru CLA 2010-10-28 10:16:33 EDT
The patches in attachment should resolve these bugs.
Comment 14 David Servat CLA 2010-10-28 14:11:52 EDT
Fixed with Arnaud Cuccuru patches applied