Commit b92d2e05 authored by Philip Makedonski's avatar Philip Makedonski
Browse files

* reset validator in case of failure during scope resolution, #162, #157

parent 8527216d
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -5,7 +5,9 @@ package org.etsi.mts.tdl.scoping;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.ocl.pivot.internal.utilities.IllegalLibraryException;
import org.eclipse.xtext.scoping.IScope;
import org.etsi.mts.tdl.Validator;

/**
 * This class contains custom scoping description.
@@ -17,7 +19,14 @@ public class TDLtxScopeProvider extends TDLScopeProvider {

	@Override
	public IScope getScope(EObject context, EReference reference) {
		try {
			return super.getScope(context, reference);
		} catch (IllegalLibraryException e) {
			// catch and log the exception to avoid breaking the editor
			e.printStackTrace();
			Validator.reload();
			return super.getScope(context, reference);
		}
	}

	@Override