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

Side by Side Diff: pkg/analysis_server/lib/src/domain_completion.dart

Issue 2465923002: Integration of the new analysis driver, behind a flag. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library domain.completion; 5 library domain.completion;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/plugin/protocol/protocol.dart'; 9 import 'package:analysis_server/plugin/protocol/protocol.dart';
10 import 'package:analysis_server/src/analysis_server.dart'; 10 import 'package:analysis_server/src/analysis_server.dart';
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // TODO (danrubel) if request is obsolete 95 // TODO (danrubel) if request is obsolete
96 // (processAnalysisRequest returns false) 96 // (processAnalysisRequest returns false)
97 // then send empty results 97 // then send empty results
98 98
99 return new CompletionResult( 99 return new CompletionResult(
100 request.replacementOffset, request.replacementLength, suggestions); 100 request.replacementOffset, request.replacementLength, suggestions);
101 } 101 }
102 102
103 @override 103 @override
104 Response handleRequest(Request request) { 104 Response handleRequest(Request request) {
105 if (server.options.enableNewAnalysisDriver) {
106 // TODO(scheglov) implement for the new analysis driver
107 return new CompletionGetSuggestionsResult('0').toResponse(request.id);
108 }
105 if (server.searchEngine == null) { 109 if (server.searchEngine == null) {
106 return new Response.noIndexGenerated(request); 110 return new Response.noIndexGenerated(request);
107 } 111 }
108 return runZoned(() { 112 return runZoned(() {
109 try { 113 try {
110 String requestName = request.method; 114 String requestName = request.method;
111 if (requestName == COMPLETION_GET_SUGGESTIONS) { 115 if (requestName == COMPLETION_GET_SUGGESTIONS) {
112 return processRequest(request); 116 return processRequest(request);
113 } 117 }
114 } on RequestFailure catch (exception) { 118 } on RequestFailure catch (exception) {
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 final int replacementOffset; 251 final int replacementOffset;
248 252
249 /** 253 /**
250 * The suggested completions. 254 * The suggested completions.
251 */ 255 */
252 final List<CompletionSuggestion> suggestions; 256 final List<CompletionSuggestion> suggestions;
253 257
254 CompletionResult( 258 CompletionResult(
255 this.replacementOffset, this.replacementLength, this.suggestions); 259 this.replacementOffset, this.replacementLength, this.suggestions);
256 } 260 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698