Community
Participate
Working Groups
In a DSL-document when I press enter within a comment, I got the exception stated below. The recursion in DocumentUtil.findNextOffSetInPartition is never cancelled because partition2.getLength() == 0; This occurred in Xtext 2.0.1.v201108310706 Type pof partition2 is "__dftl_partition_content_type", type of partition is "__comment". java.lang.StackOverflowError at org.eclipse.jface.text.AbstractDocument.computeIndexInPositionList(AbstractDocument.java:455) at org.eclipse.jface.text.AbstractDocument.computeIndexInCategory(AbstractDocument.java:544) at org.eclipse.jface.text.rules.FastPartitioner.getPartition(FastPartitioner.java:484) at org.eclipse.jface.text.rules.FastPartitioner.getPartition(FastPartitioner.java:592) at org.eclipse.jface.text.AbstractDocument.getPartition(AbstractDocument.java:1495) at org.eclipse.jface.text.AbstractDocument.getPartition(AbstractDocument.java:966) at org.eclipse.xtext.ui.editor.model.DocumentUtil.findNextOffSetInPartition(DocumentUtil.java:86) at org.eclipse.xtext.ui.editor.model.DocumentUtil.findNextOffSetInPartition(DocumentUtil.java:91) at org.eclipse.xtext.ui.editor.model.DocumentUtil.findNextOffSetInPartition(DocumentUtil.java:91) at org.eclipse.xtext.ui.editor.model.DocumentUtil.findNextOffSetInPartition(DocumentUtil.java:91) at org.eclipse.xtext.ui.editor.model.DocumentUtil.findNextOffSetInPartition(DocumentUtil.java:91) at org.eclipse.xtext.ui.editor.model.DocumentUtil.findNextOffSetInPartition(DocumentUtil.java:91) at org.eclipse.xtext.ui.editor.model.DocumentUtil.findNextOffSetInPartition(DocumentUtil.java:91) at org.eclipse.xtext.ui.editor.model.DocumentUtil.findNextOffSetInPartition(DocumentUtil.java:91) at org.eclipse.xtext.ui.editor.model.DocumentUtil.findNextOffSetInPartition(DocumentUtil.java:91) at org.eclipse.xtext.ui.editor.model.DocumentUtil.findNextOffSetInPartition(DocumentUtil.java:91) at org.eclipse.xtext.ui.editor.model.DocumentUtil.findNextOffSetInPartition(DocumentUtil.java:91) at org.eclipse.xtext.ui.editor.model.DocumentUtil.findNextOffSetInPartition(DocumentUtil.java:91)
Hi Moritz, please provide an input model + cursor position that reproduces the issue.
*** Bug 357203 has been marked as a duplicate of this bug. ***
I tried various combinations of comments that immediatly followed each other, were at the beginning of the file or at the end. Could you please provide a reproducable example?
It took me a while to "reverse engineer" this bug's required state... but I found it: 1. create an .xtend file ---- class bar { /* ! /**/ } ---- 2. Locate the cursor behind the exclamation mark 3. Press enter 4. Watch the stack flow over.
(In reply to comment #4) > It took me a while to "reverse engineer" this bug's required state... but I > found it Great! Do you have the time to look into this?
fixed. pushed to master. please review: http://git.eclipse.org/c/tmf/org.eclipse.xtext.git/commit/?id=33c8f6f69bb7c2db672635051177a766c24684f7
added test case: org.eclipse.xtext.ui.junit.editor.autoedit.AbstractCStyleLanguageAutoEditTest.testBug358555()
Closing all bugs that were set to RESOLVED before Neon.0