/**
   * Get IMember from Item <br>
   * AST => DLTK Model
   */
  public static IMember getIMember(ISourceModule sourceModule, Item item) {
    LuaASTNode parent = item.getParent();
    if (LuaASTUtils.isTypeField(item)) {
      // support record field
      IType iType = getIType(sourceModule, (RecordTypeDef) parent);
      if (iType != null) {
        try {
          for (IModelElement child : iType.getChildren()) {
            if (child.getElementName().equals(item.getName()) && child instanceof IMember)
              return (IMember) child;
          }
        } catch (ModelException e) {
          Activator.logWarning(
              "unable to get IMember corresponding to the given item " + item, e); // $NON-NLS-1$
        }
      }
    } else if (LuaASTUtils.isLocal(item)) {
      // TODO retrieve local var which are in the model (so the local var in the first block)
      // support local variable
      // ------------------------------------------------------------------------------------

      // manage method
      TypeDef resolvedtype = LuaASTUtils.resolveTypeLocaly(sourceModule, item);
      if (resolvedtype != null && resolvedtype instanceof FunctionTypeDef) {
        FunctionTypeDef functionResolvedType = (FunctionTypeDef) resolvedtype;
        String[] parametersName = new String[functionResolvedType.getParameters().size()];
        for (int i = 0; i < parametersName.length; i++) {
          parametersName[i] = functionResolvedType.getParameters().get(i).getName();
        }
        return new FakeMethod(
            sourceModule,
            item.getName(),
            item.sourceStart(),
            item.getName().length(),
            parametersName,
            Declaration.AccPrivate,
            item);
      }
      // manage field
      return new FakeField(
          sourceModule,
          item.getName(),
          item.sourceStart(),
          item.getName().length(),
          Declaration.AccPrivate,
          item);
    } else if (LuaASTUtils.isGlobal(item)) {
      // support global var
      try {
        for (IModelElement child : sourceModule.getChildren()) {
          if (child.getElementName().equals(item.getName()) && child instanceof IMember)
            return (IMember) child;
        }
      } catch (ModelException e) {
        Activator.logWarning(
            "unable to get IMember corresponding to the given item " + item, e); // $NON-NLS-1$
      }
    } else if (LuaASTUtils.isUnresolvedGlobal(item)) {
      return new FakeField(
          sourceModule,
          item.getName(),
          item.sourceStart(),
          item.getName().length(),
          Declaration.AccGlobal,
          item);
    }
    return null;
  }