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

Bug 369087

Summary: [xtext][grammarEditor] Autoedit quirk spurious closing brace added
Product: [Modeling] TMF Reporter: H. Niemann <Hartmut.Niemann>
Component: XtextAssignee: Jan Koehnlein <jan>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jan, sven.efftinge, tmf.xtext-inbox
Version: unspecifiedFlags: sven.efftinge: juno+
Target Milestone: M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description H. Niemann CLA 2012-01-19 09:46:16 EST
Build Identifier: Version: Indigo Service Release 1

If I edit the last rule of the attached grammar, and hit Return after the last
semikolon, a '}' is added and marked as syntactically wrong.
Placing spaces before or after the | cures the problem, but I have not found out what the system is.  Editing the file and undoing the change made
the problem vanish as well.

See http://www.eclipse.org/forums/index.php/mv/msg/277439/780782/#msg_780782


Reproducible: Sometimes

Steps to Reproduce:
1.Enter the grammar. I was able to reproduce the problem a few times with:

grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals

generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"

Model:
	x=st1;
terminal st1:
	'"' ( !('\\'|'"'|'$'|'['|']'|'{'|'}') )* '"'; 

and then at some point it started working as expected :-(
2. go to the end of the file, hit enter
3. get a closing curly brace two lines lower with a red wavy underline.
Comment 1 Jan Koehnlein CLA 2012-03-02 09:00:37 EST
*** Bug 373081 has been marked as a duplicate of this bug. ***
Comment 2 Jan Koehnlein CLA 2012-03-02 11:32:21 EST
I think I found the problem: In the DocumentPartitioner we don't update the token after determining the actualReparseStart. My curretn fix looks good but I have to investigate and test a bit further.
Comment 3 Jan Koehnlein CLA 2012-03-06 09:53:36 EST
Pushed some tests to MASTER.
Comment 4 Karsten Thoms CLA 2017-09-19 17:58:24 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 5 Karsten Thoms CLA 2017-09-19 18:09:10 EDT
Closing all bugs that were set to RESOLVED before Neon.0