|
@@ -9,7 +9,8 @@
|
|
|
*/
|
|
|
package org.yakindu.sct.model.stext.scoping;
|
|
|
|
|
|
-import java.util.Collections;
|
|
|
+import static java.util.Collections.singletonList;
|
|
|
+
|
|
|
import java.util.List;
|
|
|
|
|
|
import org.eclipse.emf.ecore.EObject;
|
|
@@ -66,14 +67,6 @@ public class StextImportAwareScopeProvider extends ImportedNamespaceAwareLocalSc
|
|
|
for (ImportScope scope : importScopes) {
|
|
|
importedNamespaceResolvers.addAll(createNamespaceResolver(scope, ignoreCase));
|
|
|
}
|
|
|
-
|
|
|
- // Add implicit import for statechart name here:
|
|
|
- Statechart statechart = getStatechart(context);
|
|
|
- if (statechart != null && statechart.getName() != null) {
|
|
|
- ImportNormalizer localNormalizer = doCreateImportNormalizer(QualifiedName.create(statechart.getName()),
|
|
|
- true, ignoreCase);
|
|
|
- importedNamespaceResolvers.add(localNormalizer);
|
|
|
- }
|
|
|
return importedNamespaceResolvers;
|
|
|
}
|
|
|
|
|
@@ -96,7 +89,6 @@ public class StextImportAwareScopeProvider extends ImportedNamespaceAwareLocalSc
|
|
|
return importedNamespaceResolvers;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
protected IScope getLocalElementsScope(IScope parent, final EObject context, final EReference reference) {
|
|
|
IScope result = parent;
|
|
|
ISelectable allDescriptions = getAllDescriptions(context.eResource());
|
|
@@ -106,13 +98,17 @@ public class StextImportAwareScopeProvider extends ImportedNamespaceAwareLocalSc
|
|
|
if (!namespaceResolvers.isEmpty()) {
|
|
|
if (isRelativeImport() && name != null && !name.isEmpty()) {
|
|
|
ImportNormalizer localNormalizer = doCreateImportNormalizer(name, true, ignoreCase);
|
|
|
- result = createImportScope(result, Collections.singletonList(localNormalizer), allDescriptions,
|
|
|
+ result = createImportScope(result, singletonList(localNormalizer), allDescriptions,
|
|
|
reference.getEReferenceType(), isIgnoreCase(reference));
|
|
|
}
|
|
|
result = createImportScope(result, namespaceResolvers, null, reference.getEReferenceType(),
|
|
|
isIgnoreCase(reference));
|
|
|
}
|
|
|
- // We don't want to add an implicit local ImportNormalizer here...
|
|
|
+ if (name != null) {
|
|
|
+ ImportNormalizer localNormalizer = doCreateImportNormalizer(name, true, ignoreCase);
|
|
|
+ result = createImportScope(result, singletonList(localNormalizer), allDescriptions,
|
|
|
+ reference.getEReferenceType(), isIgnoreCase(reference));
|
|
|
+ }
|
|
|
return result;
|
|
|
}
|
|
|
|