mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 08:48:55 +00:00
[formatter] fix ITextRegionAccess#getInvokingGrammarElement(EObject)
Make sure this method returns the same grammar element, no matter whether the text region access has been constructid via serializer or node model. Signed-off-by: Moritz Eysholdt <moritz.eysholdt@itemis.de>
This commit is contained in:
parent
f318b5e6a3
commit
ca290e71ec
3 changed files with 6 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.xtext.formatting2.regionaccess.internal;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
@ -14,6 +15,7 @@ import org.eclipse.xtext.formatting2.regionaccess.IEObjectRegion;
|
|||
import org.eclipse.xtext.formatting2.regionaccess.ITextSegment;
|
||||
import org.eclipse.xtext.resource.XtextResource;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
/**
|
||||
|
@ -63,5 +65,5 @@ public class NodeModelBasedRegionAccess extends AbstractRegionAccess {
|
|||
public boolean hasSyntaxError() {
|
||||
return resource.getParseResult().hasSyntaxErrors();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.xtext.formatting2.regionaccess.internal;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
@ -14,6 +15,7 @@ import org.eclipse.xtext.formatting2.regionaccess.IEObjectRegion;
|
|||
import org.eclipse.xtext.formatting2.regionaccess.ITextSegment;
|
||||
import org.eclipse.xtext.resource.XtextResource;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,4 +19,5 @@ public class StringEObjectRegion extends AbstractEObjectRegion {
|
|||
this.setGrammarElement(grammarElement);
|
||||
this.setSemantcElement(semanticElement);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue