@Override
  @NotNull
  public List<ReferenceType> getAllClasses(@NotNull final SourcePosition position) throws NoDataException {
    if (LOG.isDebugEnabled()) {
      LOG.debug("getAllClasses: " + position);
    }

    checkGroovyFile(position);
    List<ReferenceType> result = ReadAction.compute(() -> {
      GroovyPsiElement sourceImage = findReferenceTypeSourceImage(position);

      if (sourceImage instanceof GrTypeDefinition && !((GrTypeDefinition)sourceImage).isAnonymous()) {
        String qName = getClassNameForJvm((GrTypeDefinition)sourceImage);
        if (qName != null) return myDebugProcess.getVirtualMachineProxy().classesByName(qName);
      }
      else if (sourceImage == null) {
        final String scriptName = getScriptQualifiedName(position);
        if (scriptName != null) return myDebugProcess.getVirtualMachineProxy().classesByName(scriptName);
      }
      else {
        String enclosingName = findEnclosingName(position);
        if (enclosingName == null) return null;

        final List<ReferenceType> outers = myDebugProcess.getVirtualMachineProxy().classesByName(enclosingName);
        final List<ReferenceType> result1 = new ArrayList<>(outers.size());
        for (ReferenceType outer : outers) {
          final ReferenceType nested = findNested(outer, sourceImage, position);
          if (nested != null) {
            result1.add(nested);
          }
        }
        return result1;
      }
      return null;
    });

    if (LOG.isDebugEnabled()) {
      LOG.debug("getAllClasses = " + result);
    }
    if (result == null) throw NoDataException.INSTANCE;
    return result;
  }
@Override
  @NotNull
  public List<ReferenceType> getAllClasses(@NotNull final SourcePosition position)