use of org.antlr.works.find.Usages in project antlrworks by antlr.
the class FindMenu method findUsage.
public void findUsage() {
StatisticsAW.shared().recordEvent(StatisticsAW.EVENT_FIND_USAGES);
ATEToken token = delegate.getCurrentToken();
if (token == null)
return;
Usages usage = new Usages(delegate, token);
delegate.addUsagesTab(usage);
for (ATEToken ateToken : delegate.getTokens()) {
if (ateToken.getAttribute().equals(token.getAttribute())) {
ElementRule matchedRule = delegate.getEditorRules().getEnclosingRuleAtPosition(ateToken.getStartIndex());
if (matchedRule != null)
usage.addMatch(matchedRule, ateToken);
}
}
}
Aggregations