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

Unified Diff: pkg/analysis_server/test/integration/integration_test_methods.dart

Issue 1491013002: Analysis request `getReachableSources` (#24893). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: spec_bump Created 5 years 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/test/integration/integration_test_methods.dart
diff --git a/pkg/analysis_server/test/integration/integration_test_methods.dart b/pkg/analysis_server/test/integration/integration_test_methods.dart
index 24933ef92f1fe5d4c8023c45f9be33690aadf553..af165f2a46399280a71b8df92d8a2595b04c0139 100644
--- a/pkg/analysis_server/test/integration/integration_test_methods.dart
+++ b/pkg/analysis_server/test/integration/integration_test_methods.dart
@@ -238,6 +238,41 @@ abstract class IntegrationTestMixin {
}
/**
+ * Return the transitive closure of reachable sources for a given file.
+ *
+ * If a request is made for a file which does not exist, or which is not
+ * currently subject to analysis (e.g. because it is not associated with any
+ * analysis root specified to analysis.setAnalysisRoots), an error of type
+ * GET_REACHABLE_SOURCES_INVALID_FILE will be generated.
+ *
+ * Parameters
+ *
+ * file ( FilePath )
+ *
+ * The file for which reachable source information is being requested.
+ *
+ * Returns
+ *
+ * sources ( Map<String, List<String>> )
+ *
+ * A mapping from source URIs to directly reachable source URIs. For
+ * example, a file "foo.dart" that imports "bar.dart" would have the
+ * corresponding mapping { "file:///foo.dart" : ["file:///bar.dart"] }. If
+ * "bar.dart" has further imports (or exports) there will be a mapping from
+ * the URI "file:///bar.dart" to them. To check if a specific URI is
+ * reachable from a given file, clients can check for its presence in the
+ * resulting key set.
+ */
+ Future<AnalysisGetReachableSourcesResult> sendAnalysisGetReachableSources(String file) {
+ var params = new AnalysisGetReachableSourcesParams(file).toJson();
+ return server.send("analysis.getReachableSources", params)
+ .then((result) {
+ ResponseDecoder decoder = new ResponseDecoder(null);
+ return new AnalysisGetReachableSourcesResult.fromJson(decoder, 'result', result);
+ });
+ }
+
+ /**
* Return library dependency information for use in client-side indexing and
* package URI resolution.
*
« no previous file with comments | « pkg/analysis_server/test/domain_analysis_test.dart ('k') | pkg/analysis_server/test/integration/protocol_matchers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698