@Override public void perform() { File[] libraryFiles = server.getTrackedLibraryFiles(); ArrayList<File> todo = new ArrayList<File>(libraryFiles.length); // Analyze libraries in application directory hierarchies first for (File libFile : libraryFiles) { if (DartCore.getApplicationDirectory(libFile) != null) { server.queueSubTask(new AnalyzeLibraryTask(server, libFile, null)); } else { todo.add(libFile); } } // Then analyze all remaining libraries in the saved context for (File libFile : todo) { server.queueSubTask(new AnalyzeLibraryTask(server, libFile, null)); } }
@Override void perform() { // Parse library files boolean found = false; for (File libFile : server.getTrackedLibraryFiles()) { if (context.getCachedLibrary(libFile) == null) { server.queueSubTask(new ParseLibraryFileTask(server, context, libFile)); found = true; } } if (found) { server.queueSubTask(this); return; } // Analyze all libraries for (File libFile : server.getTrackedLibraryFiles()) { server.queueSubTask(new AnalyzeLibraryTask(server, context, libFile)); } }
@Override void perform() { // Parse the library file Library library = context.getCachedLibrary(libraryFile); if (library == null) { if (!libraryFile.exists()) { return; } server.queueSubTask(new ParseLibraryFileTask(server, context, libraryFile)); server.queueSubTask(this); return; } // Parse the files sourced by the library for (File file : library.getSourceFiles()) { if (library.getCachedUnit(file) == null && file.exists()) { server.queueSubTask(new ParseFileTask(server, context, libraryFile, file)); } } }
/** * Answer the absolute file for the specified URI * * @return the file or <code>null</code> if unknown */ static File toFile(AnalysisServer server, URI uri) { String scheme = uri.getScheme(); if (scheme == null || "file".equals(scheme)) { File file = new File(uri.getPath()); if (file.isAbsolute()) { return file; } DartCore.logError("Non absolute path: " + file); return null; } if (SystemLibraryManager.isDartUri(uri)) { URI resolveUri = server.getLibraryManager().resolveDartUri(uri); if (resolveUri == null) { DartCore.logError("Failed to resolve: " + uri); return null; } return new File(resolveUri.getPath()); } DartCore.logError("Unknown library scheme : " + uri); return null; }