Index: pkg/analysis_server/lib/src/domain_experimental.dart |
diff --git a/pkg/analysis_server/lib/src/domain_experimental.dart b/pkg/analysis_server/lib/src/domain_experimental.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..43631f2481795ce2a1a53c8dc33925c139f8e83b |
--- /dev/null |
+++ b/pkg/analysis_server/lib/src/domain_experimental.dart |
@@ -0,0 +1,51 @@ |
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
+// for details. All rights reserved. Use of this source code is governed by a |
+// BSD-style license that can be found in the LICENSE file. |
+ |
+library src.domain_experimental; |
+ |
+import 'dart:core' hide Resource; |
pquitslund
2015/10/16 19:34:22
Every time I see this I cry a little.
scheglov
2015/10/16 20:08:50
It'll go soon.
/**
* DEPRECATED. A resource that
|
+ |
+import 'package:analysis_server/plugin/protocol/protocol.dart'; |
+import 'package:analysis_server/src/analysis_server.dart'; |
+ |
+/** |
+ * Instances of the class [ExperimentalDomainHandler] implement a |
+ * [RequestHandler] that handles requests in the `experimental` domain. |
+ */ |
+class ExperimentalDomainHandler implements RequestHandler { |
+ /** |
+ * The analysis server that is using this handler to process requests. |
+ */ |
+ final AnalysisServer server; |
+ |
+ /** |
+ * The name of the request used to get diagnostic information. |
+ */ |
+ static const String EXPERIMENTAL_DIAGNOSTICS = 'experimental.diagnostics'; |
+ |
+ /** |
+ * Initialize a newly created handler to handle requests for the given [server]. |
+ */ |
+ ExperimentalDomainHandler(this.server); |
+ |
+ @override |
+ Response handleRequest(Request request) { |
+ try { |
+ String requestName = request.method; |
+ if (requestName == EXPERIMENTAL_DIAGNOSTICS) { |
+ return computeDiagnostics(request); |
+ } |
+ } on RequestFailure catch (exception) { |
+ return exception.response; |
+ } |
+ return null; |
+ } |
+ |
+ /** |
+ * Implement the `experimental.diagnostics` request. |
+ */ |
+ Response computeDiagnostics(Request request) { |
+ return new Response.unknownRequest(request); |
+ } |
+} |