Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369087 - [xtext][grammarEditor] Autoedit quirk spurious closing brace added
Summary: [xtext][grammarEditor] Autoedit quirk spurious closing brace added
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: M6   Edit
Assignee: Jan Koehnlein CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 373081 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-01-19 09:46 EST by H. Niemann CLA
Modified: 2017-09-19 18:09 EDT (History)
3 users (show)

See Also:
sven.efftinge: juno+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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