| Index: pkg/analysis_server/lib/src/domain_completion.dart
|
| diff --git a/pkg/analysis_server/lib/src/domain_completion.dart b/pkg/analysis_server/lib/src/domain_completion.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..cfb68816f08d527981782108833269ba6b7f5f9d
|
| --- /dev/null
|
| +++ b/pkg/analysis_server/lib/src/domain_completion.dart
|
| @@ -0,0 +1,49 @@
|
| +// Copyright (c) 2014, 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 domain.completion;
|
| +
|
| +import 'package:analysis_server/src/analysis_server.dart';
|
| +import 'package:analysis_server/src/constants.dart';
|
| +import 'package:analysis_server/src/protocol.dart';
|
| +
|
| +/**
|
| + * Instances of the class [CompletionDomainHandler] implement a [RequestHandler]
|
| + * that handles requests in the search domain.
|
| + */
|
| +class CompletionDomainHandler implements RequestHandler {
|
| + /**
|
| + * The analysis server that is using this handler to process requests.
|
| + */
|
| + final AnalysisServer server;
|
| +
|
| + /**
|
| + * Initialize a newly created handler to handle requests for the given [server].
|
| + */
|
| + CompletionDomainHandler(this.server);
|
| +
|
| + @override
|
| + Response handleRequest(Request request) {
|
| + try {
|
| + String requestName = request.method;
|
| + if (requestName == COMPLETION_GET_SUGGESTIONS) {
|
| + return getSuggestions(request);
|
| + }
|
| + } on RequestFailure catch (exception) {
|
| + return exception.response;
|
| + }
|
| + return null;
|
| + }
|
| +
|
| + Response getSuggestions(Request request) {
|
| + // file
|
| + RequestDatum fileDatum = request.getRequiredParameter(FILE);
|
| + String file = fileDatum.asString();
|
| + // offset
|
| + RequestDatum offsetDatum = request.getRequiredParameter(OFFSET);
|
| + int offset = offsetDatum.asInt();
|
| + // TODO(brianwilkerson) implement
|
| + return null;
|
| + }
|
| +}
|
|
|