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

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

Issue 2618243002: Fix the rest of the completion tests with the new analysis driver. (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/test/integration/completion/get_suggestions_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 // extract and validate params 131 // extract and validate params
132 CompletionGetSuggestionsParams params = 132 CompletionGetSuggestionsParams params =
133 new CompletionGetSuggestionsParams.fromRequest(request); 133 new CompletionGetSuggestionsParams.fromRequest(request);
134 134
135 AnalysisResult result; 135 AnalysisResult result;
136 AnalysisContext context; 136 AnalysisContext context;
137 Source source; 137 Source source;
138 if (server.options.enableNewAnalysisDriver) { 138 if (server.options.enableNewAnalysisDriver) {
139 result = await server.getAnalysisResult(params.file); 139 result = await server.getAnalysisResult(params.file);
140 140
141 if (result == null) { 141 if (result == null || !result.exists) {
142 server.sendResponse(new Response.unknownSource(request)); 142 server.sendResponse(new Response.unknownSource(request));
143 return; 143 return;
144 } 144 }
145 145
146 if (params.offset < 0 || params.offset > result.content.length) { 146 if (params.offset < 0 || params.offset > result.content.length) {
147 server.sendResponse(new Response.invalidParameter( 147 server.sendResponse(new Response.invalidParameter(
148 request, 148 request,
149 'params.offset', 149 'params.offset',
150 'Expected offset between 0 and source length inclusive,' 150 'Expected offset between 0 and source length inclusive,'
151 ' but found ${params.offset}')); 151 ' but found ${params.offset}'));
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 final int replacementOffset; 277 final int replacementOffset;
278 278
279 /** 279 /**
280 * The suggested completions. 280 * The suggested completions.
281 */ 281 */
282 final List<CompletionSuggestion> suggestions; 282 final List<CompletionSuggestion> suggestions;
283 283
284 CompletionResult( 284 CompletionResult(
285 this.replacementOffset, this.replacementLength, this.suggestions); 285 this.replacementOffset, this.replacementLength, this.suggestions);
286 } 286 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/integration/completion/get_suggestions_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698