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

Unified Diff: pkg/analysis_server/lib/src/context_directory_manager.dart

Issue 353453004: Remove dead code for tracking pubspec.yaml files. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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: pkg/analysis_server/lib/src/context_directory_manager.dart
diff --git a/pkg/analysis_server/lib/src/context_directory_manager.dart b/pkg/analysis_server/lib/src/context_directory_manager.dart
index 1371c0aa83e46d520fcc69103985cc7ba163be2e..9fc3c925838febc8d994988bbf7995680936ac9e 100644
--- a/pkg/analysis_server/lib/src/context_directory_manager.dart
+++ b/pkg/analysis_server/lib/src/context_directory_manager.dart
@@ -27,17 +27,6 @@ class _ContextDirectoryInfo {
* added to the context.
*/
Map<String, Source> sources = new HashMap<String, Source>();
-
- /**
- * Pubspec file for this context, if there is one. Otherwise null.
- */
- File pubspecFile = null;
-
- /**
- * Path to that the pubspec file for this context would have, if it has one.
- * Otherwise path that the pubspec file would have.
- */
- String pubspecPath;
}
/**
@@ -115,11 +104,7 @@ abstract class ContextDirectoryManager {
_handleWatchEvent(folder, info, event);
});
File pubspecFile = folder.getChild(PUBSPEC_NAME);
- info.pubspecPath = pubspecFile.path;
- if (pubspecFile.exists) {
- info.pubspecFile = pubspecFile;
- }
- addContext(folder, info.pubspecFile);
+ addContext(folder);
ChangeSet changeSet = new ChangeSet();
_addSourceFiles(changeSet, folder, info);
applyChangesToContext(folder, changeSet);
@@ -142,14 +127,6 @@ abstract class ContextDirectoryManager {
// there is a pubspec.yaml?
break;
}
- if (info.pubspecFile == null && event.path == info.pubspecPath) {
- // Pubspec file added. This is likely to be such a rare event that
- // there's no need to try to be clever. Just destroy the old context
- // and create a new one.
- _destroyContext(folder);
- _createContext(folder);
- return;
- }
if (_shouldFileBeAnalyzed(event.path)) {
ChangeSet changeSet = new ChangeSet();
Resource resource = resourceProvider.getResource(event.path);
@@ -166,15 +143,6 @@ abstract class ContextDirectoryManager {
}
break;
case ChangeType.REMOVE:
- if (info.pubspecFile != null && event.path == info.pubspecPath) {
- // Pubspec file removed. This is likely to be such a rare event that
- // there's no need to try to be clever. Just destroy the old context
- // and create a new one.
- _destroyContext(folder);
- _createContext(folder);
- return;
- }
- // TODO(paulberry): handle removing pubspec.yaml
Source source = info.sources[event.path];
if (source != null) {
ChangeSet changeSet = new ChangeSet();
@@ -238,11 +206,9 @@ abstract class ContextDirectoryManager {
}
/**
- * Called when a new context needs to be created. If the context is
- * associated with a pubspec file, that file is passed in [pubspecFile];
- * otherwise it is null.
+ * Called when a new context needs to be created.
*/
- void addContext(Folder folder, File pubspecFile);
+ void addContext(Folder folder);
/**
* Called when the set of files associated with a context have changed (or
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/test/context_directory_manager_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698