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

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

Issue 1047733004: Support refresh of individual analysis roots (issue 22254) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address more comments Created 5 years, 9 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/domain_analysis.dart
diff --git a/pkg/analysis_server/lib/src/domain_analysis.dart b/pkg/analysis_server/lib/src/domain_analysis.dart
index 5b461079773318456229eaf979e910950662b165..4a3d28f0bdb42be464ad21cca9b63b3d628a850a 100644
--- a/pkg/analysis_server/lib/src/domain_analysis.dart
+++ b/pkg/analysis_server/lib/src/domain_analysis.dart
@@ -11,6 +11,7 @@ import 'package:analysis_server/src/computer/computer_hover.dart';
import 'package:analysis_server/src/constants.dart';
import 'package:analysis_server/src/protocol_server.dart';
import 'package:analysis_server/src/services/dependencies/library_dependencies.dart';
+import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/engine.dart' as engine;
@@ -136,7 +137,23 @@ class AnalysisDomainHandler implements RequestHandler {
* Implement the 'analysis.reanalyze' request.
*/
Response reanalyze(Request request) {
- server.reanalyze();
+ AnalysisReanalyzeParams params =
+ new AnalysisReanalyzeParams.fromRequest(request);
+ List<String> roots = params.roots;
+ if (roots == null || roots.isNotEmpty) {
+ List<String> includedPaths = server.contextDirectoryManager.includedPaths;
+ List<Resource> rootResources = null;
+ if (roots != null) {
+ rootResources = <Resource>[];
+ for (String rootPath in roots) {
+ if (!includedPaths.contains(rootPath)) {
+ return new Response.invalidAnalysisRoot(request, rootPath);
+ }
+ rootResources.add(server.resourceProvider.getResource(rootPath));
+ }
+ }
+ server.reanalyze(rootResources);
+ }
return new AnalysisReanalyzeResult().toResponse(request.id);
}
« no previous file with comments | « pkg/analysis_server/lib/src/context_manager.dart ('k') | pkg/analysis_server/lib/src/generated_protocol.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698