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

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

Issue 337943002: Adjust server for API changes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed bug Created 6 years, 6 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 | « pkg/analysis_server/lib/src/domain_analysis.dart ('k') | pkg/analysis_server/lib/src/domain_edit.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_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;
+ }
+}
« no previous file with comments | « pkg/analysis_server/lib/src/domain_analysis.dart ('k') | pkg/analysis_server/lib/src/domain_edit.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698