Commit 07983f72 authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+ added some fall-back checks for scoping

parent 1c47c6ab
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -259,7 +259,9 @@ public class TDLScopeProvider extends AbstractDeclarativeScopeProvider {
									.allMembers());
									.allMembers());
							return scope;
							return scope;
						}
						}
					} else if (context.eContainer().eContainer() instanceof ParameterBinding) {
					} else if (context.eContainer().eContainer() instanceof ParameterBinding && 
							((ParameterBinding)context.eContainer().eContainer()).getParameter().getDataType() instanceof StructuredDataType 
							) {
						IScope scope = Scopes.scopeFor(((StructuredDataType)((ParameterBinding)context.eContainer().eContainer()).getParameter().getDataType()).allMembers());
						IScope scope = Scopes.scopeFor(((StructuredDataType)((ParameterBinding)context.eContainer().eContainer()).getParameter().getDataType()).allMembers());
						return scope;
						return scope;
					}
					}
@@ -348,7 +350,7 @@ public class TDLScopeProvider extends AbstractDeclarativeScopeProvider {
				}
				}
			}
			}
			if (context instanceof VariableUse) {
			if (context instanceof VariableUse) {
				if (((VariableUse)context).getComponentInstance()!=null) {
				if (((VariableUse)context).getComponentInstance()!=null && ((VariableUse)context).getComponentInstance().getType()!=null) {
					IScope scope = Scopes.scopeFor(((VariableUse)context).getComponentInstance().getType().allVariables());
					IScope scope = Scopes.scopeFor(((VariableUse)context).getComponentInstance().getType().allVariables());
					return scope;
					return scope;
				}
				}
@@ -360,7 +362,7 @@ public class TDLScopeProvider extends AbstractDeclarativeScopeProvider {
				}
				}
			}
			}
		} else if (reference.getEType().getInstanceClass() == Timer.class) {
		} else if (reference.getEType().getInstanceClass() == Timer.class) {
			if (context instanceof TimerOperation) {
			if (context instanceof TimerOperation && ((TimerOperation)context).getComponentInstance().getType()!=null) {
				IScope scope = Scopes.scopeFor(((TimerOperation)context).getComponentInstance().getType().allTimers());
				IScope scope = Scopes.scopeFor(((TimerOperation)context).getComponentInstance().getType().allTimers());
				return scope;
				return scope;
			}
			}