OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.contributor.dart.static_member; | 5 library services.completion.contributor.dart.static_member; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; | 9 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; |
10 import 'package:analysis_server/src/services/completion/dart/suggestion_builder.
dart'; | 10 import 'package:analysis_server/src/services/completion/dart/suggestion_builder.
dart'; |
| 11 import 'package:analyzer/dart/element/element.dart'; |
| 12 import 'package:analyzer/dart/element/visitor.dart'; |
11 import 'package:analyzer/src/generated/ast.dart'; | 13 import 'package:analyzer/src/generated/ast.dart'; |
12 import 'package:analyzer/src/generated/element.dart'; | |
13 | 14 |
14 import '../../../protocol_server.dart' | 15 import '../../../protocol_server.dart' |
15 show CompletionSuggestion, CompletionSuggestionKind; | 16 show CompletionSuggestion, CompletionSuggestionKind; |
16 | 17 |
17 /** | 18 /** |
18 * A contributor for calculating static member invocation / access suggestions | 19 * A contributor for calculating static member invocation / access suggestions |
19 * `completion.getSuggestions` request results. | 20 * `completion.getSuggestions` request results. |
20 */ | 21 */ |
21 class StaticMemberContributor extends DartCompletionContributor { | 22 class StaticMemberContributor extends DartCompletionContributor { |
22 @override | 23 @override |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 bool _isSpecialEnumField(FieldElement element) { | 135 bool _isSpecialEnumField(FieldElement element) { |
135 Element parent = element.enclosingElement; | 136 Element parent = element.enclosingElement; |
136 if (parent is ClassElement && parent.isEnum) { | 137 if (parent is ClassElement && parent.isEnum) { |
137 if (element.name == 'values') { | 138 if (element.name == 'values') { |
138 return true; | 139 return true; |
139 } | 140 } |
140 } | 141 } |
141 return false; | 142 return false; |
142 } | 143 } |
143 } | 144 } |
OLD | NEW |