use of org.eclipse.xtext.ui.codetemplates.templates.Codetemplates in project xtext-eclipse by eclipse.
the class CodetemplatesScopeProvider method scope_Codetemplate_context.
public IScope scope_Codetemplate_context(Codetemplate template, EReference reference) {
Codetemplates root = EcoreUtil2.getContainerOfType(template, Codetemplates.class);
if (root != null && root.getLanguage() != null) {
Grammar grammar = root.getLanguage();
if (!grammar.eIsProxy()) {
LinkedHashSet<AbstractRule> usedRules = Sets.newLinkedHashSet();
new UsedRulesFinder(usedRules).compute(grammar);
return Scopes.scopeFor(Iterables.filter(usedRules, ParserRule.class));
}
}
return IScope.NULLSCOPE;
}
Aggregations