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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/DartLibraryImpl.java

Issue 8387002: Fix for the DeltaProcessing event when a user changes a library name, inside of a #library(..). I... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 2 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
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/delta/CachedDirectives.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/DartLibraryImpl.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/DartLibraryImpl.java (revision 651)
+++ editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/DartLibraryImpl.java (working copy)
@@ -80,28 +80,6 @@
public static final DartLibraryImpl[] EMPTY_LIBRARY_ARRAY = new DartLibraryImpl[0];
/**
- * The file containing the definition of this library.
- */
- private IFile libraryFile;
-
- /**
- * The structured representation of the library file that defines this library.
- */
- private LibrarySource sourceFile;
-
- /**
- * An empty array of libraries.
- */
- public static final DartLibraryImpl[] EMPTY_ARRAY = new DartLibraryImpl[0];
-
- /**
- * The qualified name used to access the persistent property indicating whether the file
- * associated with the defining compilation unit defines a top-level library.
- */
- private static final QualifiedName TOP_LEVEL_PROPERTY_NAME = new QualifiedName(
- DartCore.PLUGIN_ID, "topLevel");
-
- /**
* Answer a library source for the specified file
*
* @param libraryFile the *.dart library configuration file
@@ -137,6 +115,28 @@
}
/**
+ * The file containing the definition of this library.
+ */
+ private IFile libraryFile;
+
+ /**
+ * The structured representation of the library file that defines this library.
+ */
+ private LibrarySource sourceFile;
+
+ /**
+ * An empty array of libraries.
+ */
+ public static final DartLibraryImpl[] EMPTY_ARRAY = new DartLibraryImpl[0];
+
+ /**
+ * The qualified name used to access the persistent property indicating whether the file
+ * associated with the defining compilation unit defines a top-level library.
+ */
+ private static final QualifiedName TOP_LEVEL_PROPERTY_NAME = new QualifiedName(
+ DartCore.PLUGIN_ID, "topLevel");
+
+ /**
* Initialize a newly created library to be contained in the given project.
*
* @param project the project containing this library
@@ -347,11 +347,7 @@
// If we cannot access the info we compute the name from the file name, just like we will if
// the library directive does not contain a literal.
}
- String name = new Path(getElementName()).lastSegment();
- if (name.endsWith(Extensions.DOT_DART)) {
- name = name.substring(0, name.length() - Extensions.DOT_DART.length());
- }
- return name;
+ return getImplicitLibraryName();
}
/**
@@ -378,6 +374,17 @@
return DartElement.LIBRARY;
}
+ /**
+ * This method is called when there is no Library directive to specify the name of a library.
+ */
+ public String getImplicitLibraryName() {
+ String name = new Path(getElementName()).lastSegment();
+ if (name.endsWith(Extensions.DOT_DART)) {
+ name = name.substring(0, name.length() - Extensions.DOT_DART.length());
+ }
+ return name;
+ }
+
@Override
public DartLibrary[] getImportedLibraries() throws DartModelException {
DartLibraryInfo elementInfo = (DartLibraryInfo) getElementInfo();
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/delta/CachedDirectives.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698