Chromium Code Reviews| 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 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
| 8 import 'package:analyzer/src/generated/element.dart'; | 8 import 'package:analyzer/src/generated/element.dart'; |
| 9 import 'package:analyzer/src/generated/element_handle.dart'; | 9 import 'package:analyzer/src/generated/element_handle.dart'; |
| 10 import 'package:analyzer/src/generated/engine.dart'; | 10 import 'package:analyzer/src/generated/engine.dart'; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 throw new UnimplementedError(location.toString()); | 105 throw new UnimplementedError(location.toString()); |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 | 108 |
| 109 /** | 109 /** |
| 110 * Get the [LibraryElement] for the given [uri], resynthesizing it if it | 110 * Get the [LibraryElement] for the given [uri], resynthesizing it if it |
| 111 * hasn't been resynthesized already. | 111 * hasn't been resynthesized already. |
| 112 */ | 112 */ |
| 113 LibraryElement getLibraryElement(String uri) { | 113 LibraryElement getLibraryElement(String uri) { |
| 114 return _resynthesizedLibraries.putIfAbsent(uri, () { | 114 return _resynthesizedLibraries.putIfAbsent(uri, () { |
| 115 print('getLibraryElement: $uri'); | |
|
Paul Berry
2016/01/11 17:12:21
Looks like temporary debugging code that you forgo
| |
| 115 PrelinkedLibrary serializedLibrary = getPrelinkedSummary(uri); | 116 PrelinkedLibrary serializedLibrary = getPrelinkedSummary(uri); |
| 116 List<UnlinkedUnit> serializedUnits = <UnlinkedUnit>[ | 117 List<UnlinkedUnit> serializedUnits = <UnlinkedUnit>[ |
| 117 getUnlinkedSummary(uri) | 118 getUnlinkedSummary(uri) |
| 118 ]; | 119 ]; |
| 119 Source librarySource = _getSource(uri); | 120 Source librarySource = _getSource(uri); |
| 120 for (String part in serializedUnits[0].publicNamespace.parts) { | 121 for (String part in serializedUnits[0].publicNamespace.parts) { |
| 121 Source partSource = sourceFactory.resolveUri(librarySource, part); | 122 Source partSource = sourceFactory.resolveUri(librarySource, part); |
| 122 String partAbsUri = partSource.uri.toString(); | 123 String partAbsUri = partSource.uri.toString(); |
| 123 serializedUnits.add(getUnlinkedSummary(partAbsUri)); | 124 serializedUnits.add(getUnlinkedSummary(partAbsUri)); |
| 124 } | 125 } |
| (...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 999 break; | 1000 break; |
| 1000 } | 1001 } |
| 1001 } | 1002 } |
| 1002 resummarizedElements[absoluteUri] = elementMap; | 1003 resummarizedElements[absoluteUri] = elementMap; |
| 1003 unitHolder = null; | 1004 unitHolder = null; |
| 1004 prelinkedUnit = null; | 1005 prelinkedUnit = null; |
| 1005 unlinkedUnit = null; | 1006 unlinkedUnit = null; |
| 1006 return entryPoint; | 1007 return entryPoint; |
| 1007 } | 1008 } |
| 1008 } | 1009 } |
| OLD | NEW |