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.dart.manager; | 5 library services.completion.dart.manager; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
10 import 'package:analysis_server/src/provisional/completion/completion_core.dart' | 10 import 'package:analysis_server/src/provisional/completion/completion_core.dart' |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 _coreLib = context.typeProvider.objectType.element.library; | 185 _coreLib = context.typeProvider.objectType.element.library; |
186 } else { | 186 } else { |
187 Source coreUri = sourceFactory.forUri('dart:core'); | 187 Source coreUri = sourceFactory.forUri('dart:core'); |
188 _coreLib = context.computeLibraryElement(coreUri); | 188 _coreLib = context.computeLibraryElement(coreUri); |
189 } | 189 } |
190 return _coreLib; | 190 return _coreLib; |
191 } | 191 } |
192 | 192 |
193 @override | 193 @override |
194 bool get includeIdentifiers { | 194 bool get includeIdentifiers { |
195 opType; // <<< ensure _opType is initialized | 195 return opType.includeIdentifiers; |
196 return !_opType.isPrefixed && | |
197 (_opType.includeReturnValueSuggestions || | |
198 _opType.includeTypeNameSuggestions || | |
199 _opType.includeVoidReturnSuggestions || | |
200 _opType.includeConstructorSuggestions); | |
201 } | 196 } |
202 | 197 |
203 @override | 198 @override |
204 LibraryElement get libraryElement { | 199 LibraryElement get libraryElement { |
205 //TODO(danrubel) build the library element rather than all the declarations | 200 //TODO(danrubel) build the library element rather than all the declarations |
206 CompilationUnit unit = target.unit; | 201 CompilationUnit unit = target.unit; |
207 if (unit != null) { | 202 if (unit != null) { |
208 CompilationUnitElement elem = unit.element; | 203 CompilationUnitElement elem = unit.element; |
209 if (elem != null) { | 204 if (elem != null) { |
210 return elem.library; | 205 return elem.library; |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 if (start <= requestOffset && requestOffset <= end) { | 532 if (start <= requestOffset && requestOffset <= end) { |
538 // Replacement range for import URI | 533 // Replacement range for import URI |
539 return new ReplacementRange(start, end - start); | 534 return new ReplacementRange(start, end - start); |
540 } | 535 } |
541 } | 536 } |
542 } | 537 } |
543 } | 538 } |
544 return new ReplacementRange(requestOffset, 0); | 539 return new ReplacementRange(requestOffset, 0); |
545 } | 540 } |
546 } | 541 } |
OLD | NEW |