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

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

Issue 553193002: Implement "analysis.reanalyze" in analysis server. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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_manager.dart
diff --git a/pkg/analysis_server/lib/src/context_manager.dart b/pkg/analysis_server/lib/src/context_manager.dart
index 4a7ceeda116d9127319550d63cae780680356aea..582d07c7d733a24dac2d200c60959fc2ad2f751b 100644
--- a/pkg/analysis_server/lib/src/context_manager.dart
+++ b/pkg/analysis_server/lib/src/context_manager.dart
@@ -100,6 +100,28 @@ abstract class ContextManager {
void removeContext(Folder folder);
/**
+ * Rebuild the set of contexts from scratch based on the data last sent to
+ * setRoots().
+ */
+ void refresh() {
+ List<Folder> contextFolders = _contexts.keys.toList();
+ // destroy old contexts
+ contextFolders.forEach(_destroyContext);
+ // create new contexts, but skip any that are contained inside a parent
+ // context (those will be automatically created upon creation of the
+ // parent).
+ for (Folder newFolder in contextFolders) {
scheglov 2014/09/10 01:55:54 With this implementation we trust that we have a v
Paul Berry 2014/09/10 18:26:12 Fair enough. I've reworked things so that we acco
+ bool insideAnotherFolder = contextFolders.any((folder) {
+ return folder.path != newFolder.path &&
+ folder.isOrContains(newFolder.path);
scheglov 2014/09/10 01:55:54 Will folder.contains(newFolder.path) replace both
Paul Berry 2014/09/10 18:26:11 Acknowledged. This code is gone now.
+ });
+ if (!insideAnotherFolder) {
+ _createContexts(newFolder, false);
+ }
+ }
+ }
+
+ /**
* Change the set of paths which should be used as starting points to
* determine the context directories.
*/

Powered by Google App Engine
This is Rietveld 408576698