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

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

Issue 11884046: change the way we find package name from pubspec.yaml file (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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/utilities/yaml/PubYamlUtils.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/DartProjectImpl.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/DartProjectImpl.java (revision 17022)
+++ editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/model/DartProjectImpl.java (working copy)
@@ -606,15 +606,10 @@
((DartProjectInfo) getElementInfo()).setLinkedPackageDirName(null);
IResource pubspec = project.findMember(DartCore.PUBSPEC_FILE_NAME);
if (pubspec != null) {
- Map<String, Object> pubMap = PubYamlUtils.parsePubspecYamlToMap(IFileUtilities.getContents((IFile) pubspec));
- if (pubMap != null) {
- for (String key : pubMap.keySet()) {
- if (key.equals("name")) {
- ((DartProjectInfo) getElementInfo()).setLinkedPackageDirName((String) pubMap.get(key));
- return;
- }
- }
- }
+ String name = PubYamlUtils.getPubspecName(IFileUtilities.getContents((IFile) pubspec));
+ if (name != null){
+ ((DartProjectInfo) getElementInfo()).setLinkedPackageDirName(name);
+ }
}
} catch (Exception exception) {
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/utilities/yaml/PubYamlUtils.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698