Examples of DartEntry


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

   */
  private TimestampedData<CompilationUnit> getResolvedUnit(CompilationUnitElement element,
      Source librarySource) {
    SourceEntry sourceEntry = cache.get(element.getSource());
    if (sourceEntry instanceof DartEntry) {
      DartEntry dartEntry = (DartEntry) sourceEntry;
      if (dartEntry.getStateInLibrary(DartEntry.RESOLVED_UNIT, librarySource) == CacheState.VALID) {
        return new TimestampedData<CompilationUnit>(
            dartEntry.getModificationTime(),
            dartEntry.getValueInLibrary(DartEntry.RESOLVED_UNIT, librarySource));
      }
    }
    return null;
  }
View Full Code Here

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

   * @param sources the set to which sources should be added
   */
  private void getSourcesNeedingProcessing(Source source, SourceEntry sourceEntry,
      boolean isPriority, boolean hintsEnabled, HashSet<Source> sources) {
    if (sourceEntry instanceof DartEntry) {
      DartEntry dartEntry = (DartEntry) sourceEntry;
      CacheState scanErrorsState = dartEntry.getState(DartEntry.SCAN_ERRORS);
      if (scanErrorsState == CacheState.INVALID
          || (isPriority && scanErrorsState == CacheState.FLUSHED)) {
        sources.add(source);
        return;
      }
      CacheState parseErrorsState = dartEntry.getState(DartEntry.PARSE_ERRORS);
      if (parseErrorsState == CacheState.INVALID
          || (isPriority && parseErrorsState == CacheState.FLUSHED)) {
        sources.add(source);
        return;
      }
      if (isPriority) {
        if (!dartEntry.hasResolvableCompilationUnit()) {
          sources.add(source);
          return;
        }
      }
      for (Source librarySource : getLibrariesContaining(source)) {
        SourceEntry libraryEntry = cache.get(librarySource);
        if (libraryEntry instanceof DartEntry) {
          CacheState elementState = libraryEntry.getState(DartEntry.ELEMENT);
          if (elementState == CacheState.INVALID
              || (isPriority && elementState == CacheState.FLUSHED)) {
            sources.add(source);
            return;
          }
          CacheState resolvedUnitState = dartEntry.getStateInLibrary(
              DartEntry.RESOLVED_UNIT,
              librarySource);
          if (resolvedUnitState == CacheState.INVALID
              || (isPriority && resolvedUnitState == CacheState.FLUSHED)) {
            LibraryElement libraryElement = libraryEntry.getValue(DartEntry.ELEMENT);
            if (libraryElement != null) {
              sources.add(source);
              return;
            }
          }
          if (generateSdkErrors || !source.isInSystemLibrary()) {
            CacheState verificationErrorsState = dartEntry.getStateInLibrary(
                DartEntry.VERIFICATION_ERRORS,
                librarySource);
            if (verificationErrorsState == CacheState.INVALID
                || (isPriority && verificationErrorsState == CacheState.FLUSHED)) {
              LibraryElement libraryElement = libraryEntry.getValue(DartEntry.ELEMENT);
              if (libraryElement != null) {
                sources.add(source);
                return;
              }
            }
            if (hintsEnabled) {
              CacheState hintsState = dartEntry.getStateInLibrary(DartEntry.HINTS, librarySource);
              if (hintsState == CacheState.INVALID
                  || (isPriority && hintsState == CacheState.FLUSHED)) {
                LibraryElement libraryElement = libraryEntry.getValue(DartEntry.ELEMENT);
                if (libraryElement != null) {
                  sources.add(source);
View Full Code Here

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

        HtmlEntryImpl htmlCopy = ((HtmlEntry) sourceEntry).getWritableCopy();
        htmlCopy.invalidateAllResolutionInformation(invalidateUris);
        iterator.setValue(htmlCopy);
        workManager.add(source, SourcePriority.HTML);
      } else if (sourceEntry instanceof DartEntry) {
        DartEntry dartEntry = (DartEntry) sourceEntry;
        oldPartMap.put(source, dartEntry.getValue(DartEntry.INCLUDED_PARTS));
        DartEntryImpl dartCopy = dartEntry.getWritableCopy();
        dartCopy.invalidateAllResolutionInformation(invalidateUris);
        iterator.setValue(dartCopy);
        workManager.add(source, computePriority(dartCopy));
      }
    }
View Full Code Here

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

      }
    }
    // reset Dart sources
    Source[] oldElementSources = application.getElementSources();
    for (Source elementSource : oldElementSources) {
      DartEntry dartEntry = getReadableDartEntry(elementSource);
      DartEntryImpl dartCopy = dartEntry.getWritableCopy();
      dartCopy.setValue(DartEntry.ANGULAR_ERRORS, AnalysisError.NO_ERRORS);
      cache.put(elementSource, dartCopy);
      // notify about (disappeared) Angular errors
      ChangeNoticeImpl notice = getNotice(elementSource);
      notice.setErrors(dartCopy.getAllErrors(), dartEntry.getValue(SourceEntry.LINE_INFO));
    }
  }
View Full Code Here

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

   */
  private void invalidateLibraryResolution(Source librarySource) {
    // TODO(brianwilkerson) This could be optimized. There's no need to flush all of these entries
    // if the public namespace hasn't changed, which will be a fairly common case. The question is
    // whether we can afford the time to compute the namespace to look for differences.
    DartEntry libraryEntry = getReadableDartEntry(librarySource);
    if (libraryEntry != null) {
      Source[] includedParts = libraryEntry.getValue(DartEntry.INCLUDED_PARTS);
      DartEntryImpl libraryCopy = libraryEntry.getWritableCopy();
      libraryCopy.invalidateAllResolutionInformation(false);
      cache.put(librarySource, libraryCopy);
      workManager.add(librarySource, SourcePriority.LIBRARY);
      for (Source partSource : includedParts) {
        SourceEntry partEntry = cache.get(partSource);
View Full Code Here

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

        }
      }
      // update Dart sources errors
      Source[] newElementSources = application.getElementSources();
      for (Source elementSource : newElementSources) {
        DartEntry dartEntry = getReadableDartEntry(elementSource);
        DartEntryImpl dartCopy = dartEntry.getWritableCopy();
        dartCopy.setValue(DartEntry.ANGULAR_ERRORS, task.getErrors(elementSource));
        cache.put(elementSource, dartCopy);
        // notify about Dart errors
        ChangeNoticeImpl notice = getNotice(elementSource);
        notice.setErrors(dartCopy.getAllErrors(), computeLineInfo(elementSource));
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.