Skip to content

Commit

Permalink
Version 3.4.0-0.0.dev
Browse files Browse the repository at this point in the history
Merge 278f386 into dev
  • Loading branch information
Dart CI committed Jan 4, 2024
2 parents 7f2523c + 278f386 commit 8a9893b
Show file tree
Hide file tree
Showing 50 changed files with 4,347 additions and 327 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 3.4.0

## 3.3.0

### Language
Expand Down
2 changes: 1 addition & 1 deletion pkg/_fe_analyzer_shared/lib/src/experiments/flags.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
// Instead modify 'tools/experimental_features.yaml' and run
// 'dart pkg/front_end/tool/fasta.dart generate-experimental-flags' to update.
const Version defaultLanguageVersion = const Version(3, 3);
const Version defaultLanguageVersion = const Version(3, 4);

/// Enum for experimental flags shared between the CFE and the analyzer.
enum ExperimentalFlag {
Expand Down
2 changes: 1 addition & 1 deletion pkg/analysis_server/lib/src/analysis_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ abstract class AnalysisServer {
}

return driver
.getResult(path, sendCachedToStream: sendCachedToStream)
.getResolvedUnit(path, sendCachedToStream: sendCachedToStream)
.then((value) => value is ResolvedUnitResult ? value : null)
.catchError((Object e, StackTrace st) {
instrumentationService.logException(e, st);
Expand Down
4 changes: 2 additions & 2 deletions pkg/analysis_server/lib/src/domains/execution/completion.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class RuntimeCompletionComputer {
this.code, this.offset, this.contextPath, this.contextOffset);

Future<RuntimeCompletionResult> compute() async {
var contextResult = await analysisDriver.getResult(contextPath);
var contextResult = await analysisDriver.getResolvedUnit(contextPath);
if (contextResult is! ResolvedUnitResult) {
return RuntimeCompletionResult([], []);
}
Expand Down Expand Up @@ -63,7 +63,7 @@ class RuntimeCompletionComputer {
// Update the context file content to include the code being completed.
// Then resolve it, and restore the file to its initial state.
var targetResult = await _withContextFileContent(targetCode, () async {
return await analysisDriver.getResult(contextPath);
return await analysisDriver.getResolvedUnit(contextPath);
});
if (targetResult is! ResolvedUnitResult) {
return RuntimeCompletionResult([], []);
Expand Down
4 changes: 2 additions & 2 deletions pkg/analysis_server/lib/src/status/diagnostics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class AstPage extends DiagnosticPageWithNav {
raw: true);
return;
}
var result = await driver.getResult(filePath);
var result = await driver.getResolvedUnit(filePath);
if (result is ResolvedUnitResult) {
var writer = AstWriter(buf);
result.unit.accept(writer);
Expand Down Expand Up @@ -1109,7 +1109,7 @@ class ElementModelPage extends DiagnosticPageWithNav {
raw: true);
return;
}
var result = await driver.getResult(filePath);
var result = await driver.getResolvedUnit(filePath);
CompilationUnitElement? compilationUnitElement;
if (result is ResolvedUnitResult) {
compilationUnitElement = result.unit.declaredElement;
Expand Down
5 changes: 3 additions & 2 deletions pkg/analysis_server/test/edit/refactoring_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2661,8 +2661,9 @@ void f() {
print(otherName);
}
''');
unawaited(
server.getAnalysisDriver(testFile.path)!.getResult(testFile.path));
unawaited(server
.getAnalysisDriver(testFile.path)!
.getResolvedUnit(testFile.path));
// send the second request, with the same kind, file and offset
await waitForTasksFinished();
result = await getRefactoringResult(() {
Expand Down
10 changes: 5 additions & 5 deletions pkg/analyzer/lib/src/dart/analysis/driver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class AnalysisDriver implements AnalysisDriverGeneric {
final _pendingFileChangesCompleters = <Completer<List<String>>>[];

/// The mapping from the files for which analysis was requested using
/// [getResult] to the [Completer]s to report the result.
/// [getResolvedUnit] to the [Completer]s to report the result.
final _requestedFiles = <String, List<Completer<SomeResolvedUnitResult>>>{};

/// The mapping from the files for which analysis was requested using
Expand Down Expand Up @@ -414,7 +414,7 @@ class AnalysisDriver implements AnalysisDriverGeneric {
/// the analysis state transitions to "idle".
///
/// [ResolvedUnitResult]s are produced for:
/// 1. Files requested using [getResult].
/// 1. Files requested using [getResolvedUnit].
/// 2. Files passed to [addFile] which are also in [priorityFiles].
///
/// [ErrorsResult]s are produced for:
Expand All @@ -430,7 +430,7 @@ class AnalysisDriver implements AnalysisDriverGeneric {
/// client does not change the state of the files.
///
/// Results might be produced even for files that have never been added
/// using [addFile], for example when [getResult] was called for a file.
/// using [addFile], for example when [getResolvedUnit] was called for a file.
Stream<Object> get results => _onResults;

/// Return the search support for the driver.
Expand Down Expand Up @@ -592,7 +592,7 @@ class AnalysisDriver implements AnalysisDriverGeneric {
/// transitions to "idle".
///
/// Invocation of this method will not prevent a [Future] returned from
/// [getResult] from completing with a result, but the result is not
/// [getResolvedUnit] from completing with a result, but the result is not
/// guaranteed to be consistent with the new current file state after this
/// [changeFile] invocation.
void changeFile(String path) {
Expand Down Expand Up @@ -965,7 +965,7 @@ class AnalysisDriver implements AnalysisDriverGeneric {
/// it, which is consistent with the current file state (including new states
/// of the files previously reported using [changeFile]), prior to the next
/// time the analysis state transitions to "idle".
Future<SomeResolvedUnitResult> getResult(String path,
Future<SomeResolvedUnitResult> getResolvedUnit(String path,
{bool sendCachedToStream = false}) {
if (!_isAbsolutePath(path)) {
return Future.value(
Expand Down
2 changes: 1 addition & 1 deletion pkg/analyzer/lib/src/dart/analysis/experiments.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ part of 'experiments.dart';

/// The current version of the Dart language (or, for non-stable releases, the
/// version of the language currently in the process of being developed).
const _currentVersion = '3.3.0';
const _currentVersion = '3.4.0';

/// A map containing information about all known experimental flags.
final _knownFeatures = <String, ExperimentalFeature>{
Expand Down
8 changes: 4 additions & 4 deletions pkg/analyzer/lib/src/dart/analysis/search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ class Search {
LibraryElement libraryElement = element.library;
for (CompilationUnitElement unitElement in libraryElement.units) {
String unitPath = unitElement.source.fullName;
var unitResult = await _driver.getResult(unitPath);
var unitResult = await _driver.getResolvedUnit(unitPath);
if (unitResult is ResolvedUnitResult) {
var visitor = ImportElementReferencesVisitor(element, unitElement);
unitResult.unit.accept(visitor);
Expand All @@ -720,7 +720,7 @@ class Search {
List<SearchResult> results = <SearchResult>[];
for (CompilationUnitElement unitElement in element.units) {
String unitPath = unitElement.source.fullName;
var unitResult = await _driver.getResult(unitPath);
var unitResult = await _driver.getResolvedUnit(unitPath);
if (unitResult is ResolvedUnitResult) {
CompilationUnit unit = unitResult.unit;
for (Directive directive in unit.directives) {
Expand Down Expand Up @@ -750,7 +750,7 @@ class Search {
}

// Prepare the unit.
var unitResult = await _driver.getResult(path);
var unitResult = await _driver.getResolvedUnit(path);
if (unitResult is! ResolvedUnitResult) {
return const <SearchResult>[];
}
Expand Down Expand Up @@ -850,7 +850,7 @@ class Search {
LibraryElement libraryElement = element.library;
for (CompilationUnitElement unitElement in libraryElement.units) {
String unitPath = unitElement.source.fullName;
var unitResult = await _driver.getResult(unitPath);
var unitResult = await _driver.getResolvedUnit(unitPath);
if (unitResult is ResolvedUnitResult) {
var visitor = _LocalReferencesVisitor({element}, unitElement);
unitResult.unit.accept(visitor);
Expand Down
2 changes: 1 addition & 1 deletion pkg/analyzer/lib/src/dart/analysis/session.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class AnalysisSessionImpl implements AnalysisSession {
@override
Future<SomeResolvedUnitResult> getResolvedUnit(String path) async {
checkConsistency();
return await _driver.getResult(path);
return await _driver.getResolvedUnit(path);
}

@override
Expand Down
Loading

0 comments on commit 8a9893b

Please sign in to comment.