SNode enclosingMacro = findOuterMacro(contextNode);
if ((enclosingMacro == null)) {
return QueriesUtil.getApplicableConcept_fromEnvironment(contextNode);
}
if (SNodeOperations.isInstanceOf(enclosingMacro, "jetbrains.mps.lang.generator.structure.SourceSubstituteMacro")) {
<BUG>SNode query = QueriesUtil.getQueryFunction_fromSourceSubstituteMacro(SNodeOperations.cast(enclosingMacro, "jetbrains.mps.lang.generator.structure.SourceSubstituteMacro"));

return getConceptFrom(TypeChecker.getInstance().getTypeOf(query));</BUG>
}
return null;

SNode enclosingMacro = findOuterMacro(contextNode);
if ((enclosingMacro == null)) {
return QueriesUtil.getApplicableConcept_fromEnvironment(contextNode);
}
if (SNodeOperations.isInstanceOf(enclosingMacro, "jetbrains.mps.lang.generator.structure.SourceSubstituteMacro")) {
return getConceptFrom(SNodeOperations.cast(enclosingMacro, "jetbrains.mps.lang.generator.structure.SourceSubstituteMacro"));
}
return null;
