Version 2.14.0-306.0.dev
Merge commit '83ea22543c655a6644728f26b2602d8311fc26f6' into 'dev'
diff --git a/pkg/analyzer/lib/src/dart/analysis/file_state.dart b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
index 40b742f..b21980f 100644
--- a/pkg/analyzer/lib/src/dart/analysis/file_state.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
@@ -414,12 +414,8 @@
/// Read the file content and ensure that all of the file properties are
/// consistent with the read content, including API signature.
///
- /// If [allowCached] is `true`, don't read the content of the file if it
- /// is already cached (in another [FileSystemState], because otherwise we
- /// would not create this new instance of [FileState] and refresh it).
- ///
/// Return `true` if the API signature changed since the last refresh.
- bool refresh({bool allowCached = false}) {
+ bool refresh() {
counterFileStateRefresh++;
var timerWasRunning = timerFileStateRefresh.isRunning;
@@ -429,10 +425,6 @@
_invalidateCurrentUnresolvedData();
- if (!allowCached) {
- _fsState.markFileForReading(path);
- }
-
{
var rawFileState = _fsState._fileContentCache.get(path);
_content = rawFileState.content;
@@ -862,7 +854,7 @@
_uriToFile[uri] = file;
_addFileWithPath(path, file);
_pathToCanonicalFile[path] = file;
- file.refresh(allowCached: true);
+ file.refresh();
}
return file;
}
@@ -908,7 +900,7 @@
packageLanguageVersion);
_uriToFile[uri] = file;
_addFileWithPath(path, file);
- file.refresh(allowCached: true);
+ file.refresh();
}
return Either2.t1(file);
}
diff --git a/pkg/analyzer/lib/src/dart/analysis/results.dart b/pkg/analyzer/lib/src/dart/analysis/results.dart
index bcd371c..ef041e2 100644
--- a/pkg/analyzer/lib/src/dart/analysis/results.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/results.dart
@@ -8,7 +8,6 @@
import 'package:analyzer/dart/ast/visitor.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type_provider.dart';
-import 'package:analyzer/dart/element/type_system.dart';
import 'package:analyzer/error/error.dart';
import 'package:analyzer/source/line_info.dart';
import 'package:analyzer/src/dart/element/type_system.dart';
@@ -74,113 +73,6 @@
LibraryElementResultImpl(this.element);
}
-/// The implementation of [AnalysisResult] when not [ResultState.VALID].
-class NotValidAnalysisResultImpl implements AnalysisResult {
- @override
- final ResultState state;
-
- NotValidAnalysisResultImpl(this.state);
-
- @override
- String? get path {
- throw StateError('This result is not valid');
- }
-
- @override
- AnalysisSession get session {
- throw StateError('This result is not valid');
- }
-
- @override
- Uri get uri {
- throw StateError('This result is not valid');
- }
-}
-
-/// The implementation of [ErrorsResult] when not [ResultState.VALID].
-class NotValidErrorsResultImpl extends NotValidFileResultImpl
- implements ErrorsResult {
- NotValidErrorsResultImpl(ResultState state) : super(state);
-
- @override
- List<AnalysisError> get errors {
- throw StateError('This result is not valid');
- }
-}
-
-/// The implementation of [FileResult] when not [ResultState.VALID].
-class NotValidFileResultImpl extends NotValidAnalysisResultImpl
- implements FileResult {
- NotValidFileResultImpl(ResultState state) : super(state);
-
- @override
- bool get isPart {
- throw StateError('This result is not valid');
- }
-
- @override
- LineInfo get lineInfo {
- throw StateError('This result is not valid');
- }
-}
-
-/// The implementation of [ResolvedUnitResult] when not [ResultState.VALID].
-class NotValidResolvedUnitResultImpl extends NotValidFileResultImpl
- implements ResolvedUnitResult {
- NotValidResolvedUnitResultImpl(ResultState state) : super(state);
-
- @override
- String? get content {
- throw StateError('This result is not valid');
- }
-
- @override
- List<AnalysisError> get errors {
- throw StateError('This result is not valid');
- }
-
- @override
- bool get exists {
- throw StateError('This result is not valid');
- }
-
- @override
- LibraryElement get libraryElement {
- throw StateError('This result is not valid');
- }
-
- @override
- TypeProvider get typeProvider {
- throw StateError('This result is not valid');
- }
-
- @override
- TypeSystem get typeSystem {
- throw StateError('This result is not valid');
- }
-
- @override
- CompilationUnit? get unit {
- throw StateError('This result is not valid');
- }
-}
-
-/// The implementation of [UnitElementResult] when not [ResultState.VALID].
-class NotValidUnitElementResultImpl extends NotValidAnalysisResultImpl
- implements UnitElementResult {
- NotValidUnitElementResultImpl(ResultState state) : super(state);
-
- @override
- CompilationUnitElement get element {
- throw StateError('This result is not valid');
- }
-
- @override
- String get signature {
- throw StateError('This result is not valid');
- }
-}
-
class ParsedLibraryResultImpl extends AnalysisResultImpl
implements ParsedLibraryResult {
@override
diff --git a/tools/VERSION b/tools/VERSION
index b0c12a4..479459d 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 14
PATCH 0
-PRERELEASE 305
+PRERELEASE 306
PRERELEASE_PATCH 0
\ No newline at end of file