Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/index/impl/InMemoryIndex.java

Issue 10391092: Update analysis server and indexer (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/index/impl/InMemoryIndex.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/index/impl/InMemoryIndex.java (revision 7590)
+++ editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/index/impl/InMemoryIndex.java (working copy)
@@ -197,14 +197,10 @@
*/
public void indexResource(File libraryFile, File sourceFile, DartUnit dartUnit)
throws DartModelException {
- EditorLibraryManager libraryManager = SystemLibraryManagerProvider.getSystemLibraryManager();
// Get the LibrarySource
- URI fileUri = libraryFile.toURI();
- URI shortUri = libraryManager.getShortUri(fileUri);
- URI libUri = shortUri != null ? shortUri : fileUri;
- LibrarySource librarySource = new UrlLibrarySource(libUri, libraryManager);
+ LibrarySource librarySource = dartUnit.getLibrary().getSource();
// Get the DartLibrary
@@ -226,22 +222,24 @@
// Get the CompilationUnit
+ DartSource unitSource = (DartSource) dartUnit.getSourceInfo().getSource();
CompilationUnit compilationUnit;
IResource res = ResourceUtil.getResource(sourceFile);
if (res != null) {
- compilationUnit = new CompilationUnitImpl(
- library,
- (IFile) res,
- DefaultWorkingCopyOwner.getInstance());
+ DefaultWorkingCopyOwner workingCopy = DefaultWorkingCopyOwner.getInstance();
+ compilationUnit = new CompilationUnitImpl(library, (IFile) res, workingCopy);
} else {
- DartSource unitSource = (DartSource) dartUnit.getSourceInfo().getSource();
- compilationUnit = new ExternalCompilationUnitImpl(
- library,
- unitSource.getRelativePath(),
- unitSource);
+ String relPath = unitSource.getRelativePath();
+ compilationUnit = new ExternalCompilationUnitImpl(library, relPath, unitSource);
}
- Resource indexResource = ResourceFactory.getResource(compilationUnit);
+ URI unitUri = unitSource.getUri();
+ Resource indexResource;
Brian Wilkerson 2012/05/14 14:19:58 nit: Perhaps "resource" would be a better variable
danrubel 2012/05/16 04:26:36 Good point, but I named it such to remind myself t
+ if (SystemLibraryManager.isDartUri(unitUri)) {
+ indexResource = new Resource(unitUri.toString());
+ } else {
+ indexResource = ResourceFactory.getResource(compilationUnit);
+ }
indexResource(indexResource, compilationUnit, dartUnit);
}

Powered by Google App Engine
This is Rietveld 408576698