Examples of SourceEntry


Examples of com.google.dart.engine.internal.cache.SourceEntry

//        logInformation("Added Dart sources, invalidating all resolution information");
        ArrayList<Source> sourcesToInvalidate = new ArrayList<Source>();
        MapIterator<Source, SourceEntry> iterator = cache.iterator();
        while (iterator.moveNext()) {
          Source source = iterator.getKey();
          SourceEntry sourceEntry = iterator.getValue();
          if (!source.isInSystemLibrary()
              && (sourceEntry instanceof DartEntry || sourceEntry instanceof HtmlEntry)) {
            sourcesToInvalidate.add(source);
          }
        }
        int count = sourcesToInvalidate.size();
        for (int i = 0; i < count; i++) {
          Source source = sourcesToInvalidate.get(i);
          SourceEntry entry = getReadableSourceEntry(source);
          if (entry instanceof DartEntry) {
            DartEntry dartEntry = (DartEntry) entry;
            DartEntryImpl dartCopy = dartEntry.getWritableCopy();
            dartCopy.invalidateAllResolutionInformation(false);
            cache.put(source, dartCopy);
View Full Code Here

Examples of com.google.dart.engine.internal.cache.SourceEntry

  }

  @Override
  public AnalysisError[] computeErrors(Source source) throws AnalysisException {
    boolean enableHints = options.getHint();
    SourceEntry sourceEntry = getReadableSourceEntry(source);
    if (sourceEntry instanceof DartEntry) {
      ArrayList<AnalysisError> errors = new ArrayList<AnalysisError>();
      try {
        DartEntry dartEntry = (DartEntry) sourceEntry;
        ListUtilities.addAll(errors, getDartScanData(source, dartEntry, DartEntry.SCAN_ERRORS));
View Full Code Here

Examples of com.google.dart.engine.internal.cache.SourceEntry

    return getDartParseData(source, DartEntry.IMPORTED_LIBRARIES, Source.EMPTY_ARRAY);
  }

  @Override
  public SourceKind computeKindOf(Source source) {
    SourceEntry sourceEntry = getReadableSourceEntry(source);
    if (sourceEntry == null) {
      return SourceKind.UNKNOWN;
    } else if (sourceEntry instanceof DartEntry) {
      try {
        return getDartParseData(source, (DartEntry) sourceEntry, DartEntry.SOURCE_KIND);
      } catch (AnalysisException exception) {
        return SourceKind.UNKNOWN;
      }
    }
    return sourceEntry.getKind();
  }
View Full Code Here

Examples of com.google.dart.engine.internal.cache.SourceEntry

    return getDartResolutionData(source, source, DartEntry.ELEMENT, null);
  }

  @Override
  public LineInfo computeLineInfo(Source source) throws AnalysisException {
    SourceEntry sourceEntry = getReadableSourceEntry(source);
    try {
      if (sourceEntry instanceof HtmlEntry) {
        return getHtmlParseData(source, SourceEntry.LINE_INFO, null);
      } else if (sourceEntry instanceof DartEntry) {
        return getDartScanData(source, SourceEntry.LINE_INFO, null);
View Full Code Here

Examples of com.google.dart.engine.internal.cache.SourceEntry

    synchronized (cacheLock) {
      // Move sources in the specified directory to the new context
      MapIterator<Source, SourceEntry> iterator = cache.iterator();
      while (iterator.moveNext()) {
        Source source = iterator.getKey();
        SourceEntry sourceEntry = iterator.getValue();
        if (container.contains(source)) {
          sourcesToRemove.add(source);
          newContext.addSourceInfo(source, sourceEntry.getWritableCopy());
        }
      }

      // TODO (danrubel): Either remove sources or adjust contract described in AnalysisContext.
      // Currently, callers assume that sources have been removed from this context
View Full Code Here

Examples of com.google.dart.engine.internal.cache.SourceEntry

    return options;
  }

  @Override
  public AngularApplication getAngularApplicationWithHtml(Source htmlSource) {
    SourceEntry sourceEntry = getReadableSourceEntryOrNull(htmlSource);
    if (sourceEntry instanceof HtmlEntry) {
      HtmlEntry htmlEntry = (HtmlEntry) sourceEntry;
      AngularApplication application = htmlEntry.getValue(HtmlEntry.ANGULAR_APPLICATION);
      if (application != null) {
        return application;
View Full Code Here

Examples of com.google.dart.engine.internal.cache.SourceEntry

    return null;
  }

  @Override
  public AnalysisErrorInfo getErrors(Source source) {
    SourceEntry sourceEntry = getReadableSourceEntryOrNull(source);
    if (sourceEntry instanceof DartEntry) {
      DartEntry dartEntry = (DartEntry) sourceEntry;
      return new AnalysisErrorInfoImpl(
          dartEntry.getAllErrors(),
          dartEntry.getValue(SourceEntry.LINE_INFO));
View Full Code Here

Examples of com.google.dart.engine.internal.cache.SourceEntry

    return new AnalysisErrorInfoImpl(AnalysisError.NO_ERRORS, null);
  }

  @Override
  public HtmlElement getHtmlElement(Source source) {
    SourceEntry sourceEntry = getReadableSourceEntryOrNull(source);
    if (sourceEntry instanceof HtmlEntry) {
      return ((HtmlEntry) sourceEntry).getValue(HtmlEntry.ELEMENT);
    }
    return null;
  }
View Full Code Here

Examples of com.google.dart.engine.internal.cache.SourceEntry

      switch (sourceKind) {
        case LIBRARY:
        default:
          MapIterator<Source, SourceEntry> iterator = cache.iterator();
          while (iterator.moveNext()) {
            SourceEntry sourceEntry = iterator.getValue();
            if (sourceEntry.getKind() == SourceKind.HTML) {
              Source[] referencedLibraries = ((HtmlEntry) sourceEntry).getValue(HtmlEntry.REFERENCED_LIBRARIES);
              if (contains(referencedLibraries, source)) {
                htmlSources.add(iterator.getKey());
              }
            }
          }
          break;
        case PART:
          Source[] librarySources = getLibrariesContaining(source);
          MapIterator<Source, SourceEntry> partIterator = cache.iterator();
          while (partIterator.moveNext()) {
            SourceEntry sourceEntry = partIterator.getValue();
            if (sourceEntry.getKind() == SourceKind.HTML) {
              Source[] referencedLibraries = ((HtmlEntry) sourceEntry).getValue(HtmlEntry.REFERENCED_LIBRARIES);
              if (containsAny(referencedLibraries, librarySources)) {
                htmlSources.add(partIterator.getKey());
              }
            }
View Full Code Here

Examples of com.google.dart.engine.internal.cache.SourceEntry

    return getSources(SourceKind.HTML);
  }

  @Override
  public SourceKind getKindOf(Source source) {
    SourceEntry sourceEntry = getReadableSourceEntryOrNull(source);
    if (sourceEntry == null) {
      return SourceKind.UNKNOWN;
    }
    return sourceEntry.getKind();
  }
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.