Package com.google.dart.engine.index

Examples of com.google.dart.engine.index.Location


  public Void visitVariableDeclaration(VariableDeclaration node) {
    VariableElement element = node.getElement();
    // record declaration
    {
      SimpleIdentifier name = node.getName();
      Location location = createLocationFromNode(name);
      location = getLocationWithExpressionType(location, node.getInitializer());
      recordRelationship(element, IndexConstants.IS_DEFINED_BY, location);
    }
    // visit
    enterScope(element);
View Full Code Here


   * @return the {@link Location} representing the given offset and length within the inner-most
   *         {@link Element}.
   */
  private Location createLocationFromOffset(int offset, int length) {
    Element element = peekElement();
    return new Location(element, offset, length);
  }
View Full Code Here

  /**
   * Records the {@link Element} definition in the library and universe.
   */
  private void recordElementDefinition(Element element, Relationship relationship) {
    Location location = createLocation(element);
    recordRelationship(libraryElement, relationship, location);
    recordRelationship(IndexConstants.UNIVERSE, relationship, location);
  }
View Full Code Here

        libraryElement,
        null,
        element,
        importElementsMap);
    if (importElement != null) {
      Location location = createLocationFromOffset(node.getOffset(), 0);
      recordRelationship(importElement, IndexConstants.IS_REFERENCED_BY, location);
    }
  }
View Full Code Here

  private void recordImportElementReferenceWithPrefix(SimpleIdentifier prefixNode) {
    ImportElementInfo info = getImportElementInfo(prefixNode);
    if (info != null) {
      int offset = prefixNode.getOffset();
      int length = info.periodEnd - offset;
      Location location = createLocationFromOffset(offset, length);
      recordRelationship(info.element, IndexConstants.IS_REFERENCED_BY, location);
    }
  }
View Full Code Here

   * Records reference to defining {@link CompilationUnitElement} of the given
   * {@link LibraryElement}.
   */
  private void recordLibraryReference(UriBasedDirective node, LibraryElement library) {
    if (library != null) {
      Location location = createLocationFromNode(node.getUri());
      recordRelationship(
          library.getDefiningCompilationUnit(),
          IndexConstants.IS_REFERENCED_BY,
          location);
    }
View Full Code Here

  /**
   * Record reference to the given operator {@link Element} and name.
   */
  private void recordOperatorReference(Token operator, Element element) {
    // prepare location
    Location location = createLocationFromToken(operator);
    // record name reference
    {
      String name = operator.getLexeme();
      if (name.equals("++")) {
        name = "+";
View Full Code Here

  public Location getLocation(AnalysisContext context, ElementCodec elementCodec) {
    Element element = elementCodec.decode(context, elementId);
    if (element == null) {
      return null;
    }
    return new Location(element, offset, length);
  }
View Full Code Here

      Element element = readElement();
      Relationship relationship = readRelationship();
      // read Location(s)
      int numLocations = dis.readInt();
      for (int j = 0; j < numLocations; j++) {
        Location location = readLocation();
        impl.recordRelationship(element, relationship, location);
      }
    }
  }
View Full Code Here

  private Location readLocation() throws IOException {
    Element locationElement = readElement();
    int offset = dis.readInt();
    int length = dis.readInt();
    return new Location(locationElement, offset, length);
  }
View Full Code Here

TOP

Related Classes of com.google.dart.engine.index.Location

Copyright © 2018 www.massapicom. 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.