| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; | 8 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; |
| 9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 10 import 'package:analyzer/error/error.dart'; | 10 import 'package:analyzer/error/error.dart'; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 .elementDeclaredByCompilationUnit( | 109 .elementDeclaredByCompilationUnit( |
| 110 _resolvedLibraries[source.uri].definingCompilationUnit) | 110 _resolvedLibraries[source.uri].definingCompilationUnit) |
| 111 .library; | 111 .library; |
| 112 } | 112 } |
| 113 | 113 |
| 114 noSuchMethod(Invocation invocation) => unimplemented(); | 114 noSuchMethod(Invocation invocation) => unimplemented(); |
| 115 | 115 |
| 116 CompilationUnit resolveCompilationUnit( | 116 CompilationUnit resolveCompilationUnit( |
| 117 Source unitSource, LibraryElement library) { | 117 Source unitSource, LibraryElement library) { |
| 118 assert(_resolvedLibraries.containsKey(library.source.uri)); | 118 assert(_resolvedLibraries.containsKey(library.source.uri)); |
| 119 // TODO(paulberry): support parts. | 119 var resolvedLibrary = _resolvedLibraries[library.source.uri]; |
| 120 assert(unitSource == library.source); | 120 if (unitSource == library.source) { |
| 121 return _resolvedLibraries[library.source.uri].definingCompilationUnit; | 121 return resolvedLibrary.definingCompilationUnit; |
| 122 } else { |
| 123 assert(resolvedLibrary.partUnits.containsKey(unitSource.uri)); |
| 124 return resolvedLibrary.partUnits[unitSource.uri]; |
| 125 } |
| 122 } | 126 } |
| 123 } | 127 } |
| 124 | 128 |
| 125 class _AnalysisOptionsProxy implements AnalysisOptions { | 129 class _AnalysisOptionsProxy implements AnalysisOptions { |
| 126 final bool strongMode; | 130 final bool strongMode; |
| 127 | 131 |
| 128 _AnalysisOptionsProxy(this.strongMode); | 132 _AnalysisOptionsProxy(this.strongMode); |
| 129 | 133 |
| 130 noSuchMethod(Invocation invocation) => unimplemented(); | 134 noSuchMethod(Invocation invocation) => unimplemented(); |
| 131 } | 135 } |
| 132 | 136 |
| 133 class _SourceFactoryProxy implements SourceFactory { | 137 class _SourceFactoryProxy implements SourceFactory { |
| 134 Source forUri2(Uri absoluteUri) => new _SourceProxy(absoluteUri); | 138 Source forUri2(Uri absoluteUri) => new _SourceProxy(absoluteUri); |
| 135 | 139 |
| 136 noSuchMethod(Invocation invocation) => unimplemented(); | 140 noSuchMethod(Invocation invocation) => unimplemented(); |
| 137 } | 141 } |
| 138 | 142 |
| 139 class _SourceProxy extends BasicSource { | 143 class _SourceProxy extends BasicSource { |
| 140 _SourceProxy(Uri uri) : super(uri); | 144 _SourceProxy(Uri uri) : super(uri); |
| 141 | 145 |
| 142 noSuchMethod(Invocation invocation) => unimplemented(); | 146 noSuchMethod(Invocation invocation) => unimplemented(); |
| 143 } | 147 } |
| OLD | NEW |