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

Side by Side Diff: pkg/analysis_services/lib/completion/completion_suggestion.dart

Issue 461063002: add keyword suggestions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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.suggestion; 5 library services.completion.suggestion;
6 6
7 import 'package:analysis_services/constants.dart'; 7 import 'package:analysis_services/constants.dart';
8 import 'package:analysis_services/json.dart'; 8 import 'package:analysis_services/json.dart';
9 import 'package:analyzer/src/generated/element.dart'; 9 import 'package:analyzer/src/generated/element.dart';
10 10
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 static const CompletionSuggestionKind FIELD = 134 static const CompletionSuggestionKind FIELD =
135 const CompletionSuggestionKind('FIELD'); 135 const CompletionSuggestionKind('FIELD');
136 static const CompletionSuggestionKind FUNCTION = 136 static const CompletionSuggestionKind FUNCTION =
137 const CompletionSuggestionKind('FUNCTION'); 137 const CompletionSuggestionKind('FUNCTION');
138 static const CompletionSuggestionKind FUNCTION_TYPE_ALIAS = 138 static const CompletionSuggestionKind FUNCTION_TYPE_ALIAS =
139 const CompletionSuggestionKind('FUNCTION_TYPE_ALIAS'); 139 const CompletionSuggestionKind('FUNCTION_TYPE_ALIAS');
140 static const CompletionSuggestionKind GETTER = 140 static const CompletionSuggestionKind GETTER =
141 const CompletionSuggestionKind('GETTER'); 141 const CompletionSuggestionKind('GETTER');
142 static const CompletionSuggestionKind IMPORT = 142 static const CompletionSuggestionKind IMPORT =
143 const CompletionSuggestionKind('IMPORT'); 143 const CompletionSuggestionKind('IMPORT');
144 static const CompletionSuggestionKind KEYWORD =
145 const CompletionSuggestionKind('KEYWORD');
144 static const CompletionSuggestionKind LIBRARY_PREFIX = 146 static const CompletionSuggestionKind LIBRARY_PREFIX =
145 const CompletionSuggestionKind('LIBRARY_PREFIX'); 147 const CompletionSuggestionKind('LIBRARY_PREFIX');
146 static const CompletionSuggestionKind LOCAL_VARIABLE = 148 static const CompletionSuggestionKind LOCAL_VARIABLE =
147 const CompletionSuggestionKind('LOCAL_VARIABLE'); 149 const CompletionSuggestionKind('LOCAL_VARIABLE');
148 static const CompletionSuggestionKind METHOD = 150 static const CompletionSuggestionKind METHOD =
149 const CompletionSuggestionKind('METHOD'); 151 const CompletionSuggestionKind('METHOD');
150 static const CompletionSuggestionKind METHOD_NAME = 152 static const CompletionSuggestionKind METHOD_NAME =
151 const CompletionSuggestionKind('METHOD_NAME'); 153 const CompletionSuggestionKind('METHOD_NAME');
152 static const CompletionSuggestionKind NAMED_ARGUMENT = 154 static const CompletionSuggestionKind NAMED_ARGUMENT =
153 const CompletionSuggestionKind('NAMED_ARGUMENT'); 155 const CompletionSuggestionKind('NAMED_ARGUMENT');
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 static CompletionSuggestionKind valueOf(String name) { 214 static CompletionSuggestionKind valueOf(String name) {
213 if (ARGUMENT_LIST.name == name) return ARGUMENT_LIST; 215 if (ARGUMENT_LIST.name == name) return ARGUMENT_LIST;
214 if (CLASS.name == name) return CLASS; 216 if (CLASS.name == name) return CLASS;
215 if (CLASS_ALIAS.name == name) return CLASS_ALIAS; 217 if (CLASS_ALIAS.name == name) return CLASS_ALIAS;
216 if (CONSTRUCTOR.name == name) return CONSTRUCTOR; 218 if (CONSTRUCTOR.name == name) return CONSTRUCTOR;
217 if (FIELD.name == name) return FIELD; 219 if (FIELD.name == name) return FIELD;
218 if (FUNCTION.name == name) return FUNCTION; 220 if (FUNCTION.name == name) return FUNCTION;
219 if (FUNCTION_TYPE_ALIAS.name == name) return FUNCTION_TYPE_ALIAS; 221 if (FUNCTION_TYPE_ALIAS.name == name) return FUNCTION_TYPE_ALIAS;
220 if (GETTER.name == name) return GETTER; 222 if (GETTER.name == name) return GETTER;
221 if (IMPORT.name == name) return IMPORT; 223 if (IMPORT.name == name) return IMPORT;
224 if (KEYWORD.name == name) return KEYWORD;
222 if (LIBRARY_PREFIX.name == name) return LIBRARY_PREFIX; 225 if (LIBRARY_PREFIX.name == name) return LIBRARY_PREFIX;
223 if (LOCAL_VARIABLE.name == name) return LOCAL_VARIABLE; 226 if (LOCAL_VARIABLE.name == name) return LOCAL_VARIABLE;
224 if (METHOD.name == name) return METHOD; 227 if (METHOD.name == name) return METHOD;
225 if (METHOD_NAME.name == name) return METHOD_NAME; 228 if (METHOD_NAME.name == name) return METHOD_NAME;
226 if (NAMED_ARGUMENT.name == name) return NAMED_ARGUMENT; 229 if (NAMED_ARGUMENT.name == name) return NAMED_ARGUMENT;
227 if (OPTIONAL_ARGUMENT.name == name) return OPTIONAL_ARGUMENT; 230 if (OPTIONAL_ARGUMENT.name == name) return OPTIONAL_ARGUMENT;
228 if (PARAMETER.name == name) return PARAMETER; 231 if (PARAMETER.name == name) return PARAMETER;
229 if (SETTER.name == name) return SETTER; 232 if (SETTER.name == name) return SETTER;
230 if (TOP_LEVEL_VARIABLE.name == name) return TOP_LEVEL_VARIABLE; 233 if (TOP_LEVEL_VARIABLE.name == name) return TOP_LEVEL_VARIABLE;
231 if (TYPE_PARAMETER.name == name) return TYPE_PARAMETER; 234 if (TYPE_PARAMETER.name == name) return TYPE_PARAMETER;
232 throw new ArgumentError('Unknown CompletionSuggestionKind: $name'); 235 throw new ArgumentError('Unknown CompletionSuggestionKind: $name');
233 } 236 }
234 } 237 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698