protected QuerySpecification createQuery(INamedElement defunit) throws ModelException {
DLTKSearchScopeFactory factory = DLTKSearchScopeFactory.getInstance();
boolean isInsideInterpreterEnvironment = isInsideInterpreterEnv(defunit, factory);
IDLTKSearchScope scope = factory.createWorkspaceScope(isInsideInterpreterEnvironment, getLanguageToolkit());
String description = factory.getWorkspaceScopeDescription(isInsideInterpreterEnvironment);
DeeDefPatternLocator.GLOBAL_param_defunit = defunit;
return new PatternQuerySpecification(
defunit.getName(), 0, true, getLimitTo(), scope, description);