| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 analyzer.src.generated.engine; | 5 library analyzer.src.generated.engine; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| (...skipping 2005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2016 * [originalContents] is the former contents of the file, and [newContents] | 2016 * [originalContents] is the former contents of the file, and [newContents] |
| 2017 * is the updated contents. If [notify] is true, a source changed event is | 2017 * is the updated contents. If [notify] is true, a source changed event is |
| 2018 * triggered. | 2018 * triggered. |
| 2019 * | 2019 * |
| 2020 * Normally it should not be necessary for clients to call this function, | 2020 * Normally it should not be necessary for clients to call this function, |
| 2021 * since it will be automatically invoked in response to a call to | 2021 * since it will be automatically invoked in response to a call to |
| 2022 * [applyChanges] or [setContents]. However, if this analysis context is | 2022 * [applyChanges] or [setContents]. However, if this analysis context is |
| 2023 * sharing its content cache with other contexts, then the client must | 2023 * sharing its content cache with other contexts, then the client must |
| 2024 * manually update the content cache and call this function for each context. | 2024 * manually update the content cache and call this function for each context. |
| 2025 * | 2025 * |
| 2026 * Return `true` if the change was significant to this context (i.e. [source] | 2026 * If [explicit] is true and newContents is not null, unconditionally add |
| 2027 * is either implicitly or explicitly analyzed by this context, and a change | 2027 * as an explicit source and return true. |
| 2028 * actually occurred). | 2028 * |
| 2029 * Otherwise, return `true` if the change was significant to this context |
| 2030 * (i.e. [source] was already either implicitly or explicitly analyzed by |
| 2031 * this context, and a change actually occurred). |
| 2029 */ | 2032 */ |
| 2030 bool handleContentsChanged( | 2033 bool handleContentsChanged( |
| 2031 Source source, String originalContents, String newContents, bool notify); | 2034 Source source, String originalContents, String newContents, bool notify, |
| 2035 {bool explicit: false}); |
| 2032 | 2036 |
| 2033 /** | 2037 /** |
| 2034 * Given an [elementMap] mapping the source for the libraries represented by | 2038 * Given an [elementMap] mapping the source for the libraries represented by |
| 2035 * the corresponding elements to the elements representing the libraries, | 2039 * the corresponding elements to the elements representing the libraries, |
| 2036 * record those mappings. | 2040 * record those mappings. |
| 2037 */ | 2041 */ |
| 2038 void recordLibraryElements(Map<Source, LibraryElement> elementMap); | 2042 void recordLibraryElements(Map<Source, LibraryElement> elementMap); |
| 2039 | 2043 |
| 2040 /** | 2044 /** |
| 2041 * Return `true` if errors should be produced for the given [source]. | 2045 * Return `true` if errors should be produced for the given [source]. |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2475 * The data that was created from the source. | 2479 * The data that was created from the source. |
| 2476 */ | 2480 */ |
| 2477 final E data; | 2481 final E data; |
| 2478 | 2482 |
| 2479 /** | 2483 /** |
| 2480 * Initialize a newly created holder to associate the given [data] with the | 2484 * Initialize a newly created holder to associate the given [data] with the |
| 2481 * given [modificationTime]. | 2485 * given [modificationTime]. |
| 2482 */ | 2486 */ |
| 2483 TimestampedData(this.modificationTime, this.data); | 2487 TimestampedData(this.modificationTime, this.data); |
| 2484 } | 2488 } |
| OLD | NEW |