Examples of INamedElement


Examples of dtool.ast.definitions.INamedElement

        String name = refImportSelection.getDenulledIdentifier();
        // Do pre-emptive matching
        if(!search.matchesName(name)) {
          continue;
        }
        INamedElement namedElement = refImportSelection.findTargetDefElement(search.modResolver);
        if(namedElement != null) {
          search.addMatch(namedElement);
        }
      }
    }
View Full Code Here

Examples of dtool.ast.definitions.INamedElement

    cp.appendNodeList("(", args, ", " , ")");
  }
 
  @Override
  public Collection<INamedElement> findTargetDefElements(IModuleResolver moduleResolver, boolean findFirstOnly) {
    INamedElement calleeElem = callee.findTargetDefElement(moduleResolver);
    if(calleeElem == null)
      return null;
   
    if (calleeElem instanceof DefinitionFunction) {
      DefinitionFunction defOpCallFunc = (DefinitionFunction) calleeElem;
      INamedElement calleeResult = defOpCallFunc.findReturnTypeTargetDefUnit(moduleResolver);
      return Collections.singleton(calleeResult);
    }
   
    Module moduleNode = null;
    if(calleeElem instanceof ASTNode) {
      ASTNode astNode = (ASTNode) calleeElem;
      moduleNode = astNode.getModuleNode();
    }
    if(moduleNode == null) {
      return null;
    }
   
    DefUnitSearch search = new DefUnitSearch("opCall", moduleNode, false, moduleResolver);
    calleeElem.resolveSearchInMembersScope(search);
   
    for (Iterator<INamedElement> iter = search.getMatchedElements().iterator(); iter.hasNext();) {
      INamedElement defOpCall = iter.next();
      if (defOpCall instanceof DefinitionFunction) {
        DefinitionFunction defOpCallFunc = (DefinitionFunction) defOpCall;
        INamedElement targetDefUnit = defOpCallFunc.findReturnTypeTargetDefUnit(moduleResolver);
        return Collections.singleton(targetDefUnit);
      }
    }
    return null;
  }
View Full Code Here

Examples of dtool.ast.definitions.INamedElement

  @Override
  protected IScriptCompletionProposal createScriptCompletionProposal(CompletionProposal proposal) {
   
    if(proposal instanceof RefSearchCompletionProposal) {
      RefSearchCompletionProposal refSearchProposal = (RefSearchCompletionProposal) proposal;
      INamedElement namedElement = refSearchProposal.getExtraInfo();
     
      String completion = proposal.getCompletion();
      int repStart = proposal.getReplaceStart();
      int repLength = proposal.getReplaceEnd() - proposal.getReplaceStart();
      Image image = createImage(proposal);
     
      String displayString = refSearchProposal.isModuleImportCompletion() ?
        namedElement.getModuleFullyQualifiedName() :
        DeeElementLabelProvider.getLabelForContentAssistPopup(namedElement);
     
      DeeCompletionProposal completionProposal = new DeeCompletionProposal(completion, repStart, repLength,
          image, displayString, namedElement, null);
      completionProposal.setTriggerCharacters(getVarTrigger());
View Full Code Here

Examples of dtool.ast.definitions.INamedElement

   
    if(proposal.getExtraInfo() instanceof DefElementDescriptor) {
      defDescriptor = (DefElementDescriptor) proposal.getExtraInfo();
    }
    else if(proposal.getExtraInfo() instanceof INamedElement) {
      INamedElement defElement = (INamedElement) proposal.getExtraInfo();
      defDescriptor = new DefElementDescriptor(defElement);
    }
    else if(proposal.getModelElement() instanceof IMember) {
      IMember member = (IMember) proposal.getModelElement();
      try {
View Full Code Here

Examples of dtool.ast.definitions.INamedElement

    }
    Module module = resolvedModule.getModuleNode();
    ASTNode pickedNode = ASTNodeFinder.findElement(module, offset);
    IModuleResolver mr = resolvedModule.getModuleResolver();
   
    INamedElement relevantElementForDoc = null;
    if(pickedNode instanceof DefSymbol) {
      relevantElementForDoc = ((DefSymbol) pickedNode).getDefUnit();
    } else if(pickedNode instanceof NamedReference) {
      relevantElementForDoc = ((NamedReference) pickedNode).findTargetDefElement(mr);
    } else if(pickedNode instanceof AutoReference) {
View Full Code Here

Examples of dtool.ast.definitions.INamedElement

    }
    return null;
  }
 
  protected String getDDocHTMLViewForAutoLike(IModuleResolver mr, IVarDefinitionLike defVar) {
    INamedElement resolvedType = defVar.getNodeSemantics().resolveEffectiveType(mr);
   
    if(resolvedType == null) {
      return TextUI.span("semantic_error", "color:red;",
        "<b> Error: Could not resolve auto initializer </b>");
    }
View Full Code Here

Examples of dtool.ast.definitions.INamedElement

    int offset = source.indexOf("XXX");
    offset = offset == -1 ? source.indexOf("xxx") : offset;
    assertTrue(offset != -1);
    DefUnit defElem = parseSourceAndPickNode(source, offset, DefUnit.class);
   
    INamedElement resolvedType = defElem.resolveTypeForValueContext(new NullModuleResolver());
    if(expectedFullName == null) {
      assertTrue(resolvedType == null);
      assertTrue(isError);
      return;
    }
    assertEquals(isError, resolvedType instanceof NotAValueErrorElement);
    String fullName = resolvedType.getFullyQualifiedName();
    fullName = StringUtil.trimStart(fullName, DEFAULT_MODULE + ".");
    assertEquals(fullName, expectedFullName);
  }
View Full Code Here

Examples of dtool.ast.definitions.INamedElement

 
  // TODO: cleanup these two methods
  protected static void testExpressionResolution(String source, String... expectedResults) {
    Expression exp = parseSourceAndPickNode(source, source.indexOf("/*X*/"), Expression.class);
    assertNotNull(exp);
    INamedElement expType = getSingleElementOrNull(exp.resolveTypeOfUnderlyingValue(new NullModuleResolver()));
   
    testResolveSearchInMembersScope(expType, expectedResults);
  }
View Full Code Here

Examples of dtool.ast.definitions.INamedElement

   
    testResolveSearchInMembersScope(expType, expectedResults);
  }
  protected static void testExpressionResolution2(String source, String... expectedResults) {
    Expression exp = new DeeTestsChecksParser(source).parseExpression().getNode();
    INamedElement expType = getSingleElementOrNull(exp.resolveTypeOfUnderlyingValue(new NullModuleResolver()));
   
    testResolveSearchInMembersScope(expType, expectedResults);
  }
View Full Code Here

Examples of dtool.ast.definitions.INamedElement

    }
  }
 
  protected void testResolveEffectiveType(String source, int offset, String expectedTypeFQN, String errorSuffix) {
    NullModuleResolver mr = new NullModuleResolver();
    INamedElement effectiveType = parseDefinitionVar(source, offset).getNodeSemantics().resolveEffectiveType(mr);
    if(expectedTypeFQN == null || effectiveType == null) {
      assertTrue(expectedTypeFQN == null && effectiveType == null);
      return;
    }
    assertEquals(effectiveType.getFullyQualifiedName(), expectedTypeFQN);
    if(errorSuffix != null) {
      assertTrue(effectiveType.getExtendedName().endsWith(errorSuffix));
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.