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

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

Issue 422133002: add FUNCTION_TYPE_ALIAS to CompletionSuggestionKind (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge 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
« no previous file with comments | « pkg/analysis_server/test/completion_test.dart ('k') | no next file » | 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 services.completion.suggestion; 5 library services.completion.suggestion;
6 6
7 import 'package:analysis_services/json.dart'; 7 import 'package:analysis_services/json.dart';
8 import 'package:analysis_services/constants.dart'; 8 import 'package:analysis_services/constants.dart';
9 import 'package:analyzer/src/generated/element.dart'; 9 import 'package:analyzer/src/generated/element.dart';
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 static const CompletionSuggestionKind CLASS_ALIAS = 59 static const CompletionSuggestionKind CLASS_ALIAS =
60 const CompletionSuggestionKind('CLASS_ALIAS'); 60 const CompletionSuggestionKind('CLASS_ALIAS');
61 static const CompletionSuggestionKind CONSTRUCTOR = 61 static const CompletionSuggestionKind CONSTRUCTOR =
62 const CompletionSuggestionKind('CONSTRUCTOR'); 62 const CompletionSuggestionKind('CONSTRUCTOR');
63 static const CompletionSuggestionKind FIELD = 63 static const CompletionSuggestionKind FIELD =
64 const CompletionSuggestionKind('FIELD'); 64 const CompletionSuggestionKind('FIELD');
65 static const CompletionSuggestionKind FUNCTION = 65 static const CompletionSuggestionKind FUNCTION =
66 const CompletionSuggestionKind('FUNCTION'); 66 const CompletionSuggestionKind('FUNCTION');
67 static const CompletionSuggestionKind FUNCTION_ALIAS = 67 static const CompletionSuggestionKind FUNCTION_ALIAS =
68 const CompletionSuggestionKind('FUNCTION_ALIAS'); 68 const CompletionSuggestionKind('FUNCTION_ALIAS');
69 static const CompletionSuggestionKind FUNCTION_TYPE_ALIAS =
70 const CompletionSuggestionKind('FUNCTION_TYPE_ALIAS');
69 static const CompletionSuggestionKind GETTER = 71 static const CompletionSuggestionKind GETTER =
70 const CompletionSuggestionKind('GETTER'); 72 const CompletionSuggestionKind('GETTER');
71 static const CompletionSuggestionKind IMPORT = 73 static const CompletionSuggestionKind IMPORT =
72 const CompletionSuggestionKind('IMPORT'); 74 const CompletionSuggestionKind('IMPORT');
73 static const CompletionSuggestionKind LIBRARY_PREFIX = 75 static const CompletionSuggestionKind LIBRARY_PREFIX =
74 const CompletionSuggestionKind('LIBRARY_PREFIX'); 76 const CompletionSuggestionKind('LIBRARY_PREFIX');
75 static const CompletionSuggestionKind METHOD = 77 static const CompletionSuggestionKind METHOD =
76 const CompletionSuggestionKind('METHOD'); 78 const CompletionSuggestionKind('METHOD');
77 static const CompletionSuggestionKind METHOD_NAME = 79 static const CompletionSuggestionKind METHOD_NAME =
78 const CompletionSuggestionKind('METHOD_NAME'); 80 const CompletionSuggestionKind('METHOD_NAME');
(...skipping 21 matching lines...) Expand all
100 @override 102 @override
101 String toString() => name; 103 String toString() => name;
102 104
103 static CompletionSuggestionKind valueOf(String name) { 105 static CompletionSuggestionKind valueOf(String name) {
104 if (CLASS.name == name) return CLASS; 106 if (CLASS.name == name) return CLASS;
105 if (CLASS_ALIAS.name == name) return CLASS_ALIAS; 107 if (CLASS_ALIAS.name == name) return CLASS_ALIAS;
106 if (CONSTRUCTOR.name == name) return CONSTRUCTOR; 108 if (CONSTRUCTOR.name == name) return CONSTRUCTOR;
107 if (FIELD.name == name) return FIELD; 109 if (FIELD.name == name) return FIELD;
108 if (FUNCTION.name == name) return FUNCTION; 110 if (FUNCTION.name == name) return FUNCTION;
109 if (FUNCTION_ALIAS.name == name) return FUNCTION_ALIAS; 111 if (FUNCTION_ALIAS.name == name) return FUNCTION_ALIAS;
112 if (FUNCTION_TYPE_ALIAS.name == name) return FUNCTION_TYPE_ALIAS;
110 if (GETTER.name == name) return GETTER; 113 if (GETTER.name == name) return GETTER;
111 if (IMPORT.name == name) return IMPORT; 114 if (IMPORT.name == name) return IMPORT;
112 if (LIBRARY_PREFIX.name == name) return LIBRARY_PREFIX; 115 if (LIBRARY_PREFIX.name == name) return LIBRARY_PREFIX;
113 if (METHOD.name == name) return METHOD; 116 if (METHOD.name == name) return METHOD;
114 if (METHOD_NAME.name == name) return METHOD_NAME; 117 if (METHOD_NAME.name == name) return METHOD_NAME;
115 if (PARAMETER.name == name) return PARAMETER; 118 if (PARAMETER.name == name) return PARAMETER;
116 if (SETTER.name == name) return SETTER; 119 if (SETTER.name == name) return SETTER;
117 if (VARIABLE.name == name) return VARIABLE; 120 if (VARIABLE.name == name) return VARIABLE;
118 if (TYPE_PARAMETER.name == name) return TYPE_PARAMETER; 121 if (TYPE_PARAMETER.name == name) return TYPE_PARAMETER;
119 if (ARGUMENT_LIST.name == name) return ARGUMENT_LIST; 122 if (ARGUMENT_LIST.name == name) return ARGUMENT_LIST;
(...skipping 22 matching lines...) Expand all
142 // ElementKind.EXTERNAL_HTML_SCRIPT, 145 // ElementKind.EXTERNAL_HTML_SCRIPT,
143 if (kind == ElementKind.FIELD) return FIELD; 146 if (kind == ElementKind.FIELD) return FIELD;
144 if (kind == ElementKind.FUNCTION) return FUNCTION; 147 if (kind == ElementKind.FUNCTION) return FUNCTION;
145 if (kind == ElementKind.GETTER) return GETTER; 148 if (kind == ElementKind.GETTER) return GETTER;
146 // ElementKind.HTML, 149 // ElementKind.HTML,
147 if (kind == ElementKind.IMPORT) return IMPORT; 150 if (kind == ElementKind.IMPORT) return IMPORT;
148 // ElementKind.LABEL, 151 // ElementKind.LABEL,
149 // ElementKind.LIBRARY, 152 // ElementKind.LIBRARY,
150 // ElementKind.LOCAL_VARIABLE, 153 // ElementKind.LOCAL_VARIABLE,
151 if (kind == ElementKind.METHOD) return METHOD; 154 if (kind == ElementKind.METHOD) return METHOD;
152 // ElementKind.METHOD,
153 // ElementKind.NAME, 155 // ElementKind.NAME,
154 if (kind == ElementKind.PARAMETER) return PARAMETER; 156 if (kind == ElementKind.PARAMETER) return PARAMETER;
155 // ElementKind.POLYMER_ATTRIBUTE, 157 // ElementKind.POLYMER_ATTRIBUTE,
156 // ElementKind.POLYMER_TAG_DART, 158 // ElementKind.POLYMER_TAG_DART,
157 // ElementKind.POLYMER_TAG_HTML, 159 // ElementKind.POLYMER_TAG_HTML,
158 // ElementKind.PREFIX, 160 // ElementKind.PREFIX,
159 if (kind == ElementKind.SETTER) return SETTER; 161 if (kind == ElementKind.SETTER) return SETTER;
160 if (kind == ElementKind.TOP_LEVEL_VARIABLE) return TOP_LEVEL_VARIABLE; 162 if (kind == ElementKind.TOP_LEVEL_VARIABLE) return TOP_LEVEL_VARIABLE;
161 // ElementKind.FUNCTION_TYPE_ALIAS, 163 if (kind == ElementKind.FUNCTION_TYPE_ALIAS) return FUNCTION_TYPE_ALIAS;
162 // ElementKind.TYPE_PARAMETER, 164 // ElementKind.TYPE_PARAMETER,
163 // ElementKind.UNIVERSE 165 // ElementKind.UNIVERSE
164 throw new ArgumentError('Unknown CompletionSuggestionKind for: $kind'); 166 throw new ArgumentError('Unknown CompletionSuggestionKind for: $kind');
165 } 167 }
166 } 168 }
167 169
168 /** 170 /**
169 * An enumeration of the relevance of a completion suggestion. 171 * An enumeration of the relevance of a completion suggestion.
170 */ 172 */
171 class CompletionRelevance { 173 class CompletionRelevance {
172 static const CompletionRelevance LOW = const CompletionRelevance('LOW'); 174 static const CompletionRelevance LOW = const CompletionRelevance('LOW');
173 static const CompletionRelevance DEFAULT = 175 static const CompletionRelevance DEFAULT =
174 const CompletionRelevance('DEFAULT'); 176 const CompletionRelevance('DEFAULT');
175 static const CompletionRelevance HIGH = const CompletionRelevance('HIGH'); 177 static const CompletionRelevance HIGH = const CompletionRelevance('HIGH');
176 178
177 final String name; 179 final String name;
178 180
179 const CompletionRelevance(this.name); 181 const CompletionRelevance(this.name);
180 182
181 static CompletionRelevance value(String name) { 183 static CompletionRelevance value(String name) {
182 if (LOW.name == name) return LOW; 184 if (LOW.name == name) return LOW;
183 if (DEFAULT.name == name) return DEFAULT; 185 if (DEFAULT.name == name) return DEFAULT;
184 if (HIGH.name == name) return HIGH; 186 if (HIGH.name == name) return HIGH;
185 throw new ArgumentError('Unknown CompletionRelevance: $name'); 187 throw new ArgumentError('Unknown CompletionRelevance: $name');
186 } 188 }
187 } 189 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/completion_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698