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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 @override | 108 @override |
109 Expression dotTarget; | 109 Expression dotTarget; |
110 | 110 |
111 @override | 111 @override |
112 Source librarySource; | 112 Source librarySource; |
113 | 113 |
114 @override | 114 @override |
115 CompletionTarget target; | 115 CompletionTarget target; |
116 | 116 |
117 @override | 117 @override |
118 Future<LibraryElement> get libraryElement async { | 118 LibraryElement get libraryElement { |
119 //TODO(danrubel) build the library element rather than all the declarations | 119 //TODO(danrubel) build the library element rather than all the declarations |
120 CompilationUnit unit = target.unit; | 120 CompilationUnit unit = target.unit; |
121 if (unit != null) { | 121 if (unit != null) { |
122 CompilationUnitElement elem = unit.element; | 122 CompilationUnitElement elem = unit.element; |
123 if (elem != null) { | 123 if (elem != null) { |
124 return elem.library; | 124 return elem.library; |
125 } | 125 } |
126 } | 126 } |
127 return null; | 127 return null; |
128 } | 128 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 dotTarget = node.realTarget; | 207 dotTarget = node.realTarget; |
208 } | 208 } |
209 } | 209 } |
210 if (node is PrefixedIdentifier) { | 210 if (node is PrefixedIdentifier) { |
211 if (identical(node.identifier, target.entity)) { | 211 if (identical(node.identifier, target.entity)) { |
212 dotTarget = node.prefix; | 212 dotTarget = node.prefix; |
213 } | 213 } |
214 } | 214 } |
215 } | 215 } |
216 } | 216 } |
OLD | NEW |