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

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

Issue 1412683002: Add an experimental domain (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Clean up registration Created 5 years, 2 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 | « no previous file | pkg/analysis_server/lib/src/plugin/server_plugin.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ }
+}
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/plugin/server_plugin.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698