Skip to content

Commit

Permalink
Version 3.5.0-181.0.dev
Browse files Browse the repository at this point in the history
Merge 53f1ed4 into dev
  • Loading branch information
Dart CI committed May 22, 2024
2 parents 7809d6e + 53f1ed4 commit 1d4f535
Show file tree
Hide file tree
Showing 59 changed files with 996 additions and 1,129 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@
[#55418]: https://github.com/dart-lang/sdk/issues/55418
[#55436]: https://github.com/dart-lang/sdk/issues/55436

### Libraries

#### `dart:core`

- `DateTime` on the web platform now stores microseconds. Fixes [#44876][].
The web imlementation is now practically compatible with the native
implementation. Small discrepancies due to rounding of web integers may still
occur for (1) `microsecondsSinceEpoch` outside the safe range, corresponding
to dates with a year outside of 1685..2255, and (2) arithmetic (`add`,
`subtract`, `difference`) where the `Duration` argument or result exceeds 570
years.

[#44876]: https://github.com/dart-lang/sdk/issues/44876

### Tools

#### Linter
Expand Down
4 changes: 2 additions & 2 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ vars = {
"ply_rev": "604b32590ffad5cbb82e4afef1d305512d06ae93",
"protobuf_gn_rev": "ca669f79945418f6229e4fef89b666b2a88cbb10",
"WebCore_rev": "bcb10901266c884e7b3740abc597ab95373ab55c",
"zlib_rev": "24c07df5033183efad8607cba62e746bea7180bf",
"zlib_rev": "108fa50cda23ed4a712a098d058dccbbfd248206",

### /third_party/pkg dependencies
# 'tools/rev_sdk_deps.dart' can rev pkg dependencies to their latest; put an
Expand Down Expand Up @@ -190,7 +190,7 @@ vars = {
"typed_data_rev": "fb1958ca880d650972e124222d3d9e41bd35c76c",
"vector_math_rev": "43f2a77bb0be812b027a68a11792d563713b42a1",
"watcher_rev": "c182cd3db6f0bc285bf5da52df422f5c64f21a37",
"web_rev": "d7766451f43001276b5493b2261d2973702b8334",
"web_rev": "7604578eb538c471d438608673c037121d95dba5",
"web_socket_channel_rev": "45b8ce9ce9fb5194a24d3dff8913c573fbe7896a",
"webdev_rev": "fc32eb69f2ad666e9ab1cb3300510e5daed222d6",
"webdriver_rev": "f85779edd7c9f66198d4391ed3631db1d97a5b11",
Expand Down
16 changes: 1 addition & 15 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -229,26 +229,12 @@ config("compiler") {
} else if (current_cpu == "arm") {
cflags += [
"-march=$arm_arch",
"-mfpu=$arm_fpu",
"-mfloat-abi=$arm_float_abi",
]
if (arm_tune != "") {
cflags += [ "-mtune=$arm_tune" ]
}
if (!is_clang) {
# Clang doesn't support these flags.
cflags += [
# The tree-sra optimization (scalar replacement for
# aggregates enabling subsequent optimizations) leads to
# invalid code generation when using the Android NDK's
# compiler (r5-r7). This can be verified using
# webkit_unit_tests' WTF.Checked_int8_t test.
"-fno-tree-sra",

# The following option is disabled to improve binary
# size and performance in gcc 4.9.
"-fno-caller-saves",
]
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/_fe_analyzer_shared/lib/src/types/shared_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ abstract interface class SharedNamedType<Type extends SharedType> {
/// represent a record type.
abstract interface class SharedRecordType<Type extends SharedType>
implements SharedType {
Iterable<SharedNamedType<Type>> get namedTypes;
List<SharedNamedType<Type>> get namedTypes;

Iterable<Type> get positionalTypes;
List<Type> get positionalTypes;
}

/// Common interface for data structures used by the implementations to
Expand Down
15 changes: 11 additions & 4 deletions pkg/analysis_server/lib/src/analysis_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -974,10 +974,17 @@ abstract class CommonServerContextManagerCallbacks
@override
@mustCallSuper
void applyFileRemoved(String file) {
// If the removed file doesn't have an overlay, we need to flush any
// previous diagnostics.
if (!resourceProvider.hasOverlay(file) && filesToFlush.remove(file)) {
flushResults([file]);
// If the removed file doesn't have an overlay, we need to clear any
// previous results.
if (!resourceProvider.hasOverlay(file)) {
// Clear the cached errors in the the notification manager so we don't
// re-send stale results if a plugin sends an update and we merge it with
// previous results.
analysisServer.notificationManager.errors.clearResultsForFile(file);

if (filesToFlush.remove(file)) {
flushResults([file]);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ class RemoveExtraModifier extends ResolvedCorrectionProducer {
var problemMessage = diagnostic.problemMessage;

// Extract the modifier.
// Example: "Can't have modifier 'abstract' here."
var message = problemMessage.messageText(includeUrl: false);
var modifierStart = message.indexOf("'") + 1;
var modifierStop = message.indexOf("'", modifierStart);

var modifierStart = message.indexOf(" '") + 2;
var modifierStop = message.indexOf("' ", modifierStart);

_modifierName = message.substring(modifierStart, modifierStop);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1767,8 +1767,8 @@ FfiCode.FFI_NATIVE_MUST_BE_EXTERNAL:
since: ~2.15
notes: |-
The fix is to add the `external` keyword.
? FfiCode.FFI_NATIVE_ONLY_CLASSES_EXTENDING_NATIVEFIELDWRAPPERCLASS1_CAN_BE_POINTER
: status: noFix
FfiCode.FFI_NATIVE_ONLY_CLASSES_EXTENDING_NATIVEFIELDWRAPPERCLASS1_CAN_BE_POINTER:
status: noFix
since: ~2.15
FfiCode.FFI_NATIVE_UNEXPECTED_NUMBER_OF_PARAMETERS:
status: noFix
Expand Down Expand Up @@ -2526,10 +2526,6 @@ ManifestWarningCode.UNSUPPORTED_CHROME_OS_HARDWARE:
status: noFix
ParserErrorCode.ABSTRACT_CLASS_MEMBER:
status: hasFix
ParserErrorCode.ABSTRACT_ENUM:
status: needsFix
notes: |-
Remove abstract keyword
ParserErrorCode.ABSTRACT_EXTERNAL_FIELD:
status: needsFix
notes: |-
Expand Down Expand Up @@ -2558,18 +2554,6 @@ ParserErrorCode.ABSTRACT_STATIC_METHOD:
status: needsFix
notes: |-
Remove the `abstract` keyword.
ParserErrorCode.ABSTRACT_TOP_LEVEL_FUNCTION:
status: needsFix
notes: |-
Remove the `abstract` keyword.
ParserErrorCode.ABSTRACT_TOP_LEVEL_VARIABLE:
status: needsFix
notes: |-
Remove the `abstract` keyword.
ParserErrorCode.ABSTRACT_TYPEDEF:
status: needsFix
notes: |-
Remove the `abstract` keyword.
ParserErrorCode.ANNOTATION_ON_TYPE_ARGUMENT:
status: needsFix
notes: |-
Expand Down Expand Up @@ -2622,10 +2606,6 @@ ParserErrorCode.CONST_CLASS:
status: hasFix
ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY:
status: noFix
ParserErrorCode.CONST_ENUM:
status: needsFix
notes: |-
Remove the `const` keyword.
ParserErrorCode.CONST_FACTORY:
status: needsFix
notes: |-
Expand All @@ -2634,10 +2614,6 @@ ParserErrorCode.CONST_METHOD:
status: needsFix
notes: |-
Remove the `const` keyword.
ParserErrorCode.CONST_TYPEDEF:
status: needsFix
notes: |-
Remove the `const` keyword.
ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE:
status: needsFix
notes: |-
Expand Down Expand Up @@ -2665,10 +2641,6 @@ ParserErrorCode.COVARIANT_MEMBER:
status: needsFix
notes: |-
Remove `covariant`.
ParserErrorCode.COVARIANT_TOP_LEVEL_DECLARATION:
status: needsFix
notes: |-
Remove `covariant`.
ParserErrorCode.DECLARATION_NAMED_AUGMENTED_INSIDE_AUGMENTATION:
status: noFix
ParserErrorCode.DEFAULT_IN_SWITCH_EXPRESSION:
Expand Down Expand Up @@ -2876,9 +2848,7 @@ ParserErrorCode.EXTERNAL_TYPEDEF:
notes: |-
Remove the `external` keyword.
ParserErrorCode.EXTRANEOUS_MODIFIER:
status: needsFix
notes: |-
Remove the extraneous keyword.
status: hasFix
ParserErrorCode.EXTRANEOUS_MODIFIER_IN_EXTENSION_TYPE:
status: needsEvaluation
ParserErrorCode.EXTRANEOUS_MODIFIER_IN_PRIMARY_CONSTRUCTOR:
Expand Down Expand Up @@ -2911,10 +2881,6 @@ ParserErrorCode.FINAL_AND_VAR:
status: needsFix
notes: |-
Remove either `final` or `var`.
ParserErrorCode.FINAL_CLASS:
status: needsFix
notes: |-
Remove the `final` keyword.
ParserErrorCode.FINAL_CONSTRUCTOR:
status: needsFix
notes: |-
Expand All @@ -2935,10 +2901,6 @@ ParserErrorCode.FINAL_MIXIN_CLASS:
status: needsFix
notes: |-
Remove the `final` keyword.
ParserErrorCode.FINAL_TYPEDEF:
status: needsFix
notes: |-
Remove the `final` keyword.
ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR:
status: noFix
ParserErrorCode.GETTER_CONSTRUCTOR:
Expand Down Expand Up @@ -3327,10 +3289,6 @@ ParserErrorCode.STATIC_SETTER_WITHOUT_BODY:
status: needsFix
notes: |-
Add an empty body.
ParserErrorCode.STATIC_TOP_LEVEL_DECLARATION:
status: needsFix
notes: |-
Remove the `static` keyword.
ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE:
status: needsFix
notes: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1348,6 +1348,9 @@ final _builtInNonLintProducers = <ErrorCode, List<ProducerGenerator>>{
ParserErrorCode.EXTENSION_DECLARES_CONSTRUCTOR: [
RemoveConstructor.new,
],
ParserErrorCode.EXTRANEOUS_MODIFIER: [
RemoveExtraModifier.new,
],
ParserErrorCode.GETTER_WITH_PARAMETERS: [
RemoveParametersInGetterDeclaration.new,
],
Expand Down
47 changes: 47 additions & 0 deletions pkg/analysis_server/test/lsp/diagnostic_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,53 @@ version: latest
]));
}

/// Test that when server has produced diagnostics for a file and it is
/// subsequently removed, that an update from the plugin does not cause
/// the last diagnostics from the server to re-appear (which happens if the
/// deletion does not clear the servers errors from the ErrorCollector).
///
/// https://github.com/Dart-Code/Dart-Code/issues/5113
Future<void> test_fromPlugins_dartFile_producedAfterFileRemoved() async {
var serverErrorMessage =
"A value of type 'int' can't be assigned to a variable of type 'String'";
var pluginErrorMessage = 'Test error from plugin';

// First, trigger a diagnostic from the server.
newFile(mainFilePath, 'String a = 1;');
var diagnosticsFuture = waitForDiagnostics(mainFileUri);
await initialize();

// Expect only the server diagnostic.
expect((await diagnosticsFuture)!.single.message,
contains(serverErrorMessage));

// Delete the file, and expect diagnostics to be cleared.
diagnosticsFuture = waitForDiagnostics(mainFileUri);
deleteFile(mainFilePath);
expect((await diagnosticsFuture)!, hasLength(0));

// Trigger a plugin diagnostic. In reality, the plugin would probalby
// produce 0 diagnostics after the file is removed, but since the LSP server
// has an optimization to not send empty diagnostics if the last update was
// empty, we wouldn't be able wait for that so we just use a real diagnostic
// (which is still realistic since plugins might have not processed the
// remove yet).
diagnosticsFuture = waitForDiagnostics(mainFileUri);
var pluginError = plugin.AnalysisError(
plugin.AnalysisErrorSeverity.ERROR,
plugin.AnalysisErrorType.STATIC_TYPE_WARNING,
plugin.Location(mainFilePath, 0, 1, 0, 0, endLine: 0, endColumn: 1),
pluginErrorMessage,
'ERR1',
);
var pluginResult = plugin.AnalysisErrorsParams(mainFilePath, [pluginError]);
configureTestPlugin(notification: pluginResult.toNotification());

// Wait for the diagnostic updated and ensure it's still empty and no stale
// error has come back.
expect((await diagnosticsFuture)!.single.message, pluginErrorMessage);
}

Future<void> test_fromPlugins_nonDartFile() async {
await checkPluginErrorsForFile(join(projectFolderPath, 'lib', 'foo.sql'));
}
Expand Down
Loading

0 comments on commit 1d4f535

Please sign in to comment.