Skip to content

Commit

Permalink
Version 3.7.0-176.0.dev
Browse files Browse the repository at this point in the history
Merge f7993d5 into dev
  • Loading branch information
Dart CI committed Nov 21, 2024
2 parents 3855907 + f7993d5 commit 69a1d7e
Show file tree
Hide file tree
Showing 11 changed files with 133 additions and 27 deletions.
8 changes: 4 additions & 4 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ vars = {
# EOL comment after a dependency to disable this and pin it at its current
# revision.

"core_rev": "6af0821dd8c0ecc5c30d5e67b3c8e16e8d79cda6",
"core_rev": "1de837279d3c4ce21fef2a5af8a7f0b668ef3d85",
# Note: Updates to dart_style have to be coordinated with the infrastructure
# team so that the internal formatter `tools/sdks/dart-sdk/bin/dart format`
# matches the version here. Please follow this process to make updates:
Expand All @@ -132,11 +132,11 @@ vars = {
#
# For more details, see https://github.com/dart-lang/sdk/issues/30164.
"dart_style_rev": "f6d020e48cc531a0967c91fa88028c086fedfbf9", # disable tools/rev_sdk_deps.dart
"dartdoc_rev": "f8a55e4b06a75ddcb0c9b809f2a812b81ccd10f3",
"dartdoc_rev": "c7f11603effa88ddacabfd555993f322fca8b3fe",
"ecosystem_rev": "52e4ceb6f0715bab5c47495429c4a2b7ce708a66",
"flute_rev": "a531c96a8b43d015c6bfbbfe3ab54867b0763b8b",
"glob_rev": "b6319d6c2880b44039e75dfed80f7ce150f76d51",
"http_rev": "e37093f117057921a5dca241339d53389f2330cb",
"http_rev": "79470d014b467f01b0e7c5b63ab6c86b22dec8db",
"http_multi_server_rev": "c8aabe36268aa38c906eae46728c10d883b9aced",
"intl_rev": "5d65e3808ce40e6282e40881492607df4e35669f",
"leak_tracker_rev": "f5620600a5ce1c44f65ddaa02001e200b096e14c", # manually rolled
Expand All @@ -150,7 +150,7 @@ vars = {
"protobuf_rev": "ccf104dbc36929c0f8708285d5f3a8fae206343e",
"pub_rev": "8c2e621c2403cb503cc9959be387d1061a16846a", # disable tools/rev_sdk_deps.dart
"pub_semver_rev": "ab3eab50cc9f3df650ba7f5571aa2a1ea715dcc8",
"shelf_rev": "0bb44cb7b54f856c4c20ff00eed7f006d865bb3e",
"shelf_rev": "a2708cd8bce88d5e6391b1cb5bbe80b5a072c55a",
"source_maps_rev": "b20b97003a48d78a1ecba7e46d932ea4b480dd94",
"source_span_rev": "f147469ba02108c1ade3680de548b7b447de8c72",
"sse_rev": "befbd6d35118f59525903242db3888942ac34180",
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 @@ -763,7 +763,7 @@ abstract class AnalysisServer {
return null;
}
try {
return driver.currentSession.getResolvedContainingLibrary(path);
return await driver.currentSession.getResolvedContainingLibrary(path);
} on InconsistentAnalysisException {
return null;
} catch (exception, stackTrace) {
Expand Down
25 changes: 25 additions & 0 deletions pkg/analysis_server/test/edit/fixes_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:async';

import 'package:analysis_server/protocol/protocol_generated.dart';
import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/plugin/plugin_manager.dart';
Expand Down Expand Up @@ -33,6 +35,29 @@ class FixesTest extends PubPackageAnalysisServerTest {
await setRoots(included: [workspaceRootPath], excluded: []);
}

Future<void> test_concurrentModifications() async {
var file = server.resourceProvider.getFile(testFile.path);
var futures = <Future<void>>[];

// Send many requests to modify files and get fixes.
for (var i = 1; i < 100; i++) {
futures.add(_addOverlay(testFile.path, 'var i = $i;'));
await pumpEventQueue();
futures.add(
handleSuccessfulRequest(
EditGetFixesParams(
file.path,
0,
).toRequest('$i', clientUriConverter: server.uriConverter),
),
);
await pumpEventQueue();
}

// Except all to complete.
await Future.wait(futures);
}

Future<void> test_fileOutsideRoot() async {
var outsideFile = '/foo/test.dart';
newFile(outsideFile, 'bad code to create error');
Expand Down
1 change: 0 additions & 1 deletion pkg/analyzer/analyzer_use_new_elements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ test/src/dart/resolution/prefix_element_test.dart
test/src/dart/resolution/resolution.dart
test/src/dart/resolution/scope_test.dart
test/src/dart/resolution/super_formal_parameter_test.dart
test/src/lint/lint_rule_test.dart
test/src/services/top_level_declarations_test.dart
test/src/summary/element_text.dart
test/src/summary/elements/class_test.dart
Expand Down
29 changes: 29 additions & 0 deletions pkg/analyzer/lib/dart/element/element2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1528,6 +1528,35 @@ abstract class LibraryElement2 implements Element2, Annotatable {

/// Returns the class defined in this library that has the given [name].
ClassElement2? getClass2(String name);

/// Returns the enum defined in this library that has the given [name].
EnumElement2? getEnum2(String name);

/// Returns the extension defined in this library that has the given [name].
ExtensionElement2? getExtension(String name);

/// Returns the extension type defined in this library that has the
/// given [name].
ExtensionTypeElement2? getExtensionType(String name);

/// Returns the getter defined in this library that has the given [name].
GetterElement? getGetter(String name);

/// Returns the mixin defined in this library that has the given [name].
MixinElement2? getMixin2(String name);

/// Returns the setter defined in this library that has the given [name].
SetterElement? getSetter(String name);

/// Returns the function defined in this library that has the given [name].
TopLevelFunctionElement? getTopLevelFunction(String name);

/// Returns the top-level variable defined in this library that has the
/// given [name].
TopLevelVariableElement2? getTopLevelVariable(String name);

/// Returns the type alias defined in this library that has the given [name].
TypeAliasElement2? getTypeAlias(String name);
}

/// An `export` directive within a library fragment.
Expand Down
59 changes: 53 additions & 6 deletions pkg/analyzer/lib/src/dart/element/element.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6838,12 +6838,7 @@ class LibraryElementImpl extends ElementImpl

@override
ClassElement2? getClass2(String name) {
for (var class_ in classes) {
if (class_.name3 == name) {
return class_;
}
}
return null;
return _getElementByName(classes, name);
}

EnumElement? getEnum(String name) {
Expand All @@ -6856,6 +6851,26 @@ class LibraryElementImpl extends ElementImpl
return null;
}

@override
EnumElement2? getEnum2(String name) {
return _getElementByName(enums, name);
}

@override
ExtensionElement2? getExtension(String name) {
return _getElementByName(extensions, name);
}

@override
ExtensionTypeElement2? getExtensionType(String name) {
return _getElementByName(extensionTypes, name);
}

@override
GetterElement? getGetter(String name) {
return _getElementByName(getters, name);
}

MixinElement? getMixin(String name) {
for (var unitElement in units) {
var element = unitElement.getMixin(name);
Expand All @@ -6866,6 +6881,31 @@ class LibraryElementImpl extends ElementImpl
return null;
}

@override
MixinElement2? getMixin2(String name) {
return _getElementByName(mixins, name);
}

@override
SetterElement? getSetter(String name) {
return _getElementByName(setters, name);
}

@override
TopLevelFunctionElement? getTopLevelFunction(String name) {
return _getElementByName(functions, name);
}

@override
TopLevelVariableElement2? getTopLevelVariable(String name) {
return _getElementByName(topLevelVariables, name);
}

@override
TypeAliasElement2? getTypeAlias(String name) {
return _getElementByName(typeAliases, name);
}

/// Return `true` if [reference] comes only from deprecated exports.
bool isFromDeprecatedExport(ExportedReference reference) {
if (reference is ExportedReferenceExported) {
Expand Down Expand Up @@ -6898,6 +6938,13 @@ class LibraryElementImpl extends ElementImpl
}
return prefixes.toList(growable: false);
}

static T? _getElementByName<T extends Element2>(
List<T> elements,
String name,
) {
return elements.firstWhereOrNull((e) => e.name3 == name);
}
}

class LibraryExportElementImpl extends _ExistingElementImpl
Expand Down
6 changes: 3 additions & 3 deletions pkg/analyzer/test/src/lint/lint_rule_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.

import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/element2.dart';
import 'package:analyzer/diagnostic/diagnostic.dart';
import 'package:analyzer/error/error.dart';
import 'package:analyzer/error/listener.dart';
Expand Down Expand Up @@ -75,8 +75,8 @@ class CollectingReporter extends ErrorReporter {
CollectingReporter(super.listener, super.source);

@override
void atElement(
Element element,
void atElement2(
Element2 element,
ErrorCode errorCode, {
List<Object>? arguments,
List<DiagnosticMessage>? contextMessages,
Expand Down
22 changes: 16 additions & 6 deletions pkg/analyzer_plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 0.12.0-dev
## 0.12.0
- Breaking changes to `DartFileEditBuilder`: `convertFunctionFromSyncToAsync`
and `replaceTypeWithFuture`.
- Breaking changes to all classes in `lib/protocol/protocol_common.dart` and
Expand All @@ -9,14 +9,24 @@
provides a `name` instance getter). The instances of each enum are also now
considered exhaustive (which may trigger new diagnostics on existing switch
statements and switch expressions).
- Support version `7.x` of the `analyzer` package.
- Support change descriptions on SourceEdit.
- New API in `DartFileEditBuilder`: `getIndent`, `insertCaseClauseAtEnd`,
`insertConstructor`, `insertField`, `insertGetter`, `insertMethod`,
`writeIndent`.
- New API in `DartEditBuilder`: `writeFormalParameter` and
`writeFormalParameters`.
- New experimental API in `DartEditBuilder`: `writeOverride2`,
`writeReference2`, `writeType2`, `writeTypeParameter2`, and
`writeTypeParameters2`.

## 0.11.3

- Support version `6.x` of the `analyzer` package
- Support version `6.x` of the `analyzer` package.

## 0.11.2

- Support version `5.x` of the `analyzer` package
- Support version `5.x` of the `analyzer` package.

## 0.11.1
- Call `analyzeFiles` from `handleAffectedFiles` only for files that are
Expand All @@ -26,17 +36,17 @@
- Using `AnalysisContextCollection` and `AnalysisContext` for analysis.

## 0.10.0
- Support version `4.x` of the `analyzer` package
- Support version `4.x` of the `analyzer` package.

## 0.9.0
- Support version `3.x` of the `analyzer` package
- Support version `3.x` of the `analyzer` package.

## 0.8.0
- Require SDK `2.14` to use `Object.hash()`.
- Require `yaml 3.1.0` to use `recover`.

## 0.7.0
- Support version `2.x` of the `analyzer` package
- Support version `2.x` of the `analyzer` package.

## 0.6.0
- Bug fixes to the protocol.
Expand Down
2 changes: 1 addition & 1 deletion pkg/analyzer_plugin/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: analyzer_plugin
description: A framework and support code for building plugins for the analysis server.
version: 0.12.0-dev
version: 0.12.0
repository: https://github.com/dart-lang/sdk/tree/main/pkg/analyzer_plugin

environment:
Expand Down
2 changes: 1 addition & 1 deletion tools/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ CHANNEL dev
MAJOR 3
MINOR 7
PATCH 0
PRERELEASE 175
PRERELEASE 176
PRERELEASE_PATCH 0
4 changes: 0 additions & 4 deletions tools/bots/try_benchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,8 @@ EOF
third_party/d8/linux/x64/d8 --stack_size=1024 sdk/lib/_internal/js_runtime/lib/preambles/seal_native_object.js sdk/lib/_internal/js_runtime/lib/preambles/d8.js out.js
out/ReleaseX64/dart-sdk/bin/dart compile js --no-sound-null-safety --platform-binaries=out/ReleaseX64 --benchmarking-x --out=out.js -m hello.dart
third_party/d8/linux/x64/d8 --stack_size=1024 sdk/lib/_internal/js_runtime/lib/preambles/seal_native_object.js sdk/lib/_internal/js_runtime/lib/preambles/d8.js out.js
out/ReleaseX64/dart-sdk/bin/dart pkg/dev_compiler/tool/ddb -r d8 -b third_party/d8/linux/x64/d8 --no-sound-null-safety hello.dart
out/ReleaseX64/dart-sdk/bin/dart pkg/dev_compiler/tool/ddb -r d8 -b third_party/d8/linux/x64/d8 --no-sound-null-safety --mode=compile --compile-vm-options=--print-metrics --out out.js hello.dart
out/ReleaseX64/dart-sdk/bin/dart pkg/dev_compiler/tool/ddb -r d8 -b third_party/d8/linux/x64/d8 --sound-null-safety hello.dart
out/ReleaseX64/dart-sdk/bin/dart pkg/dev_compiler/tool/ddb -r d8 -b third_party/d8/linux/x64/d8 --sound-null-safety --mode=compile --compile-vm-options=--print-metrics --out out.js hello.dart
out/ReleaseX64/dart-sdk/bin/dart pkg/dev_compiler/tool/ddb -r d8 -b third_party/d8/linux/x64/d8 --canary --no-sound-null-safety hello.dart
out/ReleaseX64/dart-sdk/bin/dart pkg/dev_compiler/tool/ddb -r d8 -b third_party/d8/linux/x64/d8 --canary --no-sound-null-safety --mode=compile --compile-vm-options=--print-metrics --out out.js hello.dart
out/ReleaseX64/dart-sdk/bin/dart pkg/dev_compiler/tool/ddb -r d8 -b third_party/d8/linux/x64/d8 --canary --sound-null-safety hello.dart
out/ReleaseX64/dart-sdk/bin/dart pkg/dev_compiler/tool/ddb -r d8 -b third_party/d8/linux/x64/d8 --canary --sound-null-safety --mode=compile --compile-vm-options=--print-metrics --out out.js hello.dart
out/ReleaseX64/dart-sdk/bin/dart pkg/analysis_server/benchmark/benchmarks.dart run --quick --repeat 1 analysis-server-cold
Expand Down

0 comments on commit 69a1d7e

Please sign in to comment.