Forráskód Böngészése

Fixed global scope filter to only filter variables that are defined in other statecharts (but allowing references to variables defined in the resource kinds).

tomqc86@googlemail.com 11 éve
szülő
commit
e5e644b522

+ 5 - 1
plugins/org.yakindu.sct.model.stext/src/org/yakindu/sct/model/stext/scoping/STextGlobalScopeProvider.java

@@ -64,10 +64,14 @@ public class STextGlobalScopeProvider extends DefaultGlobalScopeProvider {
 				ContextElementAdapter.class);
 		if (provider != null) {
 			parentScope = new FilteringScope(parentScope, new Predicate<IEObjectDescription>() {
+				
 				public boolean apply(IEObjectDescription input) {
+					// only accept events, regular states and variables from own statechart
 					if (input.getEClass() == StextPackage.Literals.EVENT_DEFINITION
 							|| SGraphPackage.Literals.REGULAR_STATE.isSuperTypeOf(input.getEClass())
-							|| input.getEClass() == StextPackage.Literals.VARIABLE_DEFINITION) {
+							|| (input.getEClass() == StextPackage.Literals.VARIABLE_DEFINITION && 
+								input.getEObjectURI().fileExtension().equals("sct"))) {
+						
 						URI sourceURI = input.getEObjectURI().trimFragment();
 						return sourceURI.equals(provider.getElement().eResource().getURI());
 					}