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

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: Rebuild contexts by calling setRoot 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
« no previous file with comments | « pkg/analysis_server/lib/src/constants.dart ('k') | pkg/analysis_server/lib/src/domain_analysis.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c46d214b445349aeace40d976e0c4a195ad0895f 100644
--- a/pkg/analysis_server/lib/src/context_manager.dart
+++ b/pkg/analysis_server/lib/src/context_manager.dart
@@ -49,11 +49,18 @@ abstract class ContextManager {
pathos.Context pathContext;
/**
- * A list of excluded paths - folders and files.
+ * The list of excluded paths (folders and files) most recently passed to
+ * [setRoots].
*/
List<String> excludedPaths = <String>[];
/**
+ * The list of included paths (folders and files) most recently passed to
+ * [setRoots].
+ */
+ List<String> includedPaths = <String>[];
scheglov 2014/09/10 18:37:50 I'd put "included" before "exclude", as we do in s
+
+ /**
* Provider which is used to determine the mapping from package name to
* package folder.
*/
@@ -100,6 +107,19 @@ abstract class ContextManager {
void removeContext(Folder folder);
/**
+ * Rebuild the set of contexts from scratch based on the data last sent to
+ * setRoots().
+ */
+ void refresh() {
+ // Destroy old contexts
+ List<Folder> contextFolders = _contexts.keys.toList();
+ contextFolders.forEach(_destroyContext);
+
+ // Rebuild contexts based on the data last sent to setRoots().
+ setRoots(includedPaths, excludedPaths);
+ }
+
+ /**
* Change the set of paths which should be used as starting points to
* determine the context directories.
*/
@@ -119,6 +139,7 @@ abstract class ContextManager {
'Only support for folder analysis is implemented currently.');
}
}
+ this.includedPaths = includedPaths;
// excluded
List<String> oldExcludedPaths = this.excludedPaths;
this.excludedPaths = excludedPaths;
« no previous file with comments | « pkg/analysis_server/lib/src/constants.dart ('k') | pkg/analysis_server/lib/src/domain_analysis.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698