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/error/error.dart'; | 10 import 'package:analyzer/error/error.dart'; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 * | 59 * |
60 * | 60 * |
61 * TODO(scheglov) Clean up the list of implicitly analyzed files. | 61 * TODO(scheglov) Clean up the list of implicitly analyzed files. |
62 * | 62 * |
63 * TODO(scheglov) Handle not existing 'dart:x' URIs (while user is typing). | 63 * TODO(scheglov) Handle not existing 'dart:x' URIs (while user is typing). |
64 */ | 64 */ |
65 class AnalysisDriver { | 65 class AnalysisDriver { |
66 /** | 66 /** |
67 * The version of data format, should be incremented on every format change. | 67 * The version of data format, should be incremented on every format change. |
68 */ | 68 */ |
69 static const int DATA_VERSION = 4; | 69 static const int DATA_VERSION = 5; |
70 | 70 |
71 /** | 71 /** |
72 * The name of the driver, e.g. the name of the folder. | 72 * The name of the driver, e.g. the name of the folder. |
73 */ | 73 */ |
74 String name; | 74 String name; |
75 | 75 |
76 /** | 76 /** |
77 * The scheduler that schedules analysis work in this, and possibly other | 77 * The scheduler that schedules analysis work in this, and possibly other |
78 * analysis drivers. | 78 * analysis drivers. |
79 */ | 79 */ |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 void _transitionToIdle() { | 797 void _transitionToIdle() { |
798 if (_currentStatus != AnalysisStatus.IDLE) { | 798 if (_currentStatus != AnalysisStatus.IDLE) { |
799 _currentStatus = AnalysisStatus.IDLE; | 799 _currentStatus = AnalysisStatus.IDLE; |
800 _statusController.add(AnalysisStatus.IDLE); | 800 _statusController.add(AnalysisStatus.IDLE); |
801 } | 801 } |
802 } | 802 } |
803 | 803 |
804 /** | 804 /** |
805 * Verify the API signature for the file with the given [path], and decide | 805 * Verify the API signature for the file with the given [path], and decide |
806 * which linked libraries should be invalidated, and files reanalyzed. | 806 * which linked libraries should be invalidated, and files reanalyzed. |
807 * | |
808 * TODO(scheglov) I see that adding a local var changes (full) API signature. | |
809 */ | 807 */ |
810 FileState _verifyApiSignature(String path) { | 808 FileState _verifyApiSignature(String path) { |
811 return _logger.run('Verify API signature of $path', () { | 809 return _logger.run('Verify API signature of $path', () { |
812 bool anyApiChanged = false; | 810 bool anyApiChanged = false; |
813 List<FileState> files = _fsState.getFilesForPath(path); | 811 List<FileState> files = _fsState.getFilesForPath(path); |
814 for (FileState file in files) { | 812 for (FileState file in files) { |
815 bool apiChanged = file.refresh(); | 813 bool apiChanged = file.refresh(); |
816 if (apiChanged) { | 814 if (apiChanged) { |
817 anyApiChanged = true; | 815 anyApiChanged = true; |
818 } | 816 } |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1236 /** | 1234 /** |
1237 * Complete the [signal] future if it is not completed yet. It is safe to | 1235 * Complete the [signal] future if it is not completed yet. It is safe to |
1238 * call this method multiple times, but the [signal] will complete only once. | 1236 * call this method multiple times, but the [signal] will complete only once. |
1239 */ | 1237 */ |
1240 void notify() { | 1238 void notify() { |
1241 if (!_completer.isCompleted) { | 1239 if (!_completer.isCompleted) { |
1242 _completer.complete(null); | 1240 _completer.complete(null); |
1243 } | 1241 } |
1244 } | 1242 } |
1245 } | 1243 } |
OLD | NEW |