// searching for the variable A from module a
final ErlangSearchPattern pattern = new SearchPatternFactory(ErlangEngine
.getInstance().getModelUtilService()).getSearchPattern(
SearchFor.VARIABLE, null, "A", 0, LimitTo.ALL_OCCURRENCES, moduleA);
final ErlSearchScope scope = new ErlSearchScope(moduleA, moduleB);
final ErlSearchScope reducedScope = pattern.reduceScope(scope);
final ErlSearchQuery query = new ErlSearchQuery(pattern, reducedScope, "");
query.run(new NullProgressMonitor());
// then
// it should be found in module a
final ErlangSearchResult searchResult = (ErlangSearchResult) query