OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | |
2 // for details. All rights reserved. Use of this source code is governed by a | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 library src.domain_experimental; | |
6 | |
7 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
| |
8 | |
9 import 'package:analysis_server/plugin/protocol/protocol.dart'; | |
10 import 'package:analysis_server/src/analysis_server.dart'; | |
11 | |
12 /** | |
13 * Instances of the class [ExperimentalDomainHandler] implement a | |
14 * [RequestHandler] that handles requests in the `experimental` domain. | |
15 */ | |
16 class ExperimentalDomainHandler implements RequestHandler { | |
17 /** | |
18 * The analysis server that is using this handler to process requests. | |
19 */ | |
20 final AnalysisServer server; | |
21 | |
22 /** | |
23 * The name of the request used to get diagnostic information. | |
24 */ | |
25 static const String EXPERIMENTAL_DIAGNOSTICS = 'experimental.diagnostics'; | |
26 | |
27 /** | |
28 * Initialize a newly created handler to handle requests for the given [server ]. | |
29 */ | |
30 ExperimentalDomainHandler(this.server); | |
31 | |
32 @override | |
33 Response handleRequest(Request request) { | |
34 try { | |
35 String requestName = request.method; | |
36 if (requestName == EXPERIMENTAL_DIAGNOSTICS) { | |
37 return computeDiagnostics(request); | |
38 } | |
39 } on RequestFailure catch (exception) { | |
40 return exception.response; | |
41 } | |
42 return null; | |
43 } | |
44 | |
45 /** | |
46 * Implement the `experimental.diagnostics` request. | |
47 */ | |
48 Response computeDiagnostics(Request request) { | |
49 return new Response.unknownRequest(request); | |
50 } | |
51 } | |
OLD | NEW |