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

Side by Side Diff: pkg/analysis_services/lib/src/generated/completion.dart

Issue 463493003: rename CompletionSuggestionKind.VARIABLE to LOCAL_VARIABLE to match spec (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
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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library services.completion; 8 library services.completion;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 } 154 }
155 155
156 void _analyzeDeclarationName(VariableDeclaration varDecl) { 156 void _analyzeDeclarationName(VariableDeclaration varDecl) {
157 // We might want to propose multiple names for a declaration based on types someday. 157 // We might want to propose multiple names for a declaration based on types someday.
158 // For now, just use whatever is already there. 158 // For now, just use whatever is already there.
159 SimpleIdentifier identifier = varDecl.name; 159 SimpleIdentifier identifier = varDecl.name;
160 _filter = _createFilter(identifier); 160 _filter = _createFilter(identifier);
161 VariableDeclarationList varList = varDecl.parent as VariableDeclarationList; 161 VariableDeclarationList varList = varDecl.parent as VariableDeclarationList;
162 TypeName type = varList.type; 162 TypeName type = varList.type;
163 if (identifier.length > 0) { 163 if (identifier.length > 0) {
164 _pName3(identifier.name, CompletionSuggestionKind.VARIABLE); 164 _pName3(identifier.name, CompletionSuggestionKind.LOCAL_VARIABLE);
165 } 165 }
166 if (type == null) { 166 if (type == null) {
167 if (varList.keyword == null) { 167 if (varList.keyword == null) {
168 // Interpret as the type name of a typed variable declaration { DivE!; } 168 // Interpret as the type name of a typed variable declaration { DivE!; }
169 _analyzeLocalName(identifier); 169 _analyzeLocalName(identifier);
170 } 170 }
171 } else { 171 } else {
172 _pParamName(type.name.name.toLowerCase()); 172 _pParamName(type.name.name.toLowerCase());
173 } 173 }
174 } 174 }
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 prop.setCompletion(proposal.completion).setReturnType(proposal.returnType); 1014 prop.setCompletion(proposal.completion).setReturnType(proposal.returnType);
1015 prop.setParameterNames(parameterNames); 1015 prop.setParameterNames(parameterNames);
1016 prop.setParameterTypes(proposal.parameterTypes); 1016 prop.setParameterTypes(proposal.parameterTypes);
1017 prop.setParameterStyle(proposal.positionalParameterCount, proposal.hasNamed, proposal.hasPositional); 1017 prop.setParameterStyle(proposal.positionalParameterCount, proposal.hasNamed, proposal.hasPositional);
1018 prop.setReplacementLength(0).setLocation(_completionLocation()); 1018 prop.setReplacementLength(0).setLocation(_completionLocation());
1019 prop.setRelevance(CompletionProposal.RELEVANCE_HIGH); 1019 prop.setRelevance(CompletionProposal.RELEVANCE_HIGH);
1020 _requestor.accept(prop); 1020 _requestor.accept(prop);
1021 } 1021 }
1022 1022
1023 void _pDynamic() { 1023 void _pDynamic() {
1024 _pWord(_C_DYNAMIC, CompletionSuggestionKind.VARIABLE); 1024 _pWord(_C_DYNAMIC, CompletionSuggestionKind.LOCAL_VARIABLE);
1025 } 1025 }
1026 1026
1027 void _pExecutable(Element element, FunctionType functionType, SimpleIdentifier identifier, bool isPotentialMatch) { 1027 void _pExecutable(Element element, FunctionType functionType, SimpleIdentifier identifier, bool isPotentialMatch) {
1028 // Create a completion proposal for the element: function, method, getter, s etter, constructor. 1028 // Create a completion proposal for the element: function, method, getter, s etter, constructor.
1029 String name = element.displayName; 1029 String name = element.displayName;
1030 if (name.isEmpty) { 1030 if (name.isEmpty) {
1031 return; 1031 return;
1032 } 1032 }
1033 if (_filterDisallows(element)) { 1033 if (_filterDisallows(element)) {
1034 return; 1034 return;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 if (container != null) { 1081 if (container != null) {
1082 prop.setDeclaringType(container.displayName); 1082 prop.setDeclaringType(container.displayName);
1083 } 1083 }
1084 if (identifier != null) { 1084 if (identifier != null) {
1085 prop.setReplacementLengthIdentifier(identifier.length); 1085 prop.setReplacementLengthIdentifier(identifier.length);
1086 } 1086 }
1087 _requestor.accept(prop); 1087 _requestor.accept(prop);
1088 } 1088 }
1089 1089
1090 void _pFalse() { 1090 void _pFalse() {
1091 _pWord(_C_FALSE, CompletionSuggestionKind.VARIABLE); 1091 _pWord(_C_FALSE, CompletionSuggestionKind.LOCAL_VARIABLE);
1092 } 1092 }
1093 1093
1094 void _pField(FieldElement element, SimpleIdentifier identifier, ClassElement c lassElement) { 1094 void _pField(FieldElement element, SimpleIdentifier identifier, ClassElement c lassElement) {
1095 // Create a completion proposal for the element: field only. 1095 // Create a completion proposal for the element: field only.
1096 if (_filterDisallows(element)) { 1096 if (_filterDisallows(element)) {
1097 return; 1097 return;
1098 } 1098 }
1099 CompletionProposal prop = _createProposal(element); 1099 CompletionProposal prop = _createProposal(element);
1100 Element container = element.enclosingElement; 1100 Element container = element.enclosingElement;
1101 prop.setDeclaringType(container.displayName); 1101 prop.setDeclaringType(container.displayName);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1170 prop.setReturnType(element.type.returnType.name); 1170 prop.setReturnType(element.type.returnType.name);
1171 Element container = element.enclosingElement; 1171 Element container = element.enclosingElement;
1172 prop.setDeclaringType(container.displayName); 1172 prop.setDeclaringType(container.displayName);
1173 if (identifier != null) { 1173 if (identifier != null) {
1174 prop.setReplacementLengthIdentifier(identifier.length); 1174 prop.setReplacementLengthIdentifier(identifier.length);
1175 } 1175 }
1176 _requestor.accept(prop); 1176 _requestor.accept(prop);
1177 } 1177 }
1178 1178
1179 void _pNull() { 1179 void _pNull() {
1180 _pWord(_C_NULL, CompletionSuggestionKind.VARIABLE); 1180 _pWord(_C_NULL, CompletionSuggestionKind.LOCAL_VARIABLE);
1181 } 1181 }
1182 1182
1183 void _pParamName(String name) { 1183 void _pParamName(String name) {
1184 if (_filterDisallows2(name)) { 1184 if (_filterDisallows2(name)) {
1185 return; 1185 return;
1186 } 1186 }
1187 CompletionProposal prop = _createProposal4(CompletionSuggestionKind.PARAMETE R); 1187 CompletionProposal prop = _createProposal4(CompletionSuggestionKind.PARAMETE R);
1188 prop.setCompletion(name); 1188 prop.setCompletion(name);
1189 _requestor.accept(prop); 1189 _requestor.accept(prop);
1190 } 1190 }
(...skipping 19 matching lines...) Expand all
1210 kind = CompletionSuggestionKind.IMPORT; 1210 kind = CompletionSuggestionKind.IMPORT;
1211 } else if (element.kind == ElementKind.PARAMETER) { 1211 } else if (element.kind == ElementKind.PARAMETER) {
1212 kind = CompletionSuggestionKind.PARAMETER; 1212 kind = CompletionSuggestionKind.PARAMETER;
1213 } else if (element.kind == ElementKind.PREFIX) { 1213 } else if (element.kind == ElementKind.PREFIX) {
1214 kind = CompletionSuggestionKind.LIBRARY_PREFIX; 1214 kind = CompletionSuggestionKind.LIBRARY_PREFIX;
1215 } else if (element.kind == ElementKind.FUNCTION_TYPE_ALIAS) { 1215 } else if (element.kind == ElementKind.FUNCTION_TYPE_ALIAS) {
1216 kind = CompletionSuggestionKind.CLASS_ALIAS; 1216 kind = CompletionSuggestionKind.CLASS_ALIAS;
1217 } else if (element.kind == ElementKind.TYPE_PARAMETER) { 1217 } else if (element.kind == ElementKind.TYPE_PARAMETER) {
1218 kind = CompletionSuggestionKind.TYPE_PARAMETER; 1218 kind = CompletionSuggestionKind.TYPE_PARAMETER;
1219 } else if (element.kind == ElementKind.LOCAL_VARIABLE || element.kind == E lementKind.TOP_LEVEL_VARIABLE) { 1219 } else if (element.kind == ElementKind.LOCAL_VARIABLE || element.kind == E lementKind.TOP_LEVEL_VARIABLE) {
1220 kind = CompletionSuggestionKind.VARIABLE; 1220 kind = CompletionSuggestionKind.LOCAL_VARIABLE;
1221 } else { 1221 } else {
1222 throw new IllegalArgumentException(); 1222 throw new IllegalArgumentException();
1223 } 1223 }
1224 break; 1224 break;
1225 } 1225 }
1226 return kind; 1226 return kind;
1227 } 1227 }
1228 1228
1229 void _proposeCombinator(Combinator node, SimpleIdentifier identifier) { 1229 void _proposeCombinator(Combinator node, SimpleIdentifier identifier) {
1230 _filter = _createFilter(identifier); 1230 _filter = _createFilter(identifier);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 } 1272 }
1273 } 1273 }
1274 1274
1275 void _proposeNames(CompletionEngine_NameCollector names, SimpleIdentifier iden tifier) { 1275 void _proposeNames(CompletionEngine_NameCollector names, SimpleIdentifier iden tifier) {
1276 for (Element element in names.uniqueElements) { 1276 for (Element element in names.uniqueElements) {
1277 _proposeName(element, identifier, names); 1277 _proposeName(element, identifier, names);
1278 } 1278 }
1279 } 1279 }
1280 1280
1281 void _pTrue() { 1281 void _pTrue() {
1282 _pWord(_C_TRUE, CompletionSuggestionKind.VARIABLE); 1282 _pWord(_C_TRUE, CompletionSuggestionKind.LOCAL_VARIABLE);
1283 } 1283 }
1284 1284
1285 void _pVar() { 1285 void _pVar() {
1286 _pWord(_C_VAR, CompletionSuggestionKind.VARIABLE); 1286 _pWord(_C_VAR, CompletionSuggestionKind.LOCAL_VARIABLE);
1287 } 1287 }
1288 1288
1289 void _pVoid() { 1289 void _pVoid() {
1290 _pWord(_C_VOID, CompletionSuggestionKind.VARIABLE); 1290 _pWord(_C_VOID, CompletionSuggestionKind.LOCAL_VARIABLE);
1291 } 1291 }
1292 1292
1293 void _pWord(String word, CompletionSuggestionKind kind) { 1293 void _pWord(String word, CompletionSuggestionKind kind) {
1294 if (_filterDisallows2(word)) { 1294 if (_filterDisallows2(word)) {
1295 return; 1295 return;
1296 } 1296 }
1297 CompletionProposal prop = _createProposal4(kind); 1297 CompletionProposal prop = _createProposal4(kind);
1298 prop.setCompletion(word); 1298 prop.setCompletion(word);
1299 _requestor.accept(prop); 1299 _requestor.accept(prop);
1300 } 1300 }
(...skipping 2395 matching lines...) Expand 10 before | Expand all | Expand 10 after
3696 3696
3697 class TopLevelNamesKind extends Enum<TopLevelNamesKind> { 3697 class TopLevelNamesKind extends Enum<TopLevelNamesKind> {
3698 static const TopLevelNamesKind DECLARED_AND_IMPORTS = const TopLevelNamesKind( 'DECLARED_AND_IMPORTS', 0); 3698 static const TopLevelNamesKind DECLARED_AND_IMPORTS = const TopLevelNamesKind( 'DECLARED_AND_IMPORTS', 0);
3699 3699
3700 static const TopLevelNamesKind DECLARED_AND_EXPORTS = const TopLevelNamesKind( 'DECLARED_AND_EXPORTS', 1); 3700 static const TopLevelNamesKind DECLARED_AND_EXPORTS = const TopLevelNamesKind( 'DECLARED_AND_EXPORTS', 1);
3701 3701
3702 static const List<TopLevelNamesKind> values = const [DECLARED_AND_IMPORTS, DEC LARED_AND_EXPORTS]; 3702 static const List<TopLevelNamesKind> values = const [DECLARED_AND_IMPORTS, DEC LARED_AND_EXPORTS];
3703 3703
3704 const TopLevelNamesKind(String name, int ordinal) : super(name, ordinal); 3704 const TopLevelNamesKind(String name, int ordinal) : super(name, ordinal);
3705 } 3705 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698