Skip to content

Commit

Permalink
Version 3.3.0-125.0.dev
Browse files Browse the repository at this point in the history
Merge 6b5b3cc into dev
  • Loading branch information
Dart CI committed Nov 13, 2023
2 parents 95da64a + 6b5b3cc commit 0b8e572
Show file tree
Hide file tree
Showing 69 changed files with 2,239 additions and 93 deletions.
11 changes: 10 additions & 1 deletion pkg/_fe_analyzer_shared/lib/src/testing/id_testing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,13 @@ Future<void> runTests<T>(Directory dataDir,
}
}

const String _dartLocationMessage = """
* Note that the 'dart' executable *must* be the one
located in the 'dart-sdk/bin' folder of the build
directory, for instance
out/ReleaseX64/dart-sdk/bin/dart""";

/// Generates an error message for the [mismatches] and [errors] using
/// [markerOptions] to provide a re-run/re-generation command.
///
Expand Down Expand Up @@ -1031,8 +1038,9 @@ String generateErrorMessage(MarkerOptions markerOptions,
}
message.writeln();
});
message.writeln();
message.writeln(_dartLocationMessage);
}
message.writeln();
if (errors.isNotEmpty) {
Map<MarkerTester, Set<String>> erroneous = {};
errors.forEach((String testName, Set<String> markers) {
Expand All @@ -1055,6 +1063,7 @@ String generateErrorMessage(MarkerOptions markerOptions,
}
message.writeln();
});
message.writeln(_dartLocationMessage);
}
message.writeln();
message.writeln('==========================================================');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import 'dart:convert' hide JsonDecoder;
import 'package:analysis_server_client/src/protocol/protocol_base.dart';
import 'package:analysis_server_client/src/protocol/protocol_internal.dart';

// ignore_for_file: flutter_style_todos

/// AddContentOverlay
///
/// {
Expand Down
1 change: 1 addition & 0 deletions pkg/analyzer_cli/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ linter:
directives_ordering: true
empty_catches: true
enable_null_safety: true
flutter_style_todos: true

