| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:collection'; | 6 import 'dart:collection'; |
| 7 import 'dart:typed_data'; | 7 import 'dart:typed_data'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/element/element.dart' show CompilationUnitElement; | 10 import 'package:analyzer/dart/element/element.dart' show CompilationUnitElement; |
| (...skipping 1555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1566 return true; | 1566 return true; |
| 1567 } | 1567 } |
| 1568 | 1568 |
| 1569 // Check the next file. | 1569 // Check the next file. |
| 1570 String path = filesToCheck.removeLast(); | 1570 String path = filesToCheck.removeLast(); |
| 1571 if (checkedFiles.add(path)) { | 1571 if (checkedFiles.add(path)) { |
| 1572 FileState file = driver._fsState.getFileForPath(path); | 1572 FileState file = driver._fsState.getFileForPath(path); |
| 1573 if (!file.isPart) { | 1573 if (!file.isPart) { |
| 1574 bool isExported = false; | 1574 bool isExported = false; |
| 1575 TopLevelDeclaration declaration = file.topLevelDeclarations[name]; | 1575 TopLevelDeclaration declaration = file.topLevelDeclarations[name]; |
| 1576 for (FileState part in file.partedFiles) { |
| 1577 declaration ??= part.topLevelDeclarations[name]; |
| 1578 } |
| 1576 if (declaration == null) { | 1579 if (declaration == null) { |
| 1577 declaration = file.exportedTopLevelDeclarations[name]; | 1580 declaration = file.exportedTopLevelDeclarations[name]; |
| 1578 isExported = true; | 1581 isExported = true; |
| 1579 } | 1582 } |
| 1580 if (declaration != null) { | 1583 if (declaration != null) { |
| 1581 libraryDeclarations.add(new TopLevelDeclarationInSource( | 1584 libraryDeclarations.add(new TopLevelDeclarationInSource( |
| 1582 file.source, declaration, isExported)); | 1585 file.source, declaration, isExported)); |
| 1583 } | 1586 } |
| 1584 } | 1587 } |
| 1585 } | 1588 } |
| 1586 | 1589 |
| 1587 // We're not done yet. | 1590 // We're not done yet. |
| 1588 return false; | 1591 return false; |
| 1589 } | 1592 } |
| 1590 } | 1593 } |
| OLD | NEW |