Skip to content

Commit

Permalink
Version 3.8.0-63.0.dev
Browse files Browse the repository at this point in the history
Merge 4f80ed7 into dev
  • Loading branch information
Dart CI committed Feb 1, 2025
2 parents e239d06 + 4f80ed7 commit a373214
Show file tree
Hide file tree
Showing 85 changed files with 198 additions and 863 deletions.
8 changes: 4 additions & 4 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ vars = {
# instructions. d8, the V8 shell, is always checked out.
"checkout_javascript_engines": False,
"d8_tag": "version:13.4.32",
"jsshell_tag": "version:134.0",
"jsshell_tag": "version:134.0.2",
"jsc_tag": "version:288804",

# https://chrome-infra-packages.appspot.com/p/fuchsia/third_party/clang
Expand Down Expand Up @@ -101,7 +101,7 @@ vars = {
"boringssl_rev": "d3f26f8af0853b4d337d2405281f91fdfbe64465",
"browser-compat-data_tag": "ac8cae697014da1ff7124fba33b0b4245cc6cd1b", # v1.0.22
"cpu_features_rev": "936b9ab5515dead115606559502e3864958f7f6e",
"devtools_rev": "8762b31f0d0ffeea6449fd02740e9ce7acb32503",
"devtools_rev": "b38abb81337b10c4b675d418e50f82a5fe6a894d",
"icu_rev": "43953f57b037778a1b8005564afabe214834f7bd",
"jinja2_rev": "2222b31554f03e62600cd7e383376a7c187967a1",
"libcxx_rev": "44079a4cc04cdeffb9cfe8067bfb3c276fb2bab0",
Expand Down Expand Up @@ -165,9 +165,9 @@ vars = {
# meant to be downloaded by users for local testing. You can self-service
# update these by following the go/dart-engprod/browsers.md instructions.
"download_chrome": False,
"chrome_tag": "133.0.6943.16",
"chrome_tag": "133.0.6943.35",
"download_firefox": False,
"firefox_tag": "134.0.1",
"firefox_tag": "134.0.2",

# Emscripten is used in dart2wasm tests.
"download_emscripten": False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,6 @@ class _DartUnitHighlightsComputerVisitor extends RecursiveAstVisitor<void> {
node.augmentKeyword,
HighlightRegionType.BUILT_IN,
);
computer._addRegion_token(node.macroKeyword, HighlightRegionType.BUILT_IN);
computer._addRegion_token(
node.abstractKeyword,
HighlightRegionType.BUILT_IN,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import 'package:analysis_server/src/services/correction/assist_internal.dart';
import 'package:analysis_server_plugin/src/correction/dart_change_workspace.dart';
import 'package:analyzer/dart/analysis/session.dart';
import 'package:analyzer/src/exception/exception.dart';
import 'package:analyzer/src/util/file_paths.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart';
import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin;

Expand Down Expand Up @@ -45,10 +44,6 @@ class EditGetAssistsHandler extends LegacyHandler
if (server.sendResponseErrorIfInvalidFilePath(request, file)) {
return;
}
if (isMacroGenerated(file)) {
sendResult(EditGetAssistsResult([]));
return;
}
//
// Allow plugins to start computing assists.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import 'package:analysis_server/src/handler/legacy/legacy_handler.dart';
import 'package:analysis_server/src/services/refactoring/legacy/refactoring.dart';
import 'package:analyzer/dart/element/element2.dart';
import 'package:analyzer/src/dart/ast/utilities.dart';
import 'package:analyzer/src/util/file_paths.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart';

/// The handler for the `edit.getAvailableRefactorings` request.
Expand All @@ -36,10 +35,6 @@ class EditGetAvailableRefactoringsHandler extends LegacyHandler {
if (server.sendResponseErrorIfInvalidFilePath(request, file)) {
return;
}
if (isMacroGenerated(file)) {
sendResult(EditGetAvailableRefactoringsResult([]));
return;
}

// add refactoring kinds
var kinds = <RefactoringKind>[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import 'package:analyzer/src/generated/source.dart' show SourceFactory;
import 'package:analyzer/src/pubspec/pubspec_validator.dart';
import 'package:analyzer/src/task/options.dart';
import 'package:analyzer/src/util/file_paths.dart' as file_paths;
import 'package:analyzer/src/util/file_paths.dart';
import 'package:analyzer/src/workspace/pub.dart';
import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin;
import 'package:yaml/yaml.dart';
Expand Down Expand Up @@ -62,10 +61,6 @@ class EditGetFixesHandler extends LegacyHandler
server.sendResponse(Response.getFixesInvalidFile(request));
return;
}
if (isMacroGenerated(file)) {
sendResult(EditGetFixesResult([]));
return;
}

//
// Allow plugins to start computing fixes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ import 'package:analysis_server_plugin/src/correction/fix_generators.dart';
import 'package:analyzer/error/error.dart';
import 'package:analyzer/src/dart/ast/utilities.dart';
import 'package:analyzer/src/generated/java_core.dart';
import 'package:analyzer/src/util/file_paths.dart';
import 'package:analyzer_plugin/utilities/assist/assist.dart'
hide AssistContributor;
import 'package:analyzer_plugin/utilities/change_builder/change_builder_core.dart';
Expand Down Expand Up @@ -178,9 +177,6 @@ class AssistProcessor {
AssistProcessor(this._assistContext);

Future<List<Assist>> compute() async {
if (isMacroGenerated(_assistContext.unitResult.file.path)) {
return _assists;
}
await _addFromProducers();
return _assists;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,7 @@ class BulkFixProcessor {
}) async {
var pathContext = context.contextRoot.resourceProvider.pathContext;

if (file_paths.isDart(pathContext, path) &&
!file_paths.isGenerated(path) &&
!file_paths.isMacroGenerated(path)) {
if (file_paths.isDart(pathContext, path) && !file_paths.isGenerated(path)) {
var libraryResult = await performance.runAsync(
'getResolvedLibrary',
(_) => context.currentSession.getResolvedContainingLibrary(path),
Expand Down Expand Up @@ -257,8 +255,7 @@ class BulkFixProcessor {
var pathContext = context.contextRoot.resourceProvider.pathContext;
for (var path in context.contextRoot.analyzedFiles()) {
if (!file_paths.isDart(pathContext, path) ||
file_paths.isGenerated(path) ||
file_paths.isMacroGenerated(path)) {
file_paths.isGenerated(path)) {
continue;
}

Expand Down Expand Up @@ -397,8 +394,7 @@ class BulkFixProcessor {

for (var path in context.contextRoot.analyzedFiles()) {
if (!file_paths.isDart(pathContext, path) ||
file_paths.isGenerated(path) ||
file_paths.isMacroGenerated(path)) {
file_paths.isGenerated(path)) {
continue;
}
var package = workspace.findPackageFor(path);
Expand Down Expand Up @@ -510,8 +506,7 @@ class BulkFixProcessor {
var pathContext = context.contextRoot.resourceProvider.pathContext;
for (var path in context.contextRoot.analyzedFiles()) {
if (!file_paths.isDart(pathContext, path) ||
file_paths.isGenerated(path) ||
file_paths.isMacroGenerated(path)) {
file_paths.isGenerated(path)) {
continue;
}

Expand Down Expand Up @@ -831,8 +826,7 @@ class BulkFixProcessor {
for (var path in context.contextRoot.analyzedFiles()) {
var pathContext = context.contextRoot.resourceProvider.pathContext;
if (!file_paths.isDart(pathContext, path) ||
file_paths.isGenerated(path) ||
file_paths.isMacroGenerated(path)) {
file_paths.isGenerated(path)) {
continue;
}
var unitResult =
Expand Down Expand Up @@ -905,8 +899,7 @@ class BulkFixProcessor {
for (var path in context.contextRoot.analyzedFiles()) {
var pathContext = context.contextRoot.resourceProvider.pathContext;
if (!file_paths.isDart(pathContext, path) ||
file_paths.isGenerated(path) ||
file_paths.isMacroGenerated(path)) {
file_paths.isGenerated(path)) {
continue;
}
var unitResult =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -966,8 +966,6 @@ CompileTimeErrorCode.INVALID_INLINE_FUNCTION_TYPE:
status: needsFix
notes: |-
Replace with the equivalent generic function type.
CompileTimeErrorCode.INVALID_MACRO_APPLICATION_TARGET:
status: noFix
CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR:
status: hasFix
CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER:
Expand Down Expand Up @@ -1023,18 +1021,6 @@ CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY:
status: hasFix
CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE:
status: needsEvaluation
CompileTimeErrorCode.MACRO_DECLARATIONS_PHASE_INTROSPECTION_CYCLE:
status: needsEvaluation
CompileTimeErrorCode.MACRO_DEFINITION_APPLICATION_SAME_LIBRARY_CYCLE:
status: noFix
CompileTimeErrorCode.MACRO_APPLICATION_ARGUMENT_ERROR:
status: noFix
CompileTimeErrorCode.MACRO_ERROR:
status: noFix
CompileTimeErrorCode.MACRO_INTERNAL_EXCEPTION:
status: noFix
CompileTimeErrorCode.MACRO_NOT_ALLOWED_DECLARATION:
status: noFix
CompileTimeErrorCode.MAIN_FIRST_POSITIONAL_PARAMETER_TYPE:
status: needsFix
notes: |-
Expand Down Expand Up @@ -1844,8 +1830,6 @@ HintCode.DEPRECATED_MEMBER_USE_WITH_MESSAGE:
status: hasFix
HintCode.IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION:
status: noFix
HintCode.MACRO_INFO:
status: noFix
HintCode.UNNECESSARY_IMPORT:
status: hasFix
LintCode.always_declare_return_types_of_functions:
Expand Down Expand Up @@ -3644,8 +3628,6 @@ WarningCode.INVALID_VISIBLE_FOR_OVERRIDING_ANNOTATION:
status: hasFix
WarningCode.INVALID_VISIBLE_OUTSIDE_TEMPLATE_ANNOTATION:
status: needsEvaluation
WarningCode.MACRO_WARNING:
status: noFix
WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_ONE:
status: hasFix
WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_TWO:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ class _MatcherBuilder {
var enclosingElement = element.enclosingElement2;
if (enclosingElement is! LibraryElement2) {
_addMatcher(
components: [node.name, (enclosingElement?.displayName)!],
components: [node.name, enclosingElement.displayName],
kinds: [],
);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/element/element2.dart';
import 'package:analyzer/src/dart/analysis/session_helper.dart';
import 'package:analyzer/src/util/file_paths.dart';
import 'package:analyzer_plugin/utilities/range_factory.dart';

/// [ConvertMethodToGetterRefactoring] implementation.
Expand Down Expand Up @@ -141,8 +140,6 @@ class ConvertGetterToMethodRefactoringImpl extends RefactoringImpl
var matches = await searchEngine.searchReferences(element);
var references = getSourceReferences(matches);
for (var reference in references) {
// Don't update references in macro-generated files.
if (isMacroGenerated(reference.file)) continue;
var refRange = reference.range;
// insert "()"
var edit = SourceEdit(refRange.end, 0, '()');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import 'package:analyzer/dart/element/element2.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/src/dart/analysis/session_helper.dart';
import 'package:analyzer/src/dart/ast/utilities.dart';
import 'package:analyzer/src/util/file_paths.dart';
import 'package:analyzer_plugin/utilities/range_factory.dart';

/// [ConvertMethodToGetterRefactoring] implementation.
Expand Down Expand Up @@ -141,9 +140,6 @@ class ConvertMethodToGetterRefactoringImpl extends RefactoringImpl
var matches = await searchEngine.searchReferences(element);
var references = getSourceReferences(matches);
for (var reference in references) {
// Don't update references in macro-generated files.
if (isMacroGenerated(reference.file)) continue;

var refElement = reference.element2;
var refRange = reference.range;
// prepare invocation
Expand Down
14 changes: 0 additions & 14 deletions pkg/analysis_server/test/edit/bulk_fixes_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -377,20 +377,6 @@ linter:
class A {}
//ignore: unnecessary_new
A f() => new A();
''');
await assertNoEdits();
}

Future<void> test_unnecessaryNew_macroGenerated() async {
newAnalysisOptionsYamlFile(testPackageRootPath, '''
linter:
rules:
- unnecessary_new
''');
var macroFilePath = join(testPackageLibPath, 'test.macro.dart');
newFile(macroFilePath, '''
class A {}
A f() => new A();
''');
await assertNoEdits();
}
Expand Down
34 changes: 0 additions & 34 deletions pkg/analysis_server/test/edit/refactoring_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'dart:async';
import 'package:analysis_server/protocol/protocol.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
import 'package:analysis_server/src/services/refactoring/legacy/refactoring_manager.dart';
import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
Expand Down Expand Up @@ -964,27 +963,6 @@ class GetAvailableRefactoringsTest extends PubPackageAnalysisServerTest {
return getRefactorings(offset, search.length);
}

/// Returns the list of available refactorings for the given [offset] and
/// [length].
Future<void> getRefactoringsInFile(File file, int offset, int length) async {
var request = EditGetAvailableRefactoringsParams(
file.path,
offset,
length,
).toRequest('0', clientUriConverter: server.uriConverter);
var response = await serverChannel.simulateRequestFromClient(request);
var result = EditGetAvailableRefactoringsResult.fromResponse(
response,
clientUriConverter: server.uriConverter,
);
kinds = result.kinds;
}

Future<void> getRefactoringsInFileForString(File file, String search) {
var offset = offsetInFile(file, search);
return getRefactoringsInFile(file, offset, search.length);
}

@override
Future<void> setUp() async {
super.setUp();
Expand Down Expand Up @@ -1014,18 +992,6 @@ void f() {
expect(kinds, contains(RefactoringKind.EXTRACT_METHOD));
}

Future<void> test_extractLocal_macroGenerated() async {
var macroFilePath = join(testPackageLibPath, 'test.macro.dart');
var generatedFile = newFile(macroFilePath, '''
void f() {
var a = 1 + 2;
}
''');
await waitForTasksFinished();
await getRefactoringsInFileForString(generatedFile, '1 + 2');
expect(kinds, isEmpty);
}

Future<void> test_extractLocal_withoutSelection() async {
addTestFile('''
void f() {
Expand Down
18 changes: 0 additions & 18 deletions pkg/analysis_server/test/lsp/code_actions_assists_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -166,24 +166,6 @@ Future? f;
expectCommandLogged('dart.assist.add.showCombinator');
}

Future<void> test_macroGenerated() async {
setDartTextDocumentContentProviderSupport();
var macroFilePath = join(projectFolderPath, 'lib', 'test.macro.dart');
var code = TestCode.parse('''
int f() {
ret^urn 0;
}
''');
newFile(macroFilePath, code.code);
await initialize();

var codeActions = await getCodeActions(
uriConverter.toClientUri(macroFilePath),
position: code.position.position,
);
expect(codeActions, isEmpty);
}

Future<void> test_nonDartFile() async {
setSupportedCodeActionKinds([CodeActionKind.Refactor]);

Expand Down
18 changes: 0 additions & 18 deletions pkg/analysis_server/test/lsp/code_actions_fixes_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -546,24 +546,6 @@ Future foo;
expectCommandLogged('dart.fix.remove.unusedImport');
}

Future<void> test_macroGenerated() async {
setDartTextDocumentContentProviderSupport();
var macroFilePath = join(projectFolderPath, 'lib', 'test.macro.dart');
var code = TestCode.parse('''
void f() {
js^on.encode('');
}
''');
newFile(macroFilePath, code.code);
await initialize();

var codeActions = await getCodeActions(
uriConverter.toClientUri(macroFilePath),
position: code.position.position,
);
expect(codeActions, isEmpty);
}

/// Repro for https://github.com/Dart-Code/Dart-Code/issues/4462.
///
/// Original code only included a fix on its first error (which in this sample
Expand Down
Loading

0 comments on commit a373214

Please sign in to comment.