# We import heavily from package:analyzer/src.
implementation_imports: false
Expand Down
4 changes: 2 additions & 2 deletions pkg/analyzer_cli/lib/src/driver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class Driver implements CommandLineStarter {
// time during the following analysis.
SeverityProcessor defaultSeverityProcessor;
defaultSeverityProcessor = (AnalysisError error) {
// TODO(pq) get file path from `error.source.fullName`
// TODO(pq): get file path from `error.source.fullName`
return determineProcessedSeverity(
error, options, analysisDriver!.analysisOptions);
};
Expand Down Expand Up @@ -507,7 +507,7 @@ class _AnalysisContextProvider {
return _analysisContext!.driver;
}

/// TODO(scheglov) Use analyzedFiles()
// TODO(scheglov): Use analyzedFiles()
PathFilter get pathFilter {
var contextRoot = analysisContext!.contextRoot;
var optionsFile = contextRoot.optionsFile;
Expand Down
2 changes: 1 addition & 1 deletion pkg/analyzer_cli/lib/src/error_formatter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ class HumanErrorFormatter extends ErrorFormatter {
}
var contextMessages = <ContextMessage>[];
for (var message in error.contextMessages) {
// TODO(scheglov) We should add `LineInfo` to `DiagnosticMessage`.
// TODO(scheglov): We should add `LineInfo` to `DiagnosticMessage`.
var session = result.session.analysisContext;
if (session is DriverBasedAnalysisContext) {
var fileResult = session.driver.getFileSync(message.filePath);
Expand Down
8 changes: 4 additions & 4 deletions pkg/analyzer_cli/lib/src/options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,14 @@ class CommandLineOptions {
for (var variable in variables) {
var index = variable.indexOf('=');
if (index < 0) {
// TODO (brianwilkerson) Decide the semantics we want in this case.
// TODO(brianwilkerson): Decide the semantics we want in this case.
// The VM prints "No value given to -D option", then tries to load '-Dfoo'
// as a file and dies. Unless there was nothing after the '-D', in which
// case it prints the warning and ignores the option.
} else {
var name = variable.substring(0, index);
if (name.isNotEmpty) {
// TODO (brianwilkerson) Decide the semantics we want in the case where
// TODO(brianwilkerson): Decide the semantics we want in the case where
// there is no name. If there is no name, the VM tries to load a file
// named '-D' and dies.
declaredVariables[name] = variable.substring(index + 1);
Expand Down Expand Up @@ -299,8 +299,8 @@ class CommandLineOptions {
/// are those that are typically used to control the way in which the code is
/// analyzed.
///
/// TODO(danrubel) Update DDC to support all the options defined in this method
/// then remove the [ddc] named argument from this method.
// TODO(danrubel): Update DDC to support all the options defined in this method
// then remove the [ddc] named argument from this method.
static void _defineAnalysisArguments(ArgParser parser,
{bool hide = true, bool ddc = false}) {
parser.addOption(_sdkPathOption,
Expand Down
1 change: 1 addition & 0 deletions pkg/analyzer_plugin/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ linter:
#dangling_library_doc_comments: true
depend_on_referenced_packages: true
enable_null_safety: true
flutter_style_todos: true
implicit_call_tearoffs: true
library_annotations: true
omit_local_variable_types: true
Expand Down
4 changes: 2 additions & 2 deletions pkg/analyzer_plugin/lib/plugin/plugin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,13 @@ abstract class ServerPlugin {
for (var event in parameters.events) {
switch (event.type) {
case WatchEventType.ADD:
// TODO(brianwilkerson) Handle the event.
// TODO(brianwilkerson): Handle the event.
break;
case WatchEventType.MODIFY:
await contentChanged([event.path]);
break;
case WatchEventType.REMOVE:
// TODO(brianwilkerson) Handle the event.
// TODO(brianwilkerson): Handle the event.
break;
default:
// Ignore unhandled watch event types.
Expand Down
2 changes: 2 additions & 0 deletions pkg/analyzer_plugin/lib/protocol/protocol_common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import 'dart:convert' hide JsonDecoder;
import 'package:analyzer_plugin/protocol/protocol.dart';
import 'package:analyzer_plugin/src/protocol/protocol_internal.dart';

// ignore_for_file: flutter_style_todos

/// AddContentOverlay
///
/// {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class DartEditBuilderImpl extends EditBuilderImpl implements DartEditBuilder {
String? nameGroupName,
DartType? superclass,
String? superclassGroupName}) {
// TODO(brianwilkerson) Add support for type parameters, probably as a
// TODO(brianwilkerson): Add support for type parameters, probably as a
// parameterWriter parameter.
if (isAbstract) {
write(Keyword.ABSTRACT.lexeme);
Expand All @@ -111,7 +111,7 @@ class DartEditBuilderImpl extends EditBuilderImpl implements DartEditBuilder {
write(' extends ');
writeType(superclass, groupName: superclassGroupName);
} else if (mixins != null && mixins.isNotEmpty) {
// TODO(brianwilkerson) Remove this branch when 2.1 semantics are
// TODO(brianwilkerson): Remove this branch when 2.1 semantics are
// supported everywhere.
write(' extends Object ');
}
Expand Down Expand Up @@ -361,7 +361,7 @@ class DartEditBuilderImpl extends EditBuilderImpl implements DartEditBuilder {
void Function()? membersWriter,
String? nameGroupName,
Iterable<DartType>? superclassConstraints}) {
// TODO(brianwilkerson) Add support for type parameters, probably as a
// TODO(brianwilkerson): Add support for type parameters, probably as a
// parameterWriter parameter.
write('mixin ');
if (nameGroupName == null) {
Expand Down Expand Up @@ -681,7 +681,7 @@ class DartEditBuilderImpl extends EditBuilderImpl implements DartEditBuilder {

@override
void writeParametersMatchingArguments(ArgumentList argumentList) {
// TODO(brianwilkerson) Handle the case when there are required parameters
// TODO(brianwilkerson): Handle the case when there are required parameters
// after named parameters.
var usedNames = <String>{};
List<Expression> arguments = argumentList.arguments;
Expand Down Expand Up @@ -734,7 +734,7 @@ class DartEditBuilderImpl extends EditBuilderImpl implements DartEditBuilder {
write(' ');
}
}
// TODO(brianwilkerson) The name of the setter is unlikely to be a good name
// TODO(brianwilkerson): The name of the setter is unlikely to be a good name
// for the parameter. We need to find a better name to produce here.
write(name);
write(') ');
Expand Down Expand Up @@ -917,7 +917,7 @@ class DartEditBuilderImpl extends EditBuilderImpl implements DartEditBuilder {
}

if (type is RecordType) {
// TODO(brianwilkerson) This should return `false` if the `records`
// TODO(brianwilkerson): This should return `false` if the `records`
// feature is not enabled.
return true;
}
Expand Down Expand Up @@ -1069,7 +1069,7 @@ class DartEditBuilderImpl extends EditBuilderImpl implements DartEditBuilder {
if (suggestions.isNotEmpty) {
return suggestions;
}
// TODO(brianwilkerson) Verify that the name below is not in the set of used names.
// TODO(brianwilkerson): Verify that the name below is not in the set of used names.
return <String>['param$index'];
}

Expand Down Expand Up @@ -1163,7 +1163,7 @@ class DartEditBuilderImpl extends EditBuilderImpl implements DartEditBuilder {
return;
}

// TODO(scheglov) We should use "methodBeingCopied" to verify that
// TODO(scheglov): We should use "methodBeingCopied" to verify that
// we really are just copying this type parameter.
if (element is TypeParameterElement) {
return;
Expand Down Expand Up @@ -1295,7 +1295,7 @@ class DartEditBuilderImpl extends EditBuilderImpl implements DartEditBuilder {
}

if (type is RecordType) {
// TODO(brianwilkerson) This should return `false` if the `records`
// TODO(brianwilkerson): This should return `false` if the `records`
// feature is not enabled. More importantly, we can't currently return
// `false` if some portion of a type has already been written, so we
// need to figure out what to do when a record type is nested in another
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class CompletionTarget {
// Try to replace with a comment token.
var commentToken = _getContainingCommentToken(entity, offset);
if (commentToken != null) {
// TODO(scheglov) This is duplicate of the code below.
// TODO(scheglov): This is duplicate of the code below.
// If the preceding comment is dartdoc token, then update
// the containing node to be the dartdoc comment.
// Otherwise completion is not required.
Expand Down
12 changes: 6 additions & 6 deletions pkg/analyzer_plugin/lib/src/utilities/completion/optype.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class OpType {

/// Indicates whether the completion location requires a constant expression
/// without being a constant context.
// TODO(brianwilkerson) Consider using this value to control whether non-const
// TODO(brianwilkerson): Consider using this value to control whether non-const
// elements are suggested.
bool mustBeConst = false;

Expand Down Expand Up @@ -313,7 +313,7 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor<void> {
optype.includeTypeNameSuggestions = true;
} else if (identical(entity, node.message)) {
optype.completionLocation = 'AssertInitializer_message';
// TODO(brianwilkerson) Consider including return value suggestions and
// TODO(brianwilkerson): Consider including return value suggestions and
// type name suggestions here.
}
}
Expand All @@ -326,7 +326,7 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor<void> {
optype.includeTypeNameSuggestions = true;
} else if (identical(entity, node.message)) {
optype.completionLocation = 'AssertStatement_message';
// TODO(brianwilkerson) Consider including return value suggestions and
// TODO(brianwilkerson): Consider including return value suggestions and
// type name suggestions here.
}
}
Expand Down Expand Up @@ -623,7 +623,7 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor<void> {
type = parent.staticType;
if (type is FunctionType) {
if (type.returnType is VoidType) {
// TODO(brianwilkerson) Determine whether the return type can ever
// TODO(brianwilkerson): Determine whether the return type can ever
// be inferred as void and remove this case if it can't be.
optype.includeVoidReturnSuggestions = true;
} else {
Expand Down Expand Up @@ -1075,7 +1075,7 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor<void> {
identical(entity, node.name) && node.returnType == null) {
optype.completionLocation = 'MethodDeclaration_returnType';
}
// TODO(brianwilkerson) In visitFunctionDeclaration, this is conditional. It
// TODO(brianwilkerson): In visitFunctionDeclaration, this is conditional. It
// seems like it should be the same in both places.
optype.includeTypeNameSuggestions = true;
}
Expand Down Expand Up @@ -1769,7 +1769,7 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor<void> {
} else if (parent is FunctionExpressionInvocation) {
return 'function';
} else if (parent is InstanceCreationExpression) {
// TODO(brianwilkerson) Enable this case.
// TODO(brianwilkerson): Enable this case.
// if (flutter.isWidgetType(parent.staticType)) {
// return 'widgetConstructor';
// }
Expand Down
12 changes: 6 additions & 6 deletions pkg/analyzer_plugin/lib/utilities/analyzer_converter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class AnalyzerConverter {
} else if (element is analyzer.FieldElement && element.isEnumConstant
// MyEnum.values and MyEnum.one.index return isEnumConstant = true
// so these additional checks are necessary.
// TODO(danrubel) MyEnum.values is constant, but is a list
// TODO(danrubel): MyEnum.values is constant, but is a list
// so should it return isEnumConstant = true?
// MyEnum.one.index is final but *not* constant
// so should it return isEnumConstant = true?
Expand All @@ -195,7 +195,7 @@ class AnalyzerConverter {
/// Return a textual representation of the parameters of the given [element],
/// or `null` if the element does not have any parameters.
String? _getParametersString(analyzer.Element element) {
// TODO(scheglov) expose the corresponding feature from ExecutableElement
// TODO(scheglov): expose the corresponding feature from ExecutableElement
List<analyzer.ParameterElement> parameters;
if (element is analyzer.ExecutableElement) {
// valid getters don't have parameters
Expand Down Expand Up @@ -272,7 +272,7 @@ class AnalyzerConverter {
}

bool _isAbstract(analyzer.Element element) {
// TODO(scheglov) add isAbstract to Element API
// TODO(scheglov): add isAbstract to Element API
if (element is analyzer.ClassElement) {
return element.isAbstract;
} else if (element is analyzer.MethodElement) {
Expand All @@ -284,7 +284,7 @@ class AnalyzerConverter {
}

bool _isConst(analyzer.Element element) {
// TODO(scheglov) add isConst to Element API
// TODO(scheglov): add isConst to Element API
if (element is analyzer.ConstructorElement) {
return element.isConst;
} else if (element is analyzer.VariableElement) {
Expand All @@ -294,15 +294,15 @@ class AnalyzerConverter {
}

bool _isFinal(analyzer.Element element) {
// TODO(scheglov) add isFinal to Element API
// TODO(scheglov): add isFinal to Element API
if (element is analyzer.VariableElement) {
return element.isFinal;
}
return false;
}

bool _isStatic(analyzer.Element element) {
// TODO(scheglov) add isStatic to Element API
// TODO(scheglov): add isStatic to Element API
if (element is analyzer.ExecutableElement) {
return element.isStatic;
} else if (element is analyzer.PropertyInducingElement) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ class _DartNavigationComputerVisitor extends RecursiveAstVisitor<void> {
if (resolvedUri is DirectiveUriWithSource) {
final source = resolvedUri.source;
if (resourceProvider.getResource(source.fullName).exists) {
// TODO(brianwilkerson) If the analyzer ever resolves the URI to a
// TODO(brianwilkerson): If the analyzer ever resolves the URI to a
// library, use that library element to create the region.
var uriNode = node.uri;
if (computer._isWithinRequestedRange(uriNode.offset, uriNode.length)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ abstract class AbstractAnalysisServerIntegrationTest
currentAnalysisErrors[params.file] = params.errors;
});
var serverConnected = Completer();
// TODO(brianwilkerson) Implement this.
// TODO(brianwilkerson): Implement this.
// onServerConnected.listen((_) {
// outOfTestExpect(serverConnected.isCompleted, isFalse);
// serverConnected.complete();
Expand Down Expand Up @@ -185,7 +185,7 @@ abstract class AbstractAnalysisServerIntegrationTest
/// can be used.
Future standardAnalysisSetup({bool subscribeStatus = true}) {
var futures = <Future>[];
// TODO(brianwilkerson) Implement this.
// TODO(brianwilkerson): Implement this.
// if (subscribeStatus) {
// futures.add(sendServerSetSubscriptions([ServerService.STATUS]));
// }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import 'package:test/test.dart';

import 'integration_tests.dart';

// ignore_for_file: flutter_style_todos

/// AddContentOverlay
///
/// {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class PluginIsolateChannelTest {
done = true;
});
channel.close();
// TODO(brianwilkerson) Figure out how to wait until the handler has been
// TODO(brianwilkerson): Figure out how to wait until the handler has been
// called.
await _pumpEventQueue();
expect(done, isTrue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ class FileEditBuilderImplTest extends AbstractChangeBuilderTest {
}

Future<void> test_addDeletion_adjacent_lowerOffsetFirst() async {
// TODO(brianwilkerson) This should also merge the deletions, but is written
// TODO(brianwilkerson): This should also merge the deletions, but is written
// to ensure that existing uses of FileEditBuilder continue to work even
// without that change.
var firstOffset = 23;
Expand All @@ -337,7 +337,7 @@ class FileEditBuilderImplTest extends AbstractChangeBuilderTest {
}

Future<void> test_addDeletion_adjacent_lowerOffsetSecond() async {
// TODO(brianwilkerson) This should also merge the deletions, but is written
// TODO(brianwilkerson): This should also merge the deletions, but is written
// to ensure that existing uses of FileEditBuilder continue to work even
// without that change.
var firstOffset = 23;
Expand Down
Loading

0 comments on commit 0b8e572

Please sign in to comment.