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:front_end/src/base/processed_options.dart'; | 7 import 'package:front_end/src/base/processed_options.dart'; |
8 import 'package:front_end/src/incremental_kernel_generator_impl.dart'; | 8 import 'package:front_end/src/incremental_kernel_generator_impl.dart'; |
9 import 'package:kernel/kernel.dart'; | 9 import 'package:kernel/kernel.dart'; |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 new IncrementalKernelGeneratorImpl(source, new ProcessedOptions(options)); | 59 new IncrementalKernelGeneratorImpl(source, new ProcessedOptions(options)); |
60 | 60 |
61 /// Generates a kernel representation of the changes to the program, assuming | 61 /// Generates a kernel representation of the changes to the program, assuming |
62 /// that all valid sources are unchanged since the last call to | 62 /// that all valid sources are unchanged since the last call to |
63 /// [computeDelta]. | 63 /// [computeDelta]. |
64 /// | 64 /// |
65 /// Source files in the set of valid sources are guaranteed not to be re-read | 65 /// Source files in the set of valid sources are guaranteed not to be re-read |
66 /// from disk; they are assumed to be unchanged regardless of the state of the | 66 /// from disk; they are assumed to be unchanged regardless of the state of the |
67 /// filesystem. | 67 /// filesystem. |
68 /// | 68 /// |
69 /// If [watch] is not `null`, then when a source file is first used | |
70 /// by [computeDelta], [watch] is called with the Uri of that source | |
71 /// file and `used` == `true` indicating that the source file is being | |
72 /// used when compiling the program. If during a subsequent call to | |
Paul Berry
2017/01/25 22:03:33
Please add a sentence explaining that the file con
danrubel
2017/01/25 22:40:41
Done.
| |
73 /// [computeDelta], a source file that was being used is no longer used, | |
74 /// then [watch] is called with the Uri of that source file and | |
75 /// `used` == `false` indicating that the source file is no longer needed. | |
76 /// | |
Paul Berry
2017/01/25 22:03:34
Please add a sentence explaining that multiple inv
danrubel
2017/01/25 22:40:41
Done.
| |
69 /// If the future completes successfully, the previous file state is updated | 77 /// If the future completes successfully, the previous file state is updated |
70 /// and the set of valid sources is set to the set of all sources in the | 78 /// and the set of valid sources is set to the set of all sources in the |
71 /// program. | 79 /// program. |
72 /// | 80 /// |
73 /// If the future completes with an error (due to errors in the compiled | 81 /// If the future completes with an error (due to errors in the compiled |
74 /// source code), the caller may consider the previous file state and the set | 82 /// source code), the caller may consider the previous file state and the set |
75 /// of valid sources to be unchanged; this means that once the user fixes the | 83 /// of valid sources to be unchanged; this means that once the user fixes the |
76 /// errors, it is safe to call [computeDelta] again. | 84 /// errors, it is safe to call [computeDelta] again. |
77 Future<DeltaProgram> computeDelta(); | 85 Future<DeltaProgram> computeDelta({Future<Null> watch(Uri uri, bool used)}); |
78 | 86 |
79 /// Remove any source file(s) associated with the given file path from the set | 87 /// Remove any source file(s) associated with the given file path from the set |
80 /// of valid sources. This guarantees that those files will be re-read on the | 88 /// of valid sources. This guarantees that those files will be re-read on the |
81 /// next call to [computeDelta]). | 89 /// next call to [computeDelta]). |
82 void invalidate(String path); | 90 void invalidate(String path); |
83 | 91 |
84 /// Remove all source files from the set of valid sources. This guarantees | 92 /// Remove all source files from the set of valid sources. This guarantees |
85 /// that all files will be re-read on the next call to [computeDelta]. | 93 /// that all files will be re-read on the next call to [computeDelta]. |
86 /// | 94 /// |
87 /// Note that this does not erase the previous program state; the next time | 95 /// Note that this does not erase the previous program state; the next time |
88 /// [computeDelta] is called, if parts of the program are discovered to be | 96 /// [computeDelta] is called, if parts of the program are discovered to be |
89 /// unchanged, parts of the previous program state will still be re-used to | 97 /// unchanged, parts of the previous program state will still be re-used to |
90 /// speed up compilation. | 98 /// speed up compilation. |
91 void invalidateAll(); | 99 void invalidateAll(); |
92 } | 100 } |
OLD | NEW |