| 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/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 /** | 88 /** |
| 89 * Initialize a newly created completion request based on the given request. | 89 * Initialize a newly created completion request based on the given request. |
| 90 */ | 90 */ |
| 91 factory DartCompletionRequestImpl.forRequest(CompletionRequest request) { | 91 factory DartCompletionRequestImpl.forRequest(CompletionRequest request) { |
| 92 return new DartCompletionRequestImpl._(request.server, request.context, | 92 return new DartCompletionRequestImpl._(request.server, request.context, |
| 93 request.resourceProvider, request.source, request.offset); | 93 request.resourceProvider, request.source, request.offset); |
| 94 } | 94 } |
| 95 | 95 |
| 96 DartCompletionRequestImpl._(AnalysisServer server, AnalysisContext context, | 96 DartCompletionRequestImpl._(AnalysisServer server, AnalysisContext context, |
| 97 ResourceProvider resourceProvider, Source source, int offset) | 97 ResourceProvider resourceProvider, Source source, int offset) |
| 98 : super(server, context, resourceProvider, source, offset); | 98 : super(server, context, source, offset); |
| 99 | 99 |
| 100 @override | 100 @override |
| 101 Future<CompilationUnit> resolveDeclarationsInScope() async { | 101 Future<CompilationUnit> resolveDeclarationsInScope() async { |
| 102 CompilationUnit unit = target.unit; | 102 CompilationUnit unit = target.unit; |
| 103 if (_haveResolveDeclarationsInScope) { | 103 if (_haveResolveDeclarationsInScope) { |
| 104 return unit; | 104 return unit; |
| 105 } | 105 } |
| 106 | 106 |
| 107 // Determine the library source | 107 // Determine the library source |
| 108 Source librarySource; | 108 Source librarySource; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 140 |
| 141 @override | 141 @override |
| 142 CompletionTarget get target { | 142 CompletionTarget get target { |
| 143 if (_target == null) { | 143 if (_target == null) { |
| 144 CompilationUnit unit = context.computeResult(source, PARSED_UNIT); | 144 CompilationUnit unit = context.computeResult(source, PARSED_UNIT); |
| 145 _target = new CompletionTarget.forOffset(unit, offset); | 145 _target = new CompletionTarget.forOffset(unit, offset); |
| 146 } | 146 } |
| 147 return _target; | 147 return _target; |
| 148 } | 148 } |
| 149 } | 149 } |
| OLD | NEW |