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

Side by Side Diff: pkg/analysis_server/lib/src/services/completion/arglist_computer.dart

Issue 845553005: Change code completion relevance from CompletionRelevance.LOW/DEFAULT/HIGH to int (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 | Annotate | Revision Log
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 services.completion.computer.dart.arglist; 5 library services.completion.computer.dart.arglist;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol_server.dart' hide Element, 9 import 'package:analysis_server/src/protocol_server.dart' hide Element,
10 ElementKind; 10 ElementKind;
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 } 178 }
179 completion.write(name); 179 completion.write(name);
180 paramNames.add(name); 180 paramNames.add(name);
181 paramTypes.add(_getParamType(param)); 181 paramTypes.add(_getParamType(param));
182 } 182 }
183 } 183 }
184 } 184 }
185 completion.write(')'); 185 completion.write(')');
186 CompletionSuggestion suggestion = new CompletionSuggestion( 186 CompletionSuggestion suggestion = new CompletionSuggestion(
187 CompletionSuggestionKind.ARGUMENT_LIST, 187 CompletionSuggestionKind.ARGUMENT_LIST,
188 CompletionRelevance.HIGH, 188 COMPLETION_RELEVANCE_HIGH,
189 completion.toString(), 189 completion.toString(),
190 completion.length, 190 completion.length,
191 0, 191 0,
192 false, 192 false,
193 false); 193 false);
194 suggestion.parameterNames = paramNames; 194 suggestion.parameterNames = paramNames;
195 suggestion.parameterTypes = paramTypes; 195 suggestion.parameterTypes = paramTypes;
196 request.suggestions.add(suggestion); 196 request.suggestions.add(suggestion);
197 } 197 }
198 198
199 String _getParamType(FormalParameter param) { 199 String _getParamType(FormalParameter param) {
200 TypeName type; 200 TypeName type;
201 if (param is SimpleFormalParameter) { 201 if (param is SimpleFormalParameter) {
202 type = param.type; 202 type = param.type;
203 } 203 }
204 if (type != null) { 204 if (type != null) {
205 Identifier id = type.name; 205 Identifier id = type.name;
206 if (id != null) { 206 if (id != null) {
207 String name = id.name; 207 String name = id.name;
208 if (name != null && name.length > 0) { 208 if (name != null && name.length > 0) {
209 return name; 209 return name;
210 } 210 }
211 } 211 }
212 } 212 }
213 return 'dynamic'; 213 return 'dynamic';
214 } 214 }
215 } 215 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698