Community
Participate
Working Groups
Build Identifier: 20100617-1415 In certain circumstances the generated dsl editor throws an IllegalArgumentException resulting either in a corrupt editor or a corrupt in-memory-model. (Exception detail: see attachment: "Exception.txt" in "xtext_issue.zip") Reproducible: Always Steps to Reproduce: 1. extract attachment 2. use org.xtext.example.mydsl + org.xtext.example.mydsl.ui from archive to launch an eclipse application 3. load project "mydsl" from archive in workspace 4. edit the file "test.mydsl" in imported project as follows: a) remove the "(" of line 3 b) clean all characters of line 2 c) enter "(" in line 2 d) as soon as you try to enter ")" after the "(" in line 2, the Exception occurs and the ")" is not printed. Note: If you then save the model and reopen the file, the ")" does exist.
Created attachment 174153 [details] archive with all files to reproduce the issue
The SingleLineTerminalsStrategy tries to overwrite always one character more in #handleInsertRightTerminal, if the number of right and left are balanced before insertion and right is inserted. If your document is balanced and behind the curser is not a right-Terminal, the next character is replaced. If the next character is a \n the editor throws an IllegalArgument exception, as mentioned above, or removes the new line. What should be: If the next text right behind the new text position is the right-Terminal, this should be replaced. If not, the terminal should be included without changed.
Created attachment 175416 [details] Patch for HEAD on 2010-07-28 on o.e.x.ui Patch for SingleLineTerminalsStrategy to not always overwrite the next character
Fixed in HEAD. As I did not apply the patch directly, I'ld like you to verify the fix. Thanks.
the current head works also. Thanks
Closing all bugs that were set to RESOLVED before Neon.0