[grammar][serializer] Use the EString from the resource set

This commit is contained in:
Sebastian Zarnekow 2015-11-12 10:10:48 +01:00
parent c2dd4765a6
commit 6ffb896586
2 changed files with 2 additions and 3 deletions

View file

@ -10,7 +10,6 @@ package org.eclipse.xtext.xtext;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.xtext.AbstractMetamodelDeclaration;
import org.eclipse.xtext.AbstractRule;
import org.eclipse.xtext.CrossReference;
@ -54,7 +53,7 @@ public class XtextTransientValueService extends DefaultTransientValueService {
}
} else if (rule instanceof TerminalRule) {
final TypeRef returnType = rule.getType();
return ((TerminalRule) rule).isFragment() || returnType == null || EcorePackage.eINSTANCE.getEString().equals(rule.getType().getClassifier());
return ((TerminalRule) rule).isFragment() || returnType == null || GrammarUtil.findEString(GrammarUtil.getGrammar(owner)).equals(rule.getType().getClassifier());
}
}
else if (feature == XtextPackage.eINSTANCE.getCrossReference_Terminal()) {

View file

@ -65,7 +65,7 @@ public class XtextTransientValueService2 extends TransientValueService {
return YES;
}
}
if (EcorePackage.eINSTANCE.getEString().equals(rule.getType().getClassifier()))
if (GrammarUtil.findEString(GrammarUtil.getGrammar(owner)).equals(rule.getType().getClassifier()))
return PREFERABLY;
return NO;
}