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 f1bdf14b840600492fd467ec30f3fed5f9b32f6d..bd9d6073a4e1fdbb47b08b8265047cec6c4721e8 100644 |
--- a/pkg/analysis_server/lib/src/domain_analysis.dart |
+++ b/pkg/analysis_server/lib/src/domain_analysis.dart |
@@ -175,8 +175,9 @@ class AnalysisDomainHandler implements RequestHandler { |
if (pair.context == null || pair.source == null) { |
return new Response.getReachableSourcesInvalidFile(request); |
} |
- Map<String, List<String>> sources = new ReachableSourceCollector( |
- pair.source, pair.context).collectSources(); |
+ Map<String, List<String>> sources = |
+ new ReachableSourceCollector(pair.source, pair.context) |
+ .collectSources(); |
return new AnalysisGetReachableSourcesResult(sources) |
.toResponse(request.id); |
} |
@@ -245,9 +246,22 @@ class AnalysisDomainHandler implements RequestHandler { |
*/ |
Response setAnalysisRoots(Request request) { |
var params = new AnalysisSetAnalysisRootsParams.fromRequest(request); |
+ List<String> includedPathList = params.included; |
+ List<String> excludedPathList = params.excluded; |
+ // validate |
+ for (String path in includedPathList) { |
+ if (!server.isValidFilePath(path)) { |
+ return new Response.invalidFilePathFormat(request, path); |
+ } |
+ } |
+ for (String path in excludedPathList) { |
+ if (!server.isValidFilePath(path)) { |
+ return new Response.invalidFilePathFormat(request, path); |
+ } |
+ } |
// continue in server |
- server.setAnalysisRoots(request.id, params.included, params.excluded, |
- params.packageRoots == null ? {} : params.packageRoots); |
+ server.setAnalysisRoots(request.id, includedPathList, excludedPathList, |
+ params.packageRoots ?? <String, String>{}); |
return new AnalysisSetAnalysisRootsResult().toResponse(request.id); |
} |
@@ -347,8 +361,8 @@ class AnalysisDomainHandler implements RequestHandler { |
class AnalysisDomainImpl implements AnalysisDomain { |
final AnalysisServer server; |
- final Map<ResultDescriptor, |
- StreamController<engine.ComputedResult>> controllers = |
+ final Map<ResultDescriptor, StreamController<engine.ComputedResult>> |
+ controllers = |
<ResultDescriptor, StreamController<engine.ComputedResult>>{}; |
AnalysisDomainImpl(this.server) { |