| 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 summary_resynthesizer; | 5 library summary_resynthesizer; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 10 import 'package:analyzer/dart/element/type.dart'; | 10 import 'package:analyzer/dart/element/type.dart'; |
| (...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 new CompilationUnitElementImpl(unitSource.shortName); | 924 new CompilationUnitElementImpl(unitSource.shortName); |
| 925 partUnit.uriOffset = partDecl.uriOffset; | 925 partUnit.uriOffset = partDecl.uriOffset; |
| 926 partUnit.uriEnd = partDecl.uriEnd; | 926 partUnit.uriEnd = partDecl.uriEnd; |
| 927 partUnit.source = unitSource; | 927 partUnit.source = unitSource; |
| 928 partUnit.librarySource = librarySource; | 928 partUnit.librarySource = librarySource; |
| 929 partUnit.uri = uri; | 929 partUnit.uri = uri; |
| 930 return partUnit; | 930 return partUnit; |
| 931 } | 931 } |
| 932 | 932 |
| 933 /** | 933 /** |
| 934 * Build a [DartType] object based on an [UnlinkedTypeRef]. This [DartType] | 934 * Build a [DartType] object based on a [TypeRef]. This [DartType] |
| 935 * may refer to elements in other libraries than the library being | 935 * may refer to elements in other libraries than the library being |
| 936 * deserialized, so handles are used to avoid having to deserialize other | 936 * deserialized, so handles are used to avoid having to deserialize other |
| 937 * libraries in the process. | 937 * libraries in the process. |
| 938 */ | 938 */ |
| 939 DartType buildType(UnlinkedTypeRef type) { | 939 DartType buildType(TypeRef type) { |
| 940 if (type.paramReference != 0) { | 940 if (type.paramReference != 0) { |
| 941 // TODO(paulberry): make this work for generic methods. | 941 // TODO(paulberry): make this work for generic methods. |
| 942 return currentTypeParameters[ | 942 return currentTypeParameters[ |
| 943 currentTypeParameters.length - type.paramReference] | 943 currentTypeParameters.length - type.paramReference].type; |
| 944 .type; | |
| 945 } else { | 944 } else { |
| 946 // TODO(paulberry): handle references to things other than classes (note: | 945 // TODO(paulberry): handle references to things other than classes (note: |
| 947 // this should only occur in the case of erroneous code). | 946 // this should only occur in the case of erroneous code). |
| 948 // TODO(paulberry): test reference to something inside a part. | 947 // TODO(paulberry): test reference to something inside a part. |
| 949 // TODO(paulberry): test reference to something inside a part of the | 948 // TODO(paulberry): test reference to something inside a part of the |
| 950 // current lib. | 949 // current lib. |
| 951 UnlinkedReference reference = unlinkedUnit.references[type.reference]; | 950 UnlinkedReference reference = unlinkedUnit.references[type.reference]; |
| 952 LinkedReference referenceResolution = | 951 LinkedReference referenceResolution = |
| 953 linkedUnit.references[type.reference]; | 952 linkedUnit.references[type.reference]; |
| 954 ElementLocationImpl location; | 953 ElementLocationImpl location; |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 } | 1171 } |
| 1173 for (PropertyAccessorElementImpl accessor in unit.accessors) { | 1172 for (PropertyAccessorElementImpl accessor in unit.accessors) { |
| 1174 elementMap[accessor.identifier] = accessor; | 1173 elementMap[accessor.identifier] = accessor; |
| 1175 } | 1174 } |
| 1176 resummarizedElements[absoluteUri] = elementMap; | 1175 resummarizedElements[absoluteUri] = elementMap; |
| 1177 unitHolder = null; | 1176 unitHolder = null; |
| 1178 linkedUnit = null; | 1177 linkedUnit = null; |
| 1179 unlinkedUnit = null; | 1178 unlinkedUnit = null; |
| 1180 } | 1179 } |
| 1181 } | 1180 } |
| OLD | NEW |