mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 08:48:55 +00:00
Merge branch 'maintenance'
This commit is contained in:
commit
412a1dd4ee
5 changed files with 13 additions and 1 deletions
|
@ -19,6 +19,7 @@ import org.eclipse.emf.mwe.utils.StandaloneSetup
|
|||
import org.eclipse.xtext.ecore.EcoreSupportStandaloneSetup
|
||||
import org.eclipse.xtext.resource.IResourceServiceProvider
|
||||
import org.eclipse.xtext.util.internal.Log
|
||||
import org.eclipse.emf.ecore.EcorePackage
|
||||
|
||||
/**
|
||||
* @noextend
|
||||
|
@ -30,6 +31,7 @@ class XtextGeneratorResourceSetInitializer {
|
|||
public def void initialize(ResourceSet resourceSet, List<String> referencedResources) {
|
||||
val delegate = new StandaloneSetup
|
||||
delegate.resourceSet = resourceSet
|
||||
resourceSet.packageRegistry.put(EcorePackage.eNS_URI, EcorePackage.eINSTANCE)
|
||||
referencedResources.forEach[
|
||||
loadResource(resourceSet)
|
||||
]
|
||||
|
|
|
@ -718,7 +718,7 @@ class IdeaPluginGenerator extends AbstractStubGeneratingFragment {
|
|||
}
|
||||
val classifier = type?.classifier
|
||||
val feature = if(classifier instanceof EClass) classifier.getEStructuralFeature('name')
|
||||
feature instanceof EAttribute && !feature.many && String.isAssignableFrom(feature.EType.instanceClass)
|
||||
feature instanceof EAttribute && !feature.many && feature?.EType?.instanceClass != null && String.isAssignableFrom(feature.EType.instanceClass)
|
||||
}
|
||||
|
||||
def compileAbstractCompletionContributor(Grammar grammar) {
|
||||
|
|
|
@ -73,6 +73,10 @@ public abstract class AbstractInjectableValidator implements EValidator {
|
|||
|
||||
protected abstract boolean internalValidate(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context);
|
||||
|
||||
/**
|
||||
* If this validator is for an EPackage you want to use in multiple languages,
|
||||
* this method should return false. Otherwise issues will be reported twice.
|
||||
*/
|
||||
public boolean isLanguageSpecific() {
|
||||
return languageName != null;
|
||||
}
|
||||
|
|
|
@ -13,6 +13,11 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Annotation that allows to modularize the validator into multiple classes.
|
||||
*
|
||||
* The listed validators should override the method {@link AbstractDeclarativeValidator#register(EValidatorRegistrar)}
|
||||
* with an empty implementation otherwise all issues will be reported twice.
|
||||
*
|
||||
* @author Sebastian Zarnekow - Initial contribution and API
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
|
|
@ -215,6 +215,7 @@ public class CompositeEValidator implements EValidator {
|
|||
CompositeEValidator result = new CompositeEValidator();
|
||||
result.equalitySupportProvider = this.equalitySupportProvider;
|
||||
result.useEObjectValidator = this.useEObjectValidator;
|
||||
result.operationCanceledManager = this.operationCanceledManager;
|
||||
if (this.contents != null) {
|
||||
result.contents = Lists.newArrayList(this.contents);
|
||||
this.contents = null;
|
||||
|
|
Loading…
Reference in a new issue