diff --git a/pkg/analysis_server/analysis_options.yaml b/pkg/analysis_server/analysis_options.yaml index 092df91c9a6..7f4995e0560 100644 --- a/pkg/analysis_server/analysis_options.yaml +++ b/pkg/analysis_server/analysis_options.yaml @@ -29,6 +29,7 @@ analyzer: linter: rules: + - flutter_style_todos - library_annotations - prefer_single_quotes - unawaited_futures diff --git a/pkg/analysis_server/benchmark/integration/input_converter.dart b/pkg/analysis_server/benchmark/integration/input_converter.dart index 2c72d565c8f..feb2cebd472 100644 --- a/pkg/analysis_server/benchmark/integration/input_converter.dart +++ b/pkg/analysis_server/benchmark/integration/input_converter.dart @@ -124,7 +124,7 @@ abstract class CommonInputConverter extends Converter { if (method == COMPLETION_REQUEST_GET_SUGGESTIONS) { return CompletionRequestOperation(this, json); } - // TODO(danrubel) replace this with code + // TODO(danrubel): replace this with code // that just forwards the translated request if (method == ANALYSIS_REQUEST_GET_HOVER || method == ANALYSIS_REQUEST_SET_ANALYSIS_ROOTS || diff --git a/pkg/analysis_server/benchmark/integration/operation.dart b/pkg/analysis_server/benchmark/integration/operation.dart index 3f45df782f9..0f16aa49873 100644 --- a/pkg/analysis_server/benchmark/integration/operation.dart +++ b/pkg/analysis_server/benchmark/integration/operation.dart @@ -202,7 +202,7 @@ class WaitForAnalysisCompleteOperation extends Operation { }); timer = Timer.periodic(Duration(milliseconds: 20), (_) { if (!isAnalyzing) { - // TODO (danrubel) revisit this once source change requests are implemented + // TODO(danrubel): revisit this once source change requests are implemented subscription.cancel(); timer.cancel(); driver.logger.log(Level.INFO, 'analysis never started'); diff --git a/pkg/analysis_server/lib/plugin/protocol/protocol_dart.dart b/pkg/analysis_server/lib/plugin/protocol/protocol_dart.dart index b453668cae5..f66f7913dc1 100644 --- a/pkg/analysis_server/lib/plugin/protocol/protocol_dart.dart +++ b/pkg/analysis_server/lib/plugin/protocol/protocol_dart.dart @@ -144,7 +144,7 @@ String getElementDisplayName(engine.Element element) { String? _getParametersString(engine.Element element, {required bool withNullability}) { - // TODO(scheglov) expose the corresponding feature from ExecutableElement + // TODO(scheglov): expose the corresponding feature from ExecutableElement List parameters; if (element is engine.ExecutableElement) { // valid getters don't have parameters diff --git a/pkg/analysis_server/lib/src/analytics/analytics_manager.dart b/pkg/analysis_server/lib/src/analytics/analytics_manager.dart index f7de4f3cfe1..516914d9646 100644 --- a/pkg/analysis_server/lib/src/analytics/analytics_manager.dart +++ b/pkg/analysis_server/lib/src/analytics/analytics_manager.dart @@ -578,7 +578,7 @@ class AnalyticsManager { )); } } - // TODO(brianwilkerson) We don't appear to have an event defined that we + // TODO(brianwilkerson): We don't appear to have an event defined that we // can use to send analytics about how often old-style refactorings are // being invoked. // var refactoringMap = data.additionalEnumCounts[refactoringKindEnumKey]; diff --git a/pkg/analysis_server/lib/src/cider/completion.dart b/pkg/analysis_server/lib/src/cider/completion.dart index 78017833772..8495fd06248 100644 --- a/pkg/analysis_server/lib/src/cider/completion.dart +++ b/pkg/analysis_server/lib/src/cider/completion.dart @@ -169,8 +169,8 @@ class CiderCompletionComputer { /// Return suggestions from libraries imported into the [target]. /// - /// TODO(scheglov) Implement show / hide combinators. - /// TODO(scheglov) Implement prefixes. + // TODO(scheglov): Implement show / hide combinators. + // TODO(scheglov): Implement prefixes. List _importedLibrariesSuggestions({ required LibraryElement target, required OperationPerformanceImpl performance, diff --git a/pkg/analysis_server/lib/src/computer/computer_folding.dart b/pkg/analysis_server/lib/src/computer/computer_folding.dart index e95707de47e..9d275c02e58 100644 --- a/pkg/analysis_server/lib/src/computer/computer_folding.dart +++ b/pkg/analysis_server/lib/src/computer/computer_folding.dart @@ -374,7 +374,7 @@ class _DartUnitFoldingComputerVisitor extends RecursiveAstVisitor { @override void visitMixinDeclaration(MixinDeclaration node) { _computer._addRegionForAnnotations(node.metadata); - // TODO(brianwilkerson) Define `FoldingKind.MIXIN_BODY`? + // TODO(brianwilkerson): Define `FoldingKind.MIXIN_BODY`? _computer._addRegion(node.name.end, node.end, FoldingKind.CLASS_BODY); super.visitMixinDeclaration(node); } diff --git a/pkg/analysis_server/lib/src/computer/computer_highlights.dart b/pkg/analysis_server/lib/src/computer/computer_highlights.dart index b0820e05916..e1fd9083201 100644 --- a/pkg/analysis_server/lib/src/computer/computer_highlights.dart +++ b/pkg/analysis_server/lib/src/computer/computer_highlights.dart @@ -749,7 +749,7 @@ class _DartUnitHighlightsComputerVisitor extends RecursiveAstVisitor { constructorName.type.accept(this); // We have a `ConstructorReference` only when it is resolved. - // TODO(scheglov) The `ConstructorName` in a tear-off always has a name, + // TODO(scheglov): The `ConstructorName` in a tear-off always has a name, // but this is not expressed via types. computer._addRegion_node( constructorName.name!, HighlightRegionType.CONSTRUCTOR_TEAR_OFF); @@ -1345,7 +1345,7 @@ class _DartUnitHighlightsComputerVisitor extends RecursiveAstVisitor { void visitSetOrMapLiteral(SetOrMapLiteral node) { if (node.isMap) { computer._addRegion_node(node, HighlightRegionType.LITERAL_MAP); - // TODO(brianwilkerson) Add a highlight region for set literals. This + // TODO(brianwilkerson): Add a highlight region for set literals. This // would be a breaking change, but would be consistent with list and map // literals. // } else if (node.isSet) { diff --git a/pkg/analysis_server/lib/src/computer/computer_hover.dart b/pkg/analysis_server/lib/src/computer/computer_hover.dart index d93ad1999e9..cd8973835d5 100644 --- a/pkg/analysis_server/lib/src/computer/computer_hover.dart +++ b/pkg/analysis_server/lib/src/computer/computer_hover.dart @@ -257,7 +257,7 @@ class DartUnitHoverComputer { static Documentation? computeDocumentation( DartdocDirectiveInfo dartdocInfo, Element elementBeingDocumented, {bool includeSummary = false}) { - // TODO(dantup) We're reusing this in parameter information - move it + // TODO(dantup): We're reusing this in parameter information - move it // somewhere shared? Element? element = elementBeingDocumented; if (element is FieldFormalParameterElement) { diff --git a/pkg/analysis_server/lib/src/computer/import_elements_computer.dart b/pkg/analysis_server/lib/src/computer/import_elements_computer.dart index 9a7c4e1b6e4..6df44cbf9e3 100644 --- a/pkg/analysis_server/lib/src/computer/import_elements_computer.dart +++ b/pkg/analysis_server/lib/src/computer/import_elements_computer.dart @@ -148,7 +148,7 @@ class ImportElementsComputer { } } else if (combinator is ShowCombinator && namesToShow.isNotEmpty) { - // TODO(brianwilkerson) Add the names in alphabetic order. + // TODO(brianwilkerson): Add the names in alphabetic order. builder.addInsertion(combinator.shownNames.last.end, (builder) { for (var nameToShow in namesToShow) { builder.write(', '); @@ -294,14 +294,14 @@ class ImportElementsComputer { if (importDirectives.isEmpty) { if (libraryDirective == null) { if (otherDirectives.isEmpty) { - // TODO(brianwilkerson) Insert after any non-doc comments. + // TODO(brianwilkerson): Insert after any non-doc comments. return _InsertionDescription(0, after: 2); } return _InsertionDescription(otherDirectives[0].offset, after: 2); } return _InsertionDescription(libraryDirective.end, before: 2); } - // TODO(brianwilkerson) Fix this to find the right location. + // TODO(brianwilkerson): Fix this to find the right location. // See DartFileEditBuilderImpl._addLibraryImports for inspiration. return _InsertionDescription(importDirectives.last.end, before: 1); } diff --git a/pkg/analysis_server/lib/src/context_manager.dart b/pkg/analysis_server/lib/src/context_manager.dart index 07bf7579756..cd44c5b7c5e 100644 --- a/pkg/analysis_server/lib/src/context_manager.dart +++ b/pkg/analysis_server/lib/src/context_manager.dart @@ -37,7 +37,7 @@ import 'package:yaml/yaml.dart'; /// Enables watching of files generated by Blaze. /// -/// TODO(michalt): This is a temporary flag that we use to disable this +// TODO(michalt): This is a temporary flag that we use to disable this /// functionality due its performance issues. We plan to benchmark and optimize /// it and re-enable it everywhere. /// Not private to enable testing. @@ -113,7 +113,7 @@ abstract class ContextManager { /// operations are in progress, and (c) determine which files should be /// analyzed. /// -/// TODO(paulberry): eliminate this interface, and instead have [ContextManager] +// TODO(paulberry): eliminate this interface, and instead have [ContextManager] /// operations return data structures describing how context state should be /// modified. abstract class ContextManagerCallbacks { @@ -136,7 +136,7 @@ abstract class ContextManagerCallbacks { /// Add listeners to the [driver]. This must be the only listener. /// - /// TODO(scheglov) Just pass results in here? + // TODO(scheglov): Just pass results in here? void listenAnalysisDriver(AnalysisDriver driver); /// The `pubspec.yaml` at [path] was added/modified. @@ -775,7 +775,7 @@ class ContextManagerImpl implements ContextManager { void _handleWatchEventImpl(WatchEvent event) { // Figure out which context this event applies to. - // TODO(brianwilkerson) If a file is explicitly included in one context + // TODO(brianwilkerson): If a file is explicitly included in one context // but implicitly referenced in another context, we will only send a // changeSet to the context that explicitly includes the file (because // that's the only context that's watching the file). diff --git a/pkg/analysis_server/lib/src/domains/completion/available_suggestions.dart b/pkg/analysis_server/lib/src/domains/completion/available_suggestions.dart index 36f285422aa..855f1cbe3bd 100644 --- a/pkg/analysis_server/lib/src/domains/completion/available_suggestions.dart +++ b/pkg/analysis_server/lib/src/domains/completion/available_suggestions.dart @@ -131,7 +131,7 @@ protocol.Notification createExistingImportsNotification( ).toNotification(); } -/// TODO(dantup): We need to expose this because the Declarations code currently +// TODO(dantup): We need to expose this because the Declarations code currently /// returns declarations with DeclarationKinds but the DartCompletionManager /// gives us a list of "included ElementKinds". Maybe it would be better to expose /// includedDeclarationKinds and then just map that list to ElementKinds once in diff --git a/pkg/analysis_server/lib/src/domains/execution/completion.dart b/pkg/analysis_server/lib/src/domains/execution/completion.dart index a66dff4fd96..550b5aca7d8 100644 --- a/pkg/analysis_server/lib/src/domains/execution/completion.dart +++ b/pkg/analysis_server/lib/src/domains/execution/completion.dart @@ -41,7 +41,7 @@ class RuntimeCompletionComputer { builder.addInsertion(contextOffset, (builder) { builder.writeln('{'); - // TODO(scheglov) Use variables. + // TODO(scheglov): Use variables. builder.write(codeMarker); builder.writeln(';'); @@ -86,7 +86,7 @@ class RuntimeCompletionComputer { // Remove completions with synthetic import prefixes. suggestions.removeWhere((s) => s.completion.startsWith('__prefix')); - // TODO(scheglov) Add support for expressions. + // TODO(scheglov): Add support for expressions. var expressions = []; return RuntimeCompletionResult(expressions, suggestions); } diff --git a/pkg/analysis_server/lib/src/handler/legacy/completion_get_suggestions2.dart b/pkg/analysis_server/lib/src/handler/legacy/completion_get_suggestions2.dart index 86cb51fe7b8..c63e2bc960c 100644 --- a/pkg/analysis_server/lib/src/handler/legacy/completion_get_suggestions2.dart +++ b/pkg/analysis_server/lib/src/handler/legacy/completion_get_suggestions2.dart @@ -77,7 +77,7 @@ class CompletionGetSuggestions2Handler extends CompletionHandler ), ); }); - // TODO (danrubel) if request is obsolete (processAnalysisRequest returns + // TODO(danrubel): if request is obsolete (processAnalysisRequest returns // false) then send empty results // diff --git a/pkg/analysis_server/lib/src/handler/legacy/edit_bulk_fixes.dart b/pkg/analysis_server/lib/src/handler/legacy/edit_bulk_fixes.dart index 7bce2f75cf4..08b5bf725fa 100644 --- a/pkg/analysis_server/lib/src/handler/legacy/edit_bulk_fixes.dart +++ b/pkg/analysis_server/lib/src/handler/legacy/edit_bulk_fixes.dart @@ -57,7 +57,7 @@ class EditBulkFixes extends LegacyHandler { sendResult(EditBulkFixesResult('', result.edits, result.details)); } } catch (exception, stackTrace) { - // TODO(brianwilkerson) Move exception handling outside [handle]. + // TODO(brianwilkerson): Move exception handling outside [handle]. server.sendServerErrorNotification('Exception while getting bulk fixes', CaughtException(exception, stackTrace), stackTrace); } diff --git a/pkg/analysis_server/lib/src/handler/legacy/edit_format.dart b/pkg/analysis_server/lib/src/handler/legacy/edit_format.dart index 67125ffdd43..ef1407e3f4e 100644 --- a/pkg/analysis_server/lib/src/handler/legacy/edit_format.dart +++ b/pkg/analysis_server/lib/src/handler/legacy/edit_format.dart @@ -62,7 +62,7 @@ class EditFormatHandler extends LegacyHandler { var edits = []; if (formattedSource != unformattedCode) { - //TODO: replace full replacements with smaller, more targeted edits + // TODO(brianwilkerson): replace full replacements with smaller, more targeted edits var edit = SourceEdit(0, unformattedCode.length, formattedSource); edits.add(edit); } diff --git a/pkg/analysis_server/lib/src/handler/legacy/edit_format_if_enabled.dart b/pkg/analysis_server/lib/src/handler/legacy/edit_format_if_enabled.dart index dfb2780a4ce..d8f00a4740d 100644 --- a/pkg/analysis_server/lib/src/handler/legacy/edit_format_if_enabled.dart +++ b/pkg/analysis_server/lib/src/handler/legacy/edit_format_if_enabled.dart @@ -25,7 +25,7 @@ class EditFormatIfEnabledHandler extends LegacyHandler { /// Throws a [FileSystemException] if the file doesn't exist or can't be read. /// Throws a [FormatterException] if the code could not be formatted. List formatFile(String filePath) { - // TODO(brianwilkerson) Move this to a superclass when `edit.format` is + // TODO(brianwilkerson): Move this to a superclass when `edit.format` is // implemented by a handler class so the code can be shared. var resource = server.resourceProvider.getFile(filePath); var originalContent = resource.readAsStringSync(); @@ -37,7 +37,7 @@ class EditFormatIfEnabledHandler extends LegacyHandler { var edits = []; if (formattedContent != originalContent) { - // TODO(brianwilkerson) Replace full replacements with smaller, more + // TODO(brianwilkerson): Replace full replacements with smaller, more // targeted edits. var edit = SourceEdit(0, originalContent.length, formattedContent); edits.add(edit); @@ -55,7 +55,7 @@ class EditFormatIfEnabledHandler extends LegacyHandler { ); var sourceFileEdits = []; for (var context in collection.contexts) { - // TODO(pq) maybe experimental and could be unused (or maybe used by dart fix) + // TODO(pq): maybe experimental and could be unused (or maybe used by dart fix) if (context.analysisOptions.codeStyleOptions.useFormatter) { _formatInContext(context, sourceFileEdits); } diff --git a/pkg/analysis_server/lib/src/handler/legacy/edit_get_fixes.dart b/pkg/analysis_server/lib/src/handler/legacy/edit_get_fixes.dart index 2bfd7a2b100..53f61cc6ba5 100644 --- a/pkg/analysis_server/lib/src/handler/legacy/edit_get_fixes.dart +++ b/pkg/analysis_server/lib/src/handler/legacy/edit_get_fixes.dart @@ -238,7 +238,7 @@ error.errorCode: ${error.errorCode} if (fixes.isNotEmpty) { fixes.sort(Fix.compareFixes); var lineInfo = LineInfo.fromContent(content); - // TODO(pq) package:analyzer results are specific to *.dart files and we + // TODO(pq): package:analyzer results are specific to *.dart files and we // shouldn't use them to represent errors in non-Dart files. // see: https://dart-review.googlesource.com/c/sdk/+/333588 var result = engine.ErrorsResultImpl( diff --git a/pkg/analysis_server/lib/src/handler/legacy/edit_organize_directives.dart b/pkg/analysis_server/lib/src/handler/legacy/edit_organize_directives.dart index d9b966ba9bb..ace4cb19643 100644 --- a/pkg/analysis_server/lib/src/handler/legacy/edit_organize_directives.dart +++ b/pkg/analysis_server/lib/src/handler/legacy/edit_organize_directives.dart @@ -20,7 +20,7 @@ class EditOrganizeDirectivesHandler extends LegacyHandler { @override Future handle() async { - // TODO(brianwilkerson) Move analytics tracking out of [handleRequest]. + // TODO(brianwilkerson): Move analytics tracking out of [handleRequest]. unawaited(server.options.analytics?.sendEvent( 'edit', 'organizeDirectives', diff --git a/pkg/analysis_server/lib/src/handler/legacy/execution_get_suggestions.dart b/pkg/analysis_server/lib/src/handler/legacy/execution_get_suggestions.dart index 0967cc967fc..1f55e3f45bb 100644 --- a/pkg/analysis_server/lib/src/handler/legacy/execution_get_suggestions.dart +++ b/pkg/analysis_server/lib/src/handler/legacy/execution_get_suggestions.dart @@ -34,7 +34,7 @@ class ExecutionGetSuggestionsHandler extends LegacyHandler { // var result = new ExecutionGetSuggestionsResult( // suggestions: completionResult.suggestions, // expressions: completionResult.expressions); - // TODO(brianwilkerson) Re-enable this functionality after implementing a + // TODO(brianwilkerson): Re-enable this functionality after implementing a // way of computing suggestions that is compatible with AnalysisSession. var result = ExecutionGetSuggestionsResult( suggestions: [], diff --git a/pkg/analysis_server/lib/src/legacy_analysis_server.dart b/pkg/analysis_server/lib/src/legacy_analysis_server.dart index d3ce4840ad7..5353264cfdf 100644 --- a/pkg/analysis_server/lib/src/legacy_analysis_server.dart +++ b/pkg/analysis_server/lib/src/legacy_analysis_server.dart @@ -735,7 +735,7 @@ class LegacyAnalysisServer extends AnalysisServer { /// Implementation for `analysis.setAnalysisRoots`. /// - /// TODO(scheglov) implement complete projects/contexts semantics. + // TODO(scheglov): implement complete projects/contexts semantics. /// /// The current implementation is intentionally simplified and expected /// that only folders are given each given folder corresponds to the exactly @@ -834,7 +834,7 @@ class LegacyAnalysisServer extends AnalysisServer { pubApi.close(); - // TODO(brianwilkerson) Remove the following 6 lines when the + // TODO(brianwilkerson): Remove the following 6 lines when the // analyticsManager is being correctly initialized. var analytics = options.analytics; if (analytics != null) { @@ -914,14 +914,14 @@ class LegacyAnalysisServer extends AnalysisServer { notifyDeclarationsTracker(file); notifyFlutterWidgetDescriptions(file); - // TODO(scheglov) implement other cases + // TODO(scheglov): implement other cases }); } /// Use the given updaters to update the values of the options in every /// existing analysis context. void updateOptions(List optionUpdaters) { - // TODO(scheglov) implement for the new analysis driver + // TODO(scheglov): implement for the new analysis driver // // // // Update existing contexts. // // @@ -932,7 +932,7 @@ class LegacyAnalysisServer extends AnalysisServer { // optionUpdater(options); // }); // context.analysisOptions = options; -// // TODO(brianwilkerson) As far as I can tell, this doesn't cause analysis +// // `TODO`(brianwilkerson) As far as I can tell, this doesn't cause analysis // // to be scheduled for this context. // } // // @@ -1048,7 +1048,7 @@ class ServerContextManagerCallbacks // if (analysisServer._hasAnalysisServiceSubscription( // AnalysisService.OUTLINE, path)) { // _runDelayed(() { - // // TODO(brianwilkerson) Change NotificationManager to store params + // // `TODO`(brianwilkerson) Change NotificationManager to store params // // so that fileKind and libraryName can be recorded / passed along. // notificationManager.recordOutlines(NotificationManager.serverId, path, // _computeOutlineParams(path, unit, result.lineInfo)); @@ -1113,9 +1113,9 @@ class ServerContextManagerCallbacks /// important consumer of an analysis results, specifically a code completion /// computer, we want it to run before spending time of sending notifications. /// - /// TODO(scheglov) Consider replacing this with full priority based scheduler. + // TODO(scheglov): Consider replacing this with full priority based scheduler. /// - /// TODO(scheglov) Alternatively, if code completion work in a way that does + // TODO(scheglov): Alternatively, if code completion work in a way that does /// not produce (at first) fully resolved unit, but only part of it - a single /// method, or a top-level declaration, we would not have this problem - the /// completion computer would be the only consumer of the partial analysis diff --git a/pkg/analysis_server/lib/src/lsp/client_configuration.dart b/pkg/analysis_server/lib/src/lsp/client_configuration.dart index 7a057864e8c..67ce8c4f908 100644 --- a/pkg/analysis_server/lib/src/lsp/client_configuration.dart +++ b/pkg/analysis_server/lib/src/lsp/client_configuration.dart @@ -46,7 +46,7 @@ class LspClientConfiguration { /// Returns whether or not the provided new configuration changes any values /// that would affect analysis results. bool affectsAnalysisResults(LspGlobalClientConfiguration otherConfig) { - // Check whether TODO settings have changed. + // Check whether `TODO` settings have changed. final oldFlag = _globalSettings.showAllTodos; final newFlag = otherConfig.showAllTodos; final oldTypes = _globalSettings.showTodoTypes; @@ -178,11 +178,11 @@ class LspGlobalClientConfiguration extends LspResourceClientConfiguration { bool get previewCommitCharacters => _settings['previewCommitCharacters'] as bool? ?? false; - /// Whether diagnostics should be generated for all TODO comments. + // Whether diagnostics should be generated for all `TODO` comments. bool get showAllTodos => _settings['showTodos'] is bool ? _settings['showTodos'] as bool : false; - /// A specific set of TODO comments that should generate diagnostics. + // A specific set of `TODO` comments that should generate diagnostics. /// /// Codes are all forced UPPERCASE regardless of what the client supplies. /// diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_code_actions.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_code_actions.dart index a956dfa0e31..0653cfe2e6c 100644 --- a/pkg/analysis_server/lib/src/lsp/handlers/handler_code_actions.dart +++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_code_actions.dart @@ -160,7 +160,7 @@ class CodeActionHandler if (isPubspec) PubspecCodeActionsProducer( server, - // TODO(pq) can we do better? + // TODO(pq): can we do better? server.resourceProvider.getFile(unitPath), lineInfo, offset: offset, @@ -171,7 +171,7 @@ class CodeActionHandler if (isAnalysisOptions) AnalysisOptionsCodeActionsProducer( server, - // TODO(pq) can we do better? + // TODO(pq): can we do better? server.resourceProvider.getFile(unitPath), lineInfo, offset: offset, @@ -181,7 +181,7 @@ class CodeActionHandler ), PluginCodeActionsProducer( server, - // TODO(pq) can we do better? + // TODO(pq): can we do better? server.resourceProvider.getFile(unitPath), lineInfo, offset: offset, diff --git a/pkg/analysis_server/lib/src/lsp/notification_manager.dart b/pkg/analysis_server/lib/src/lsp/notification_manager.dart index 1398f053809..a6194940da6 100644 --- a/pkg/analysis_server/lib/src/lsp/notification_manager.dart +++ b/pkg/analysis_server/lib/src/lsp/notification_manager.dart @@ -62,7 +62,7 @@ class LspNotificationManager extends AbstractNotificationManager { @override void sendHighlightRegions( String filePath, List mergedHighlights) { - // TODO: implement sendHighlightRegions + // TODO(dantup): implement sendHighlightRegions } @override @@ -92,6 +92,6 @@ class LspNotificationManager extends AbstractNotificationManager { @override void sendPluginErrorNotification(Notification notification) { - // TODO: implement sendPluginErrorNotification + // TODO(dantup): implement sendPluginErrorNotification } } diff --git a/pkg/analysis_server/lib/src/plugin/notification_manager.dart b/pkg/analysis_server/lib/src/plugin/notification_manager.dart index 7a7f2e12dfa..f568fd94d16 100644 --- a/pkg/analysis_server/lib/src/plugin/notification_manager.dart +++ b/pkg/analysis_server/lib/src/plugin/notification_manager.dart @@ -37,7 +37,7 @@ abstract class AbstractNotificationManager { >{}; /// The collector being used to collect the analysis errors from the plugins. - // TODO(brianwilkerson) Consider the possibility of not passing the predicate + // TODO(brianwilkerson): Consider the possibility of not passing the predicate // in to the collector, but instead to the testing in this class. late ResultCollector> errors = ResultCollector>(serverId, predicate: _isIncluded); @@ -295,7 +295,7 @@ abstract class AbstractNotificationManager { return false; } - // TODO(brianwilkerson) Return false if error notifications are globally + // TODO(brianwilkerson): Return false if error notifications are globally // disabled. return isIncluded() && !isExcluded(); } @@ -360,7 +360,7 @@ class NotificationManager extends AbstractNotificationManager { @override void sendPluginErrorNotification(plugin.Notification notification) { var params = plugin.PluginErrorParams.fromNotification(notification); - // TODO(brianwilkerson) There is no indication for the client as to the + // TODO(brianwilkerson): There is no indication for the client as to the // fact that the error came from a plugin, let alone which plugin it // came from. We should consider whether we really want to send them to // the client. diff --git a/pkg/analysis_server/lib/src/plugin/plugin_locator.dart b/pkg/analysis_server/lib/src/plugin/plugin_locator.dart index f5e1247f727..f5e0a563528 100644 --- a/pkg/analysis_server/lib/src/plugin/plugin_locator.dart +++ b/pkg/analysis_server/lib/src/plugin/plugin_locator.dart @@ -50,7 +50,7 @@ class PluginLocator { /// The implementation of [findPlugin]. String? _findPlugin(String packageRoot) { var packageFolder = resourceProvider.getFolder(packageRoot); - // TODO(brianwilkerson) Re-enable this after deciding how we want to deal + // TODO(brianwilkerson): Re-enable this after deciding how we want to deal // with discovery of plugins. // import 'package:yaml/yaml.dart'; // File pubspecFile = packageFolder.getChildAssumingFile(pubspecFileName); diff --git a/pkg/analysis_server/lib/src/plugin/plugin_manager.dart b/pkg/analysis_server/lib/src/plugin/plugin_manager.dart index d91640146eb..213526bf519 100644 --- a/pkg/analysis_server/lib/src/plugin/plugin_manager.dart +++ b/pkg/analysis_server/lib/src/plugin/plugin_manager.dart @@ -916,7 +916,7 @@ class PluginSession { /// Return `true` if there are any requests that have not been responded to /// within the maximum allowed amount of time. bool isNonResponsive() { - // TODO(brianwilkerson) Figure out when to invoke this method in order to + // TODO(brianwilkerson): Figure out when to invoke this method in order to // identify non-responsive plugins and kill them. var cutOffTime = DateTime.now().millisecondsSinceEpoch - MAXIMUM_RESPONSE_TIME.inMilliseconds; @@ -966,7 +966,7 @@ class PluginSession { return false; } channel = info._createChannel(); - // TODO(brianwilkerson) Determine if await is necessary, if so, change the + // TODO(brianwilkerson): Determine if await is necessary, if so, change the // return type of `channel.listen` to `Future`. await (channel!.listen(handleResponse, handleNotification, onDone: handleOnDone, onError: handleOnError) as dynamic); diff --git a/pkg/analysis_server/lib/src/plugin/plugin_watcher.dart b/pkg/analysis_server/lib/src/plugin/plugin_watcher.dart index 9aad1612708..1dacb2f9567 100644 --- a/pkg/analysis_server/lib/src/plugin/plugin_watcher.dart +++ b/pkg/analysis_server/lib/src/plugin/plugin_watcher.dart @@ -62,7 +62,7 @@ class PluginWatcher implements DriverWatcher { // // Add the plugin to the context root. // - // TODO(brianwilkerson) Do we need to wait for the plugin to be added? + // TODO(brianwilkerson): Do we need to wait for the plugin to be added? // If we don't, then tests don't have any way to know when to expect // that the list of plugins has been updated. manager.addPluginToContextRoot( @@ -88,7 +88,7 @@ class PluginWatcher implements DriverWatcher { String _getSdkPath(AnalysisDriver driver) { var coreSource = driver.sourceFactory.forUri('dart:core'); - // TODO(scheglov) Debug for https://github.com/dart-lang/sdk/issues/35226 + // TODO(scheglov): Debug for https://github.com/dart-lang/sdk/issues/35226 if (coreSource == null) { var sdk = driver.sourceFactory.dartSdk; if (sdk is AbstractDartSdk) { diff --git a/pkg/analysis_server/lib/src/plugin/result_merger.dart b/pkg/analysis_server/lib/src/plugin/result_merger.dart index aef7ec3a9c2..39ecec8e431 100644 --- a/pkg/analysis_server/lib/src/plugin/result_merger.dart +++ b/pkg/analysis_server/lib/src/plugin/result_merger.dart @@ -80,7 +80,7 @@ class ResultMerger { /// list will contain duplications. List mergeAnalysisErrors( List> partialResultList) { - // TODO(brianwilkerson) Consider merging duplicate errors (same code, + // TODO(brianwilkerson): Consider merging duplicate errors (same code, // location, and messages). If we do that, we should return the logical-or // of the hasFix fields from the merged errors. var count = partialResultList.length; @@ -401,7 +401,7 @@ class ResultMerger { void addToMap(Outline outline) { var key = computeKey(outline.element); if (outlineMap.containsKey(key)) { - // TODO(brianwilkerson) Decide how to handle this more gracefully. + // TODO(brianwilkerson): Decide how to handle this more gracefully. throw StateError('Inconsistent outlines'); } outlineMap[key] = outline; @@ -544,7 +544,7 @@ class ResultMerger { var lengths = first.lengths.toList(); for (var i = 1; i < count; i++) { var feedback = feedbacks[i] as ExtractLocalVariableFeedback; - // TODO(brianwilkerson) This doesn't ensure that the covering data is in + // TODO(brianwilkerson): This doesn't ensure that the covering data is in // the right order and consistent. var coveringOffsets = feedback.coveringExpressionOffsets; if (coveringOffsets != null) { @@ -589,8 +589,8 @@ class ResultMerger { } } canCreateGetter = canCreateGetter && feedback.canCreateGetter; - // TODO(brianwilkerson) This doesn't allow plugins to add parameters. - // TODO(brianwilkerson) This doesn't check for duplicate offsets. + // TODO(brianwilkerson): This doesn't allow plugins to add parameters. + // TODO(brianwilkerson): This doesn't check for duplicate offsets. offsets.addAll(feedback.offsets); lengths.addAll(feedback.lengths); } diff --git a/pkg/analysis_server/lib/src/request_handler_mixin.dart b/pkg/analysis_server/lib/src/request_handler_mixin.dart index 04ee1fb118a..2b60fce428e 100644 --- a/pkg/analysis_server/lib/src/request_handler_mixin.dart +++ b/pkg/analysis_server/lib/src/request_handler_mixin.dart @@ -26,7 +26,7 @@ mixin RequestHandlerMixin { plugin.RequestParams? requestParameters, Duration timeout = const Duration(milliseconds: 500), }) async { - // TODO(brianwilkerson) requestParameters might need to be required. + // TODO(brianwilkerson): requestParameters might need to be required. var timer = Stopwatch()..start(); var responses = []; for (var entry in futures.entries) { @@ -36,7 +36,7 @@ mixin RequestHandlerMixin { var response = await future.timeout(timeout - timer.elapsed); var error = response.error; if (error != null) { - // TODO(brianwilkerson) Report the error to the plugin manager. + // TODO(brianwilkerson): Report the error to the plugin manager. server.instrumentationService.logPluginError( pluginInfo.data, error.code.name, @@ -46,13 +46,13 @@ mixin RequestHandlerMixin { responses.add(response); } } on TimeoutException { - // TODO(brianwilkerson) Report the timeout to the plugin manager. + // TODO(brianwilkerson): Report the timeout to the plugin manager. server.instrumentationService.logPluginTimeout( pluginInfo.data, JsonEncoder() .convert(requestParameters?.toRequest('-').toJson() ?? {})); } catch (exception, stackTrace) { - // TODO(brianwilkerson) Report the exception to the plugin manager. + // TODO(brianwilkerson): Report the exception to the plugin manager. server.instrumentationService .logPluginException(pluginInfo.data, exception, stackTrace); } diff --git a/pkg/analysis_server/lib/src/server/driver.dart b/pkg/analysis_server/lib/src/server/driver.dart index ab8b47f12e6..455422a0ca2 100644 --- a/pkg/analysis_server/lib/src/server/driver.dart +++ b/pkg/analysis_server/lib/src/server/driver.dart @@ -211,7 +211,7 @@ class Driver implements ServerStarter { final defaultSdkPath = _getSdkPath(results); final dartSdkManager = DartSdkManager(defaultSdkPath); - // TODO(brianwilkerson) It would be nice to avoid creating an SDK that + // TODO(brianwilkerson): It would be nice to avoid creating an SDK that // can't be re-used, but the SDK is needed to create a package map provider // in the case where we need to run `pub` in order to get the package map. var defaultSdk = _createDefaultSdk(defaultSdkPath); @@ -559,7 +559,7 @@ class Driver implements ServerStarter { /// Create the `Analytics` instance to be used to report analytics. Analytics _createAnalytics( DartSdk dartSdk, String dartSdkPath, DashTool tool) { - // TODO(brianwilkerson) Find out whether there's a way to get the channel + // TODO(brianwilkerson): Find out whether there's a way to get the channel // without running `flutter channel`. var pathContext = PhysicalResourceProvider.INSTANCE.pathContext; var flutterSdkRoot = pathContext diff --git a/pkg/analysis_server/lib/src/server/http_server.dart b/pkg/analysis_server/lib/src/server/http_server.dart index eb8835aee3b..3fa632243f3 100644 --- a/pkg/analysis_server/lib/src/server/http_server.dart +++ b/pkg/analysis_server/lib/src/server/http_server.dart @@ -84,7 +84,7 @@ class HttpAnalysisServer { /// Handle a GET request received by the HTTP server. Future _handleGetRequest(HttpRequest request) async { getHandler ??= DiagnosticsSite(socketServer, _printBuffer); - // TODO(brianwilkerson) Determine if await is necessary, if so, change the + // TODO(brianwilkerson): Determine if await is necessary, if so, change the // return type of [AbstractGetHandler.handleGetRequest] to `Future`. await (getHandler!.handleGetRequest(request) as dynamic); } diff --git a/pkg/analysis_server/lib/src/services/completion/dart/candidate_suggestion.dart b/pkg/analysis_server/lib/src/services/completion/dart/candidate_suggestion.dart index 4a7efe47b69..25d2ddae892 100644 --- a/pkg/analysis_server/lib/src/services/completion/dart/candidate_suggestion.dart +++ b/pkg/analysis_server/lib/src/services/completion/dart/candidate_suggestion.dart @@ -220,7 +220,7 @@ final class PropertyAccessSuggestion extends CandidateSuggestion { } extension SuggestionBuilderExtension on SuggestionBuilder { - // TODO(brianwilkerson) Move these to `SuggestionBuilder`, possibly as part + // TODO(brianwilkerson): Move these to `SuggestionBuilder`, possibly as part // of splitting it into a legacy builder and an LSP builder. /// Add a suggestion based on the candidate [suggestion]. @@ -245,11 +245,11 @@ extension SuggestionBuilderExtension on SuggestionBuilder { case LocalFunctionSuggestion(): suggestTopLevelFunction(suggestion.element); case LocalVariableSuggestion(): - // TODO(brianwilkerson) Enhance `suggestLocalVariable` to allow the + // TODO(brianwilkerson): Enhance `suggestLocalVariable` to allow the // distance to be passed in. suggestLocalVariable(suggestion.element); case MethodSuggestion(): - // TODO(brianwilkerson) Correctly set the kind of suggestion in cases + // TODO(brianwilkerson): Correctly set the kind of suggestion in cases // where `isFunctionalArgument` would return `true` so we can stop // using the `request.target`. var kind = request.target.isFunctionalArgument() diff --git a/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart b/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart index 5e317c1081a..fdf210b4acf 100644 --- a/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart +++ b/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart @@ -289,7 +289,7 @@ class DartCompletionManager { ), ); } else { - // TODO(brianwilkerson) This was previously used to boost exact type + // TODO(brianwilkerson): This was previously used to boost exact type // matches. For example, if the context type was `Foo`, then the class // `Foo` and it's constructors would be given this boost. Now this // boost will almost always be ignored because the element boost will @@ -308,7 +308,7 @@ class DartCompletionManager { // Run the first pass of the code completion algorithm. VisibilityTracker? _runFirstPass( DartCompletionRequest request, SuggestionBuilder builder) { - // TODO(brianwilkerson) Stop returning the visibility tracker when the + // TODO(brianwilkerson): Stop returning the visibility tracker when the // `LocalReferenceContributor` has been deleted. var collector = SuggestionCollector(); var selection = request.unit.select(offset: request.offset, length: 0); @@ -536,7 +536,7 @@ class DartCompletionRequest { } } - /// TODO(scheglov) Can we make it better? + // TODO(scheglov): Can we make it better? String fromToken(Token token) { final lexeme = token.lexeme; if (offset >= token.offset && offset < token.end) { diff --git a/pkg/analysis_server/lib/src/services/completion/dart/completion_state.dart b/pkg/analysis_server/lib/src/services/completion/dart/completion_state.dart index ed97183634b..8027e0cf1f3 100644 --- a/pkg/analysis_server/lib/src/services/completion/dart/completion_state.dart +++ b/pkg/analysis_server/lib/src/services/completion/dart/completion_state.dart @@ -70,7 +70,7 @@ class CompletionState { } } -// TODO(brianwilkerson) Move to 'package:analysis_server/src/utilities/extensions/ast.dart' +// TODO(brianwilkerson): Move to 'package:analysis_server/src/utilities/extensions/ast.dart' extension on ClassMember { /// Return `true` if this member is a static member. bool get isStatic { diff --git a/pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart b/pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart index 7bedc53218a..4277743b4a3 100644 --- a/pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart +++ b/pkg/analysis_server/lib/src/services/completion/dart/declaration_helper.dart @@ -119,7 +119,7 @@ class DeclarationHelper { } void addMembersOfType(DartType type) { - // TODO(brianwilkerson) Implement this. + // TODO(brianwilkerson): Implement this. } /// Add suggestions for any local declarations that are visible at the @@ -270,7 +270,7 @@ class DeclarationHelper { /// Add suggestions for any top-level declarations that are visible within the /// [library]. void _addTopLevelDeclarations(LibraryElement library) { - // TODO(brianwilkerson) Implement this. + // TODO(brianwilkerson): Implement this. // for (var unit in library.units) { // for (var element in unit.accessors) {} // for (var element in unit.classes) {} @@ -506,7 +506,7 @@ class DeclarationHelper { // visited it and don't want to suggest declared variables twice. continue; } - // TODO(brianwilkerson) I think we need to compare to the end of the + // TODO(brianwilkerson): I think we need to compare to the end of the // statement for variable declarations and the offset for functions. if (statement.offset < offset) { if (statement is VariableDeclarationStatement) { diff --git a/pkg/analysis_server/lib/src/services/completion/dart/enum_constant_constructor_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/enum_constant_constructor_contributor.dart index ad1753e5693..faf3b30ed40 100644 --- a/pkg/analysis_server/lib/src/services/completion/dart/enum_constant_constructor_contributor.dart +++ b/pkg/analysis_server/lib/src/services/completion/dart/enum_constant_constructor_contributor.dart @@ -20,7 +20,7 @@ class EnumConstantConstructorContributor extends DartCompletionContributor { return; } - // TODO(scheglov) It seems unfortunate that we have to re-discover + // TODO(scheglov): It seems unfortunate that we have to re-discover // the location in contributors. This is the work of `OpType`, so why // doesn't it provide all these enclosing `EnumConstantDeclaration`, // `ConstructorSelector`, `EnumDeclaration`? diff --git a/pkg/analysis_server/lib/src/services/completion/dart/extension_member_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/extension_member_contributor.dart index 2b19febc809..879dc754360 100644 --- a/pkg/analysis_server/lib/src/services/completion/dart/extension_member_contributor.dart +++ b/pkg/analysis_server/lib/src/services/completion/dart/extension_member_contributor.dart @@ -50,7 +50,7 @@ class ExtensionMemberContributor extends DartCompletionContributor { } _addExtensionMembers(extensions, defaultKind, thisExtendedType); } - // TODO(scheglov) It seems that we don't support non-interface types. + // TODO(scheglov): It seems that we don't support non-interface types. } return; } @@ -116,7 +116,7 @@ class ExtensionMemberContributor extends DartCompletionContributor { inheritanceDistance = memberBuilder.request.featureComputer .inheritanceDistanceFeature(type.element, extendedType.element); } - // TODO(brianwilkerson) We might want to apply the substitution to the + // TODO(brianwilkerson): We might want to apply the substitution to the // members of the extension for display purposes. _addInstanceMembers( instantiatedExtension.extension, kind, inheritanceDistance); diff --git a/pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart b/pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart index 05d873691ae..646d2d5d5cf 100644 --- a/pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart +++ b/pkg/analysis_server/lib/src/services/completion/dart/feature_computer.dart @@ -698,7 +698,7 @@ class _ContextTypeVisitor extends SimpleAstVisitor { var parent = node.parent; if (parent is MethodDeclaration) { var bodyContext = BodyInferenceContext.of(parent.body); - // TODO(scheglov) https://github.com/dart-lang/sdk/issues/45429 + // TODO(scheglov): https://github.com/dart-lang/sdk/issues/45429 if (bodyContext == null) { throw StateError(''' Expected body context. @@ -857,7 +857,7 @@ Class: ${parent.parent} DartType? visitListLiteral(ListLiteral node) { if (range.endStart(node.leftBracket, node.rightBracket).contains(offset)) { final type = node.staticType; - // TODO(scheglov) https://github.com/dart-lang/sdk/issues/48965 + // TODO(scheglov): https://github.com/dart-lang/sdk/issues/48965 if (type == null) { throw ''' No type. @@ -1219,7 +1219,7 @@ parent3: ${node.parent?.parent?.parent} /// `PatternAssignment` or a `PatternVariableDeclaration`, return the context /// type for the right-hand side. DartType? _requiredTypeOfPattern(DartPattern pattern) { - // TODO(brianwilkerson) Replace with `patternTypeSchema` (on AST) where + // TODO(brianwilkerson): Replace with `patternTypeSchema` (on AST) where // possible. pattern = pattern.unParenthesized; Element? element; diff --git a/pkg/analysis_server/lib/src/services/completion/dart/field_formal_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/field_formal_contributor.dart index b3d41fefe26..e0644752f62 100644 --- a/pkg/analysis_server/lib/src/services/completion/dart/field_formal_contributor.dart +++ b/pkg/analysis_server/lib/src/services/completion/dart/field_formal_contributor.dart @@ -19,7 +19,7 @@ class FieldFormalContributor extends DartCompletionContributor { required OperationPerformanceImpl performance, }) async { var node = request.target.containingNode; - // TODO(brianwilkerson) We should suggest field formal parameters even if + // TODO(brianwilkerson): We should suggest field formal parameters even if // the user hasn't already typed the `this.` prefix, by including the // prefix in the completion. if (node is! FieldFormalParameter) { @@ -32,7 +32,7 @@ class FieldFormalContributor extends DartCompletionContributor { } // Compute the list of fields already referenced in the constructor. - // TODO(brianwilkerson) This doesn't include fields in initializers, which + // TODO(brianwilkerson): This doesn't include fields in initializers, which // shouldn't be suggested. var referencedFields = []; for (var param in constructor.parameters.parameters) { diff --git a/pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart b/pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart index 889c9153ea6..8e85fcc6a69 100644 --- a/pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart +++ b/pkg/analysis_server/lib/src/services/completion/dart/in_scope_completion_pass.dart @@ -166,12 +166,12 @@ class InScopeCompletionPass extends SimpleAstVisitor { // parenthesized expression or a parameter list, the parser will recover // by parsing an `as` expression. This handles the case where the user is // actually trying to write a function expression. - // TODO(brianwilkerson) Decide whether we should do more to ensure that + // TODO(brianwilkerson): Decide whether we should do more to ensure that // the expression could be a parameter list. keywordHelper.addFunctionBodyModifiers(null); } else if (node.type.coversOffset(offset)) { collector.completionLocation = 'AsExpression_type'; - // TODO(brianwilkerson) Add a parameter to _forTypeAnnotation to prohibit + // TODO(brianwilkerson): Add a parameter to _forTypeAnnotation to prohibit // producing `void`, then convert the call below. keywordHelper.addKeyword(Keyword.DYNAMIC); } @@ -223,7 +223,7 @@ class InScopeCompletionPass extends SimpleAstVisitor { var previousStatement = node.statements.elementBefore(offset); if (previousStatement is TryStatement) { if (previousStatement.finallyBlock == null) { - // TODO(brianwilkerson) Consider adding `on ^ {}`, `catch (e) {^}`, and + // TODO(brianwilkerson): Consider adding `on ^ {}`, `catch (e) {^}`, and // `finally {^}`. keywordHelper.addKeyword(Keyword.ON); keywordHelper.addKeyword(Keyword.CATCH); @@ -300,7 +300,7 @@ class InScopeCompletionPass extends SimpleAstVisitor { return; } if (offset <= node.name.end) { - // TODO(brianwilkerson) Suggest a name for the class. + // TODO(brianwilkerson): Suggest a name for the class. return; } if (offset <= node.leftBracket.offset) { @@ -340,7 +340,7 @@ class InScopeCompletionPass extends SimpleAstVisitor { @override void visitConditionalExpression(ConditionalExpression node) { - // TODO(brianwilkerson) Consider adding a location for the condition. + // TODO(brianwilkerson): Consider adding a location for the condition. if (offset >= node.question.end && offset <= node.colon.offset) { collector.completionLocation = 'ConditionalExpression_thenExpression'; } else if (offset >= node.colon.end) { @@ -483,7 +483,7 @@ class InScopeCompletionPass extends SimpleAstVisitor { return; } if (offset <= node.name.end) { - // TODO(brianwilkerson) Suggest a name for the mixin. + // TODO(brianwilkerson): Suggest a name for the mixin. return; } if (offset <= node.leftBracket.offset) { @@ -540,7 +540,7 @@ class InScopeCompletionPass extends SimpleAstVisitor { if (featureSet.isEnabled(Feature.inline_class)) { keywordHelper.addPseudoKeyword('type'); } - // TODO(brianwilkerson) Suggest a name for the extension. + // TODO(brianwilkerson): Suggest a name for the extension. return; } if (offset <= node.leftBracket.offset) { @@ -595,7 +595,7 @@ class InScopeCompletionPass extends SimpleAstVisitor { } else { if (offset <= type.end) { keywordHelper.addFieldDeclarationKeywords(node); - // TODO(brianwilkerson) `var` should only be suggested if neither + // TODO(brianwilkerson): `var` should only be suggested if neither // `static` nor `final` are present. keywordHelper.addKeyword(Keyword.VAR); } @@ -784,7 +784,7 @@ class InScopeCompletionPass extends SimpleAstVisitor { offset <= node.rightParenthesis.offset) { keywordHelper.addExpressionKeywords(node); } else if (offset >= node.rightParenthesis.end) { - // TODO(brianwilkerson) Ensure that we are suggesting `else` after the + // TODO(brianwilkerson): Ensure that we are suggesting `else` after the // then expression. var literal = node.thisOrAncestorOfType(); if (literal is ListLiteral) { @@ -839,7 +839,7 @@ class InScopeCompletionPass extends SimpleAstVisitor { if (offset <= node.uri.offset) { return; } else if (offset <= node.uri.end) { - // TODO(brianwilkerson) Complete the URI. + // TODO(brianwilkerson): Complete the URI. } else { keywordHelper.addImportDirectiveKeywords(node); } @@ -879,7 +879,7 @@ class InScopeCompletionPass extends SimpleAstVisitor { } else if (offset < isOperator.offset) { _forExpression(node); } else if (offset > isOperator.end) { - // TODO(brianwilkerson) Suggest the types available in the current scope. + // TODO(brianwilkerson): Suggest the types available in the current scope. // declarationHelper.addTypes(); } } @@ -983,7 +983,7 @@ class InScopeCompletionPass extends SimpleAstVisitor { return; } if (offset <= node.name.end) { - // TODO(brianwilkerson) Suggest a name for the mixin. + // TODO(brianwilkerson): Suggest a name for the mixin. return; } if (offset <= node.leftBracket.offset) { @@ -1052,18 +1052,18 @@ class InScopeCompletionPass extends SimpleAstVisitor { void visitPatternField(PatternField node) { var name = node.name; if (name != null && offset <= name.colon.offset) { - // TODO(brianwilkerson) Suggest the properties of the object or fields of + // TODO(brianwilkerson): Suggest the properties of the object or fields of // the record. return; } if (name == null) { var parent = node.parent; if (parent is ObjectPattern) { - // TODO(brianwilkerson) Suggest the properties of the object. + // TODO(brianwilkerson): Suggest the properties of the object. // _addPropertiesOfType(parent.type.type); } else if (parent is RecordPattern) { _forPattern(node); - // TODO(brianwilkerson) If we know the expected record type, add the + // TODO(brianwilkerson): If we know the expected record type, add the // names of any named fields. } } else if (name.name == null) { @@ -1114,7 +1114,7 @@ class InScopeCompletionPass extends SimpleAstVisitor { @override void visitRecordPattern(RecordPattern node) { _forExpression(node); - // TODO(brianwilkerson) Is there a reason we aren't suggesting 'void'? + // TODO(brianwilkerson): Is there a reason we aren't suggesting 'void'? keywordHelper.addKeyword(Keyword.DYNAMIC); } @@ -1251,7 +1251,7 @@ class InScopeCompletionPass extends SimpleAstVisitor { @override void visitSwitchExpressionCase(SwitchExpressionCase node) { if (node.arrow.isSynthetic) { - // TODO(brianwilkerson) The user is completing the pattern. + // TODO(brianwilkerson): The user is completing the pattern. return; } var expression = node.expression; @@ -1548,7 +1548,7 @@ class InScopeCompletionPass extends SimpleAstVisitor { /// beginning of a class member. void _forClassMember() { keywordHelper.addClassMemberKeywords(); - // TODO(brianwilkerson) Suggest type names. + // TODO(brianwilkerson): Suggest type names. } /// Add the suggestions that are appropriate when the selection is at the @@ -1654,7 +1654,7 @@ class InScopeCompletionPass extends SimpleAstVisitor { // code, but the offset will be past where the parser inserted sythetic // tokens, preventing that from working. switch (precedingMember) { - // TODO(brianwilkerson) Add support for other kinds of declarations. + // TODO(brianwilkerson): Add support for other kinds of declarations. case MethodDeclaration declaration: if (declaration.body.isFullySynthetic) { keywordHelper.addFunctionBodyModifiers(declaration.body); @@ -1684,7 +1684,7 @@ class InScopeCompletionPass extends SimpleAstVisitor { // duplicating code, but the offset will be past where the parser // inserted sythetic tokens, preventing that from working. switch (precedingStatement) { - // TODO(brianwilkerson) Add support for other kinds of declarations. + // TODO(brianwilkerson): Add support for other kinds of declarations. case IfStatement declaration: if (declaration.elseKeyword == null) { keywordHelper.addKeyword(Keyword.ELSE); @@ -1729,7 +1729,7 @@ class InScopeCompletionPass extends SimpleAstVisitor { void _forTypeAnnotation() { keywordHelper.addKeyword(Keyword.DYNAMIC); keywordHelper.addKeyword(Keyword.VOID); - // TODO(brianwilkerson) Suggest the types available in the current scope. + // TODO(brianwilkerson): Suggest the types available in the current scope. // _addTypesInScope(); } @@ -1737,7 +1737,7 @@ class InScopeCompletionPass extends SimpleAstVisitor { /// beginning of a variable pattern. void _forVariablePattern() { keywordHelper.addVariablePatternKeywords(); - // TODO(brianwilkerson) Suggest the types available in the current scope. + // TODO(brianwilkerson): Suggest the types available in the current scope. // _addTypesInScope(); } @@ -1751,7 +1751,7 @@ class InScopeCompletionPass extends SimpleAstVisitor { // code, but in some cases the offset will be past where the parser inserted // sythetic tokens, preventing that from working. switch (precedingMember) { - // TODO(brianwilkerson) Add support for other kinds of declarations. + // TODO(brianwilkerson): Add support for other kinds of declarations. case ClassDeclaration declaration: if (declaration.hasNoBody) { keywordHelper.addClassDeclarationKeywords(declaration); diff --git a/pkg/analysis_server/lib/src/services/completion/dart/keyword_helper.dart b/pkg/analysis_server/lib/src/services/completion/dart/keyword_helper.dart index 74abd46ad96..408f3d31173 100644 --- a/pkg/analysis_server/lib/src/services/completion/dart/keyword_helper.dart +++ b/pkg/analysis_server/lib/src/services/completion/dart/keyword_helper.dart @@ -105,11 +105,11 @@ class KeywordHelper { /// beginning of an element in a collection [literal]. void addCollectionElementKeywords( TypedLiteral literal, NodeList elements) { - // TODO(brianwilkerson) Consider determining whether there is a comma before + // TODO(brianwilkerson): Consider determining whether there is a comma before // the selection and inserting the comma if there isn't one. addKeyword(Keyword.FOR); addKeyword(Keyword.IF); - // TODO(brianwilkerson) Consider replacing the lines above with the + // TODO(brianwilkerson): Consider replacing the lines above with the // following lines: // addKeywordFromText(Keyword.FOR, ' (^)'); // addKeywordFromText(Keyword.IF, ' (^)'); @@ -163,7 +163,7 @@ class KeywordHelper { /// beginning of a constant expression. The flag [inConstantContext] should be /// `true` if the expression is inside a constant context. void addConstantExpressionKeywords({required bool inConstantContext}) { - // TODO(brianwilkerson) Use this method in place of `addExpressionKeywords` + // TODO(brianwilkerson): Use this method in place of `addExpressionKeywords` // when in a constant context in order to not suggest invalid keywords. addKeyword(Keyword.FALSE); addKeyword(Keyword.NULL); @@ -201,7 +201,7 @@ class KeywordHelper { /// beginning of a directive in a compilation unit. The [before] directive is /// the directive before the one being added. void addDirectiveKeywords(CompilationUnit unit, Directive? before) { - // TODO(brianwilkerson) If we had both the members before and after the new + // TODO(brianwilkerson): If we had both the members before and after the new // directive, we could limit the keywords based on surrounding members. if (before == null && !unit.directives.any((d) => d is LibraryDirective)) { addKeyword(Keyword.LIBRARY); @@ -364,7 +364,7 @@ class KeywordHelper { } var fields = node.fields; if (fields.type == null) { - // TODO(brianwilkerson) We should probably not suggest types if `var` is + // TODO(brianwilkerson): We should probably not suggest types if `var` is // being used. addKeyword(Keyword.DYNAMIC); addKeyword(Keyword.VOID); diff --git a/pkg/analysis_server/lib/src/services/completion/dart/local_library_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/local_library_contributor.dart index 91a7786bf3d..76727a85ae8 100644 --- a/pkg/analysis_server/lib/src/services/completion/dart/local_library_contributor.dart +++ b/pkg/analysis_server/lib/src/services/completion/dart/local_library_contributor.dart @@ -191,7 +191,7 @@ class LibraryElementSuggestionBuilder extends GeneralizingElementVisitor { final typeSystem = request.libraryElement.typeSystem; final contextType = request.contextType; if (contextType is InterfaceType) { - // TODO(scheglov) This looks not ideal - we should suggest getters. + // TODO(scheglov): This looks not ideal - we should suggest getters. for (final field in element.fields) { if (field.isStatic && field.isAccessibleIn(request.libraryElement) && diff --git a/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart index 3824ab43107..9ddba66842c 100644 --- a/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart +++ b/pkg/analysis_server/lib/src/services/completion/dart/local_reference_contributor.dart @@ -365,7 +365,7 @@ class _LocalVisitor extends LocalDeclarationVisitor { final typeSystem = request.libraryElement.typeSystem; final contextType = request.contextType; if (contextType is InterfaceType) { - // TODO(scheglov) This looks not ideal - we should suggest getters. + // TODO(scheglov): This looks not ideal - we should suggest getters. for (final field in element.fields) { if (field.isStatic && typeSystem.isSubtypeOf(field.type, contextType)) { diff --git a/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart b/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart index 3096f4f61c9..6045348c6e4 100644 --- a/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart +++ b/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart @@ -112,7 +112,7 @@ class MemberSuggestionBuilder { /// Return `true` if a suggestion for the given [element] should be created. bool _shouldAddSuggestion(Element element) { - // TODO(brianwilkerson) Consider moving this into SuggestionBuilder. + // TODO(brianwilkerson): Consider moving this into SuggestionBuilder. var identifier = element.displayName; var alreadyGenerated = _completionTypesGenerated.putIfAbsent( @@ -194,7 +194,7 @@ class SuggestionBuilder { /// A flag indicating whether a suggestion should replace any earlier /// suggestions for the same completion (`true`) or whether earlier /// suggestions should take priority over more recent suggestions. - // TODO(brianwilkerson) Attempt to convert the contributors so that a single + // TODO(brianwilkerson): Attempt to convert the contributors so that a single // approach is followed. bool laterReplacesEarlier = true; @@ -572,7 +572,7 @@ class SuggestionBuilder { /// Add a suggestion to reference a [field] in a field formal parameter. void suggestFieldFormalParameter(FieldElement field) { - // TODO(brianwilkerson) Add a parameter (`bool includePrefix`) indicating + // TODO(brianwilkerson): Add a parameter (`bool includePrefix`) indicating // whether to include the `this.` prefix in the completion. _addBuilder( _createCompletionSuggestionBuilder( @@ -656,7 +656,7 @@ class SuggestionBuilder { /// Add a suggestion for a [label]. void suggestLabel(Label label) { var completion = label.label.name; - // TODO(brianwilkerson) Figure out why we're excluding labels consisting of + // TODO(brianwilkerson): Figure out why we're excluding labels consisting of // a single underscore. if (completion.isNotEmpty && completion != '_') { var suggestion = CompletionSuggestion(CompletionSuggestionKind.IDENTIFIER, @@ -670,7 +670,7 @@ class SuggestionBuilder { /// Add a suggestion for the `loadLibrary` [function] associated with a /// prefix. void suggestLoadLibraryFunction(FunctionElement function) { - // TODO(brianwilkerson) This might want to use the context type rather than + // TODO(brianwilkerson): This might want to use the context type rather than // a fixed value. var relevance = Relevance.loadLibrary; _addBuilder( @@ -720,7 +720,7 @@ class SuggestionBuilder { void suggestMethod(MethodElement method, {required CompletionSuggestionKind kind, required double inheritanceDistance}) { - // TODO(brianwilkerson) Refactor callers so that we're passing in the type + // TODO(brianwilkerson): Refactor callers so that we're passing in the type // of the target (assuming we don't already have that type available via // the [request]) and compute the [inheritanceDistance] in this method. var featureComputer = request.featureComputer; @@ -753,7 +753,7 @@ class SuggestionBuilder { if (method.name == 'setState' && enclosingElement is ClassElement && flutter.isExactState(enclosingElement)) { - // TODO(brianwilkerson) Make this more efficient by creating the correct + // TODO(brianwilkerson): Make this more efficient by creating the correct // suggestion in the first place. // Find the line indentation. var indent = getRequestLineIndent(request); @@ -796,7 +796,7 @@ class SuggestionBuilder { /// Add a suggestion to use the [name] at a declaration site. void suggestName(String name) { - // TODO(brianwilkerson) Explore whether there are any features of the name + // TODO(brianwilkerson): Explore whether there are any features of the name // that can be used to provide better relevance scores. _addSuggestion(CompletionSuggestion(CompletionSuggestionKind.IDENTIFIER, 500, name, name.length, 0, false, false)); @@ -821,7 +821,7 @@ class SuggestionBuilder { var selectionOffset = completion.length; // Optionally add Flutter child widget details. - // todo (pq): revisit this special casing; likely it can be generalized away + // TODO(pq): revisit this special casing; likely it can be generalized away var element = parameter.enclosingElement; // If appendColon is false, default values should never be appended. if (element is ConstructorElement && appendColon) { @@ -989,7 +989,7 @@ class SuggestionBuilder { /// Add a suggestion for a [parameter]. void suggestParameter(ParameterElement parameter) { var variableType = parameter.type; - // TODO(brianwilkerson) Use the distance to the declaring function as + // TODO(brianwilkerson): Use the distance to the declaring function as // another feature. var contextType = request.featureComputer .contextTypeFeature(request.contextType, variableType); @@ -1015,7 +1015,7 @@ class SuggestionBuilder { /// Add a suggestion for a [prefix] associated with a [library]. void suggestPrefix(LibraryElement library, String prefix) { var elementKind = _computeElementKind(library); - // TODO(brianwilkerson) If we are in a constant context it would be nice + // TODO(brianwilkerson): If we are in a constant context it would be nice // to promote prefixes for libraries that define constants, but that // might be more work than it's worth. var relevance = _computeRelevance( @@ -1273,7 +1273,7 @@ class SuggestionBuilder { var key = suggestion.key; listener?.builtSuggestion(suggestion); if (laterReplacesEarlier || !_suggestionMap.containsKey(key)) { - // TODO(brianwilkerson) Add some specific tests of shadowing behavior. + // TODO(brianwilkerson): Add some specific tests of shadowing behavior. if (suggestion is _CompletionSuggestionBuilderImpl) { // We need to special-case constructors because the order in which // suggestions are added has been changed by the move to @@ -1384,7 +1384,7 @@ class SuggestionBuilder { /// Return the relevance score for a top-level [element]. int _computeTopLevelRelevance(Element element, {required DartType elementType}) { - // TODO(brianwilkerson) The old relevance computation used a signal based + // TODO(brianwilkerson): The old relevance computation used a signal based // on whether the element being suggested was from the same library in // which completion is being performed. Explore whether that's a useful // signal. @@ -1729,7 +1729,7 @@ class _CompletionSuggestionBuilderImpl implements CompletionSuggestionBuilder { required this.isNotImported, }); - /// TODO(scheglov) implement better key for not-yet-imported + // TODO(scheglov): implement better key for not-yet-imported @override String get key { var key = completion; diff --git a/pkg/analysis_server/lib/src/services/completion/dart/suggestion_collector.dart b/pkg/analysis_server/lib/src/services/completion/dart/suggestion_collector.dart index 2c9698ebfb3..77eb23ce5ba 100644 --- a/pkg/analysis_server/lib/src/services/completion/dart/suggestion_collector.dart +++ b/pkg/analysis_server/lib/src/services/completion/dart/suggestion_collector.dart @@ -18,7 +18,7 @@ class SuggestionCollector { /// Add the candidate [suggestion] to the list of suggestions. void addSuggestion(CandidateSuggestion suggestion) { - // TODO(brianwilkerson) This potentially needs to handle shadowed names. + // TODO(brianwilkerson): This potentially needs to handle shadowed names. suggestions.add(suggestion); } } diff --git a/pkg/analysis_server/lib/src/services/completion/dart/type_member_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/type_member_contributor.dart index d5d440c805d..015eb91277e 100644 --- a/pkg/analysis_server/lib/src/services/completion/dart/type_member_contributor.dart +++ b/pkg/analysis_server/lib/src/services/completion/dart/type_member_contributor.dart @@ -52,7 +52,7 @@ class TypeMemberContributor extends DartCompletionContributor { expression is ExtensionOverride) { var containingNode = request.target.containingNode; if (containingNode is ObjectPattern) { - // TODO(brianwilkerson) This is really only intended to be reached when + // TODO(brianwilkerson): This is really only intended to be reached when // `expression` is `null`. It's not ideal that we're using this // contributor this way, and we should look into better ways to // structure the code. diff --git a/pkg/analysis_server/lib/src/services/completion/dart/utilities.dart b/pkg/analysis_server/lib/src/services/completion/dart/utilities.dart index c1eca27106e..a113e2bda30 100644 --- a/pkg/analysis_server/lib/src/services/completion/dart/utilities.dart +++ b/pkg/analysis_server/lib/src/services/completion/dart/utilities.dart @@ -95,7 +95,7 @@ CompletionDefaultArgumentList computeCompletionDefaultArgumentList( var rangeStart = offset; int rangeLength; - // todo (pq): consider adding ranges for params + // TODO(pq): consider adding ranges for params // pending: https://github.com/dart-lang/sdk/issues/40207 // (types in closure param completions make this UX awkward) final parametersString = buildClosureParameters(parameterType); @@ -103,7 +103,7 @@ CompletionDefaultArgumentList computeCompletionDefaultArgumentList( blockBuffer.write(' '); - // todo (pq): consider refactoring to share common logic w/ + // TODO(pq): consider refactoring to share common logic w/ // ArgListContributor.buildClosureSuggestions final returnType = parameterType.returnType; if (returnType is VoidType) { @@ -156,7 +156,7 @@ protocol.Element createLocalElement( bool isAbstract = false, bool isDeprecated = false}) { var name = id.name; - // TODO(danrubel) use lineInfo to determine startLine and startColumn + // TODO(danrubel): use lineInfo to determine startLine and startColumn var location = Location(source.fullName, id.offset, id.length, 0, 0, endLine: 0, endColumn: 0); var flags = protocol.Element.makeFlags( diff --git a/pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart b/pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart index ab17f1211e0..6562fc730a1 100644 --- a/pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart +++ b/pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart @@ -107,7 +107,7 @@ class StatementCompletionProcessor { final StatementCompletionContext statementContext; final CorrectionUtils utils; - /// TODO(brianwilkerson) Refactor the code so that the completion is returned + // TODO(brianwilkerson): Refactor the code so that the completion is returned /// from the methods in which it's computed rather than being a field that we /// have to test. StatementCompletion? completion; @@ -206,7 +206,7 @@ class StatementCompletionProcessor { void _addReplaceEdit(SourceRange range, String text) { var edit = SourceEdit(range.offset, range.length, text); - // TODO(brianwilkerson) The commented out function call has been inlined in + // TODO(brianwilkerson): The commented out function call has been inlined in // order to work around a situation in which _complete_doStatement creates // a conflicting edit that happens to work because of the order in which // the edits are applied. The implementation needs to be cleaned up in @@ -408,7 +408,7 @@ class StatementCompletionProcessor { } else { insertOffset = expr.end; } - //TODO(messick) Uncomment the following line when error location is fixed. + // TODO(messick): Uncomment the following line when error location is fixed. //insertOffset = error.offset + error.length; _addInsertEdit(insertOffset, ';'); delta = 1; @@ -897,7 +897,7 @@ class StatementCompletionProcessor { var error = _findError(ParserErrorCode.EXPECTED_TOKEN, partialMatch: "';'"); if (error != null) { var previousInsertions = _lengthOfInsertions(); - // TODO(messick) Fix this to find the correct place in all cases. + // TODO(messick): Fix this to find the correct place in all cases. var insertOffset = error.offset + error.length; _addInsertEdit(insertOffset, ';'); var offset = _appendNewlinePlusIndent() + 1 /*';'*/ + previousInsertions; diff --git a/pkg/analysis_server/lib/src/services/completion/yaml/analysis_options_generator.dart b/pkg/analysis_server/lib/src/services/completion/yaml/analysis_options_generator.dart index 9d3b3c55eea..0ff4c486b33 100644 --- a/pkg/analysis_server/lib/src/services/completion/yaml/analysis_options_generator.dart +++ b/pkg/analysis_server/lib/src/services/completion/yaml/analysis_options_generator.dart @@ -17,7 +17,7 @@ import 'package:analyzer/src/task/options.dart'; class AnalysisOptionsGenerator extends YamlCompletionGenerator { /// The producer representing the known valid structure of an analysis options /// file. - // TODO(brianwilkerson) We need to support multiple valid formats. + // TODO(brianwilkerson): We need to support multiple valid formats. // For example, the lint rules can either be a list or a map, but we only // suggest list items. static MapProducer analysisOptionsProducer = MapProducer({ @@ -39,9 +39,9 @@ class AnalysisOptionsGenerator extends YamlCompletionGenerator { AnalyzerOptions.codeStyle: MapProducer({ AnalyzerOptions.format: BooleanProducer(), }), - // TODO(brianwilkerson) Create a producer to produce `package:` URIs. + // TODO(brianwilkerson): Create a producer to produce `package:` URIs. AnalyzerOptions.include: EmptyProducer(), - // TODO(brianwilkerson) Create constants for 'linter' and 'rules'. + // TODO(brianwilkerson): Create constants for 'linter' and 'rules'. 'linter': MapProducer({ 'rules': ListProducer(_LintRuleProducer()), }), @@ -104,7 +104,7 @@ class _LintRuleProducer extends Producer { Iterable suggestions( YamlCompletionRequest request) sync* { for (var rule in Registry.ruleRegistry.rules) { - // todo(pq): consider suggesting internal lints if editing an SDK options file + // TODO(pq): consider suggesting internal lints if editing an SDK options file if (!rule.state.isInternal) { yield identifier(rule.name); } diff --git a/pkg/analysis_server/lib/src/services/completion/yaml/fix_data_generator.dart b/pkg/analysis_server/lib/src/services/completion/yaml/fix_data_generator.dart index d57592a9ac9..e343a858baa 100644 --- a/pkg/analysis_server/lib/src/services/completion/yaml/fix_data_generator.dart +++ b/pkg/analysis_server/lib/src/services/completion/yaml/fix_data_generator.dart @@ -28,7 +28,7 @@ class FixDataGenerator extends YamlCompletionGenerator { /// The producer representing the known valid structure of a list of changes. static const ListProducer _changesProducer = ListProducer(MapProducer({ - // TODO(brianwilkerson) Create a way to tailor the list of additional + // TODO(brianwilkerson): Create a way to tailor the list of additional // keys based on the kind when a kind has already been provided. 'kind': EnumProducer([ 'addParameter', @@ -44,7 +44,7 @@ class FixDataGenerator extends YamlCompletionGenerator { 'argumentValue': MapProducer({ 'expression': EmptyProducer(), 'requiredIf': EmptyProducer(), - // TODO(brianwilkerson) Figure out how to support 'variables'. + // TODO(brianwilkerson): Figure out how to support 'variables'. 'variables': EmptyProducer(), }), 'extends': EmptyProducer(), @@ -55,7 +55,7 @@ class FixDataGenerator extends YamlCompletionGenerator { /// The producer representing the known valid structure of an element. static const MapProducer _elementProducer = MapProducer({ - // TODO(brianwilkerson) Support suggesting uris. + // TODO(brianwilkerson): Support suggesting uris. 'uris': EmptyProducer(), 'class': EmptyProducer(), 'constant': EmptyProducer(), diff --git a/pkg/analysis_server/lib/src/services/completion/yaml/producer.dart b/pkg/analysis_server/lib/src/services/completion/yaml/producer.dart index 5d7f6813416..89b09087261 100644 --- a/pkg/analysis_server/lib/src/services/completion/yaml/producer.dart +++ b/pkg/analysis_server/lib/src/services/completion/yaml/producer.dart @@ -132,7 +132,7 @@ class ListProducer extends Producer { Iterable suggestions( YamlCompletionRequest request) sync* { for (var suggestion in element.suggestions(request)) { - // TODO(brianwilkerson) Consider prepending the suggestion with a hyphen + // TODO(brianwilkerson): Consider prepending the suggestion with a hyphen // when the current node isn't already preceded by a hyphen. The // cleanest way to do this is probably to access the [element] producer // in the place where we're choosing a producer in that situation. diff --git a/pkg/analysis_server/lib/src/services/completion/yaml/pubspec_generator.dart b/pkg/analysis_server/lib/src/services/completion/yaml/pubspec_generator.dart index 9c2e55868b9..e75831d5b58 100644 --- a/pkg/analysis_server/lib/src/services/completion/yaml/pubspec_generator.dart +++ b/pkg/analysis_server/lib/src/services/completion/yaml/pubspec_generator.dart @@ -79,7 +79,7 @@ class PubspecGenerator extends YamlCompletionGenerator { }), 'dependencies': PubPackageNameProducer(), 'dev_dependencies': PubPackageNameProducer(), - // TODO(brianwilkerson) Suggest names already listed under 'dependencies' + // TODO(brianwilkerson): Suggest names already listed under 'dependencies' // and 'dev_dependencies'. 'dependency_overrides': EmptyProducer(), 'flutter': MapProducer({ diff --git a/pkg/analysis_server/lib/src/services/correction/assist.dart b/pkg/analysis_server/lib/src/services/correction/assist.dart index aefb4e59629..e7f1df264b5 100644 --- a/pkg/analysis_server/lib/src/services/correction/assist.dart +++ b/pkg/analysis_server/lib/src/services/correction/assist.dart @@ -347,7 +347,7 @@ class DartAssistKind { 'Join variable declaration', ); static const REMOVE_TYPE_ANNOTATION = AssistKind( - // todo (pq): unify w/ fix + // TODO(pq): unify w/ fix 'dart.assist.remove.typeAnnotation', DartAssistKindPriority.PRIORITY, 'Remove type annotation', diff --git a/pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart b/pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart index 26b61ad5f85..8eb9851c358 100644 --- a/pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart +++ b/pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart @@ -93,12 +93,12 @@ class BulkFixProcessor { CompileTimeErrorCode.EXTENDS_NON_CLASS: [ DataDriven.new, ], - // TODO(brianwilkerson) The following fix fails if an invocation of the + // TODO(brianwilkerson): The following fix fails if an invocation of the // function is the argument that needs to be removed. // CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS: [ // DataDriven.newInstance, // ], - // TODO(brianwilkerson) The following fix fails if an invocation of the + // TODO(brianwilkerson): The following fix fails if an invocation of the // function is the argument that needs to be updated. // CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED: [ // DataDriven.newInstance, diff --git a/pkg/analysis_server/lib/src/services/correction/dart/abstract_producer.dart b/pkg/analysis_server/lib/src/services/correction/dart/abstract_producer.dart index e3f47a701e3..e2dc8ff3f3b 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/abstract_producer.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/abstract_producer.dart @@ -136,7 +136,7 @@ class CorrectionProducerContext { final UnitResult unitResult; final ChangeWorkspace workspace; - /// TODO(migration) Make it non-nullable, specialize "fix" context? + // TODO(migration): Make it non-nullable, specialize "fix" context? final DartFixContext? dartFixContext; /// A flag indicating whether the correction producers will be run in the @@ -257,7 +257,7 @@ class CorrectionProducerContext { abstract class CorrectionProducerWithDiagnostic extends ResolvedCorrectionProducer { - /// TODO(migration) Consider providing it via constructor. + // TODO(migration): Consider providing it via constructor. @override Diagnostic get diagnostic => super.diagnostic!; } @@ -514,7 +514,7 @@ abstract class ResolvedCorrectionProducer /// The behavior shared by [ResolvedCorrectionProducer] and [MultiCorrectionProducer]. abstract class _AbstractCorrectionProducer { /// The context used to produce corrections. - /// TODO(migration) Make it not `late`, require in constructor. + // TODO(migration): Make it not `late`, require in constructor. late CorrectionProducerContext _context; /// The most deeply nested node that completely covers the highlight region of @@ -533,7 +533,7 @@ abstract class _AbstractCorrectionProducer { /// the diagnostic, or `null` if there is no diagnostic or if such a node does /// not exist. AstNode? get coveredNode { - // TODO(brianwilkerson) Consider renaming this to `coveringNode`. + // TODO(brianwilkerson): Consider renaming this to `coveringNode`. if (_coveredNode == null) { final diagnostic = this.diagnostic; if (diagnostic == null) { @@ -719,7 +719,7 @@ abstract class _AbstractCorrectionProducer { extension DartFileEditBuilderExtension on DartFileEditBuilder { /// Add edits to the [builder] to remove any parentheses enclosing the /// [expression]. - // TODO(brianwilkerson) Consider moving this to DartFileEditBuilder. + // TODO(brianwilkerson): Consider moving this to DartFileEditBuilder. void removeEnclosingParentheses(Expression expression) { var precedence = getExpressionPrecedence(expression); while (expression.parent is ParenthesizedExpression) { diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_async.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_async.dart index 850e4b47dbd..9a31f295d7b 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/add_async.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/add_async.dart @@ -11,7 +11,7 @@ import 'package:analyzer_plugin/utilities/change_builder/change_builder_core.dar import 'package:analyzer_plugin/utilities/fixes/fixes.dart'; class AddAsync extends ResolvedCorrectionProducer { - // todo(pq): consider adding a variation that adds an `await` as well + // TODO(pq): consider adding a variation that adds an `await` as well /// A flag indicating whether this producer is producing a fix in the case /// where a function is missing a return at the end. diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_key_to_constructors.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_key_to_constructors.dart index 18029aa8c01..65f4d118c25 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/add_key_to_constructors.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/add_key_to_constructors.dart @@ -183,7 +183,7 @@ class AddKeyToConstructors extends ResolvedCorrectionProducer { if (constructor.factoryKeyword != null || constructor.redirectedConstructor != null) { // Can't have a super constructor invocation. - // TODO(brianwilkerson) Consider extending the redirected constructor to + // TODO(brianwilkerson): Consider extending the redirected constructor to // also take a key, or finding the constructor invocation in the body of // the factory and updating it. return; diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_late.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_late.dart index 10eada6a46c..306b57c4344 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/add_late.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/add_late.dart @@ -31,7 +31,7 @@ class AddLate extends ResolvedCorrectionProducer { var keyword = variableList.keyword; if (keyword == null) { await _insertAt(builder, variableList.variables[0].offset); - // TODO(brianwilkerson) Consider converting this into an assist and + // TODO(brianwilkerson): Consider converting this into an assist and // expand it to support converting `var` to `late` as well as // working anywhere a non-late local variable or field is selected. // } else if (keyword.type == Keyword.VAR) { diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_case_clauses.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_case_clauses.dart index 690760c6d84..6efae3a5427 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_case_clauses.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_case_clauses.dart @@ -95,7 +95,7 @@ class AddMissingEnumCaseClauses extends ResolvedCorrectionProducer { ? statement.rightParenthesis.end : location.offset; await builder.addDartFileEdit(file, (builder) { - // TODO(brianwilkerson) Consider inserting the names in order into the + // TODO(brianwilkerson): Consider inserting the names in order into the // switch statement. builder.addInsertion(insertionOffset, (builder) { void addMissingCase(String expression) { diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_like_case_clauses.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_like_case_clauses.dart index 5d191c2b86a..5e2bcb323b1 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_like_case_clauses.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/add_missing_enum_like_case_clauses.dart @@ -14,7 +14,7 @@ class AddMissingEnumLikeCaseClauses extends ResolvedCorrectionProducer { @override FixKind get fixKind => DartFixKind.ADD_MISSING_ENUM_CASE_CLAUSES; - // TODO: Consider enabling this lint for fix all in file. + // TODO(brianwilkerson): Consider enabling this lint for fix all in file. // @override // FixKind? get multiFixKind => super.multiFixKind; @@ -42,7 +42,7 @@ class AddMissingEnumLikeCaseClauses extends ResolvedCorrectionProducer { ); await builder.addDartFileEdit(file, (builder) { - // TODO(brianwilkerson) Consider inserting the names in order into the + // TODO(brianwilkerson): Consider inserting the names in order into the // switch statement. builder.addInsertion(location.offset, (builder) { builder.write(location.prefix); diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_override.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_override.dart index b69421e089a..7eb5ca0cb94 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/add_override.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/add_override.dart @@ -31,7 +31,7 @@ class AddOverride extends ResolvedCorrectionProducer { return; } - //TODO(pq): migrate annotation edit building to change_builder + // TODO(pq): migrate annotation edit building to change_builder // Handle doc comments. var token = member.beginToken; diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_return_type.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_return_type.dart index 6effc955d71..7fc784c0e9e 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/add_return_type.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/add_return_type.dart @@ -125,7 +125,7 @@ class AddReturnType extends ResolvedCorrectionProducer { /// Copied from lib/src/services/refactoring/extract_method.dart", but /// [hasReturn] was added. -// TODO(brianwilkerson) Decide whether to unify the two classes. +// TODO(brianwilkerson): Decide whether to unify the two classes. class _ReturnTypeComputer extends RecursiveAstVisitor { final TypeSystem typeSystem; diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_type_annotation.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_type_annotation.dart index 4acc0a60418..16789f46b00 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/add_type_annotation.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/add_type_annotation.dart @@ -148,7 +148,7 @@ class AddTypeAnnotation extends ResolvedCorrectionProducer { } // Prepare the type. var type = parameter.declaredElement!.type; - // TODO(scheglov) If the parameter is in a method declaration, and if the + // TODO(scheglov): If the parameter is in a method declaration, and if the // method overrides a method that has a type for the corresponding // parameter, it would be nice to copy down the type from the overridden // method. diff --git a/pkg/analysis_server/lib/src/services/correction/dart/change_argument_name.dart b/pkg/analysis_server/lib/src/services/correction/dart/change_argument_name.dart index 77d4212e53b..60dbacd4e96 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/change_argument_name.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/change_argument_name.dart @@ -35,7 +35,7 @@ class ChangeArgumentName extends MultiCorrectionProducer { for (var proposedName in names) { var distance = _computeDistance(currentName, proposedName); if (distance <= _maxDistance) { - // TODO(brianwilkerson) Create a way to use the distance as part of the + // TODO(brianwilkerson): Create a way to use the distance as part of the // computation of the priority (so that closer names sort first). producers.add(_ChangeName(currentNameNode, proposedName)); } diff --git a/pkg/analysis_server/lib/src/services/correction/dart/change_to.dart b/pkg/analysis_server/lib/src/services/correction/dart/change_to.dart index 3cd197eded9..7c517dc3288 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/change_to.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/change_to.dart @@ -56,9 +56,9 @@ class ChangeTo extends ResolvedCorrectionProducer { @override Future compute(ChangeBuilder builder) async { - // TODO(brianwilkerson) Unify these separate methods as much as is + // TODO(brianwilkerson): Unify these separate methods as much as is // reasonably possible. - // TODO(brianwilkerson) Consider proposing all of the names within a + // TODO(brianwilkerson): Consider proposing all of the names within a // reasonable distance, rather than just the first near match we find. if (_kind == _ReplacementKind.annotation) { await _proposeAnnotation(builder); diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_add_all_to_spread.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_add_all_to_spread.dart index a679a488a41..dc9077f31d0 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/convert_add_all_to_spread.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_add_all_to_spread.dart @@ -74,7 +74,7 @@ class ConvertAddAllToSpread extends ResolvedCorrectionProducer { var sections = cascade.cascadeSections; var targetList = cascade.target; if (targetList is! ListLiteral || sections[0] != invocation) { - // TODO(brianwilkerson) Consider extending this to handle set literals. + // TODO(brianwilkerson): Consider extending this to handle set literals. return; } @@ -104,7 +104,7 @@ class ConvertAddAllToSpread extends ResolvedCorrectionProducer { // ..addAll([ ... ]) var elements = argument.elements; if (elements.isEmpty) { - // TODO(brianwilkerson) Consider adding a cleanup for the empty list + // TODO(brianwilkerson): Consider adding a cleanup for the empty list // case. We can essentially remove the whole invocation because it does // nothing. return; diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_enum.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_enum.dart index b75300b0812..ef84d142f8e 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_enum.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_class_to_enum.dart @@ -614,7 +614,7 @@ class _EnumDescription { if (list.length == 1) { fieldsToConvert.add(list[0]); } else { - // TODO(brianwilkerson) We could potentially handle the case where + // TODO(brianwilkerson): We could potentially handle the case where // there's only one non-deprecated field in the list. We'd need to // change the return type for this method so that we could return two // lists: the list of fields to convert and the list of fields whose diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_into_for_index.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_for_index.dart index 8e796536e62..dfd677bffbd 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/convert_into_for_index.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_into_for_index.dart @@ -82,7 +82,7 @@ class ConvertIntoForIndex extends ResolvedCorrectionProducer { var firstBlockLine = utils.getLineContentEnd(body.leftBracket.end); // add change await builder.addDartFileEdit(file, (builder) { - // TODO(brianwilkerson) Create linked positions for the loop variable. + // TODO(brianwilkerson): Create linked positions for the loop variable. builder.addSimpleReplacement( range.startEnd(forStatement, forStatement.rightParenthesis), 'for (int $indexName = 0; $indexName < $listName.length; $indexName++)'); diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_expression_function_body.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_expression_function_body.dart index 4c1943f8912..105ee5a3bc2 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_expression_function_body.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_expression_function_body.dart @@ -37,8 +37,8 @@ class ConvertToExpressionFunctionBody extends ResolvedCorrectionProducer { if (body.keyword?.precedingComments != null || body.block.leftBracket.precedingComments != null || body.block.rightBracket.precedingComments != null) { - // TODO(https://github.com/dart-lang/sdk/issues/29313): Include comments - // in fixed output. + // TODO(srawlins): Include comments in fixed output. + // https://github.com/dart-lang/sdk/issues/29313 return; } var parent = body.parent; @@ -56,28 +56,30 @@ class ConvertToExpressionFunctionBody extends ResolvedCorrectionProducer { if (onlyStatement is ReturnStatement) { returnExpression = onlyStatement.expression; if (onlyStatement.returnKeyword.precedingComments != null) { - // TODO(https://github.com/dart-lang/sdk/issues/29313): Include comments - // in fixed output. + // TODO(srawlins): Include comments in fixed output. + // https://github.com/dart-lang/sdk/issues/29313 return; } - // TODO(https://github.com/dart-lang/sdk/issues/29313): If there are - // comments after `return` keyword, before the expression, either return - // without offering a fix, or include the comments in the fixed output. + // TODO(srawlins): If there are comments after `return` keyword, before + // the expression, either return without offering a fix, or include the + // comments in the fixed output. + // https://github.com/dart-lang/sdk/issues/29313 if (onlyStatement.semicolon.precedingComments != null) { - // TODO(https://github.com/dart-lang/sdk/issues/29313): Include - // comments in fixed output. + // TODO(srawlins): Include comments in fixed output. + // https://github.com/dart-lang/sdk/issues/29313 return; } } else if (onlyStatement is ExpressionStatement) { returnExpression = onlyStatement.expression; - // TODO(https://github.com/dart-lang/sdk/issues/29313): If there are - // comments before the expression, either return without offering a fix, - // or include the comments in the fixed output. + // TODO(srawlins): If there are comments before the expression, + // either return without offering a fix, or include the comments in the + // fixed output. + // https://github.com/dart-lang/sdk/issues/29313 if (onlyStatement.semicolon?.precedingComments != null) { - // TODO(https://github.com/dart-lang/sdk/issues/29313): Include comments - // in fixed output. + // TODO(srawlins): Include comments in fixed output. + // https://github.com/dart-lang/sdk/issues/29313 return; } } diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_set_literal.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_set_literal.dart index c5b0d23eec9..19030fdcfa0 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_set_literal.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_set_literal.dart @@ -83,7 +83,7 @@ class ConvertToSetLiteral extends ResolvedCorrectionProducer { elementsRange = range.endStart(elements.leftBracket, elements.rightBracket); } else { - // TODO(brianwilkerson) Consider handling other iterables. Literal + // TODO(brianwilkerson): Consider handling other iterables. Literal // sets could be treated like lists, and arbitrary iterables by using // a spread. return; @@ -144,7 +144,7 @@ class ConvertToSetLiteral extends ResolvedCorrectionProducer { return null; } - // TODO(brianwilkerson) Consider also accepting uses of LinkedHashSet. + // TODO(brianwilkerson): Consider also accepting uses of LinkedHashSet. if (type.element != typeProvider.setElement) { return null; } diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_switch_expression.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_switch_expression.dart index 41244525770..bda3183d78c 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/convert_to_switch_expression.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_to_switch_expression.dart @@ -156,7 +156,7 @@ class ConvertToSwitchExpression extends ResolvedCorrectionProducer { var memberCount = node.members.length; for (var i = 0; i < memberCount; ++i) { - // todo(pq): extract shared replacement logic + // TODO(pq): extract shared replacement logic var member = node.members[i]; if (member is SwitchDefault) { convertSwitchDefault(builder, member); @@ -215,7 +215,7 @@ class ConvertToSwitchExpression extends ResolvedCorrectionProducer { var memberCount = node.members.length; for (var i = 0; i < memberCount; ++i) { - // todo(pq): extract shared replacement logic + // TODO(pq): extract shared replacement logic var member = node.members[i]; if (member is SwitchDefault) { convertSwitchDefault(builder, member); @@ -262,7 +262,7 @@ class ConvertToSwitchExpression extends ResolvedCorrectionProducer { return deletion; } - // todo(pq): refactor the `is` checks to a single `getSwitchKind` + // TODO(pq): refactor the `is` checks to a single `getSwitchKind` // that only looks at members once // see: https://dart-review.googlesource.com/c/sdk/+/287904 bool isArgumentSwitch(SwitchStatement node) { diff --git a/pkg/analysis_server/lib/src/services/correction/dart/create_class.dart b/pkg/analysis_server/lib/src/services/correction/dart/create_class.dart index bcb773979f1..1d4ad02b32b 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/create_class.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/create_class.dart @@ -32,7 +32,7 @@ class CreateClass extends ResolvedCorrectionProducer { var name = targetNode.name; arguments = targetNode.arguments; if (name.staticElement != null || arguments == null) { - // TODO(brianwilkerson) Consider supporting creating a class when the + // TODO(brianwilkerson): Consider supporting creating a class when the // arguments are missing by also adding an empty argument list. return; } @@ -138,7 +138,7 @@ class CreateClass extends ResolvedCorrectionProducer { static bool _requiresConstConstructor(AstNode node) { final parent = node.parent; - // TODO(scheglov) remove after NamedType refactoring. + // TODO(scheglov): remove after NamedType refactoring. if (node is SimpleIdentifier && parent is NamedType) { return _requiresConstConstructor(parent); } diff --git a/pkg/analysis_server/lib/src/services/correction/dart/create_constructor.dart b/pkg/analysis_server/lib/src/services/correction/dart/create_constructor.dart index dfab1151261..09f87cd2d34 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/create_constructor.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/create_constructor.dart @@ -15,7 +15,7 @@ import 'package:analyzer_plugin/utilities/range_factory.dart'; class CreateConstructor extends ResolvedCorrectionProducer { /// The name of the constructor being created. - /// TODO(migration) We set this node when we have the change. + // TODO(migration): We set this node when we have the change. late String _constructorName; @override diff --git a/pkg/analysis_server/lib/src/services/correction/dart/create_file.dart b/pkg/analysis_server/lib/src/services/correction/dart/create_file.dart index b1cc740aed4..491e997216d 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/create_file.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/create_file.dart @@ -21,11 +21,11 @@ class CreateFile extends ResolvedCorrectionProducer { @override Future compute(ChangeBuilder builder) async { - // TODO(brianwilkerson) Generalize this to allow other valid string literals. + // TODO(brianwilkerson): Generalize this to allow other valid string literals. if (node is SimpleStringLiteral) { var parent = node.parent; if (parent is NamespaceDirective) { - // TODO(brianwilkerson) Support the case where the node's parent is a + // TODO(brianwilkerson): Support the case where the node's parent is a // Configuration. var source = parent.referencedSource; if (source != null) { diff --git a/pkg/analysis_server/lib/src/services/correction/dart/data_driven.dart b/pkg/analysis_server/lib/src/services/correction/dart/data_driven.dart index 142f65c1804..94deaa33dd2 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/data_driven.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/data_driven.dart @@ -26,7 +26,7 @@ class DataDriven extends MultiCorrectionProducer { var importedUris = []; var library = unitResult.libraryElement; for (var importElement in library.libraryImports) { - // TODO(brianwilkerson) Filter based on combinators to help avoid making + // TODO(brianwilkerson): Filter based on combinators to help avoid making // invalid suggestions. var uri = importElement.uri; if (uri is DirectiveUriWithRelativeUri) { diff --git a/pkg/analysis_server/lib/src/services/correction/dart/destructure_local_variable_assignment.dart b/pkg/analysis_server/lib/src/services/correction/dart/destructure_local_variable_assignment.dart index 388083e7f7e..9070bf77b9a 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/destructure_local_variable_assignment.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/destructure_local_variable_assignment.dart @@ -38,7 +38,7 @@ class DestructureLocalVariableAssignment extends ResolvedCorrectionProducer { Future computeObjectPattern(InterfaceType type, VariableDeclaration node, ChangeBuilder builder) async { - // todo(pq): share reference checking w/ record computation + // TODO(pq): share reference checking w/ record computation var variableElement = node.declaredElement; if (variableElement is! LocalVariableElement) return; diff --git a/pkg/analysis_server/lib/src/services/correction/dart/extend_class_for_mixin.dart b/pkg/analysis_server/lib/src/services/correction/dart/extend_class_for_mixin.dart index 3fde034b8f5..6cee3431d0f 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/extend_class_for_mixin.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/extend_class_for_mixin.dart @@ -26,7 +26,7 @@ class ExtendClassForMixin extends ResolvedCorrectionProducer { var declaration = node.thisOrAncestorOfType(); if (declaration != null && declaration.extendsClause == null) { - // TODO(brianwilkerson) Find a way to pass in the name of the class + // TODO(brianwilkerson): Find a way to pass in the name of the class // without needing to parse the message. var message = diagnostic.problemMessage.messageText(includeUrl: false); var endIndex = message.lastIndexOf("'"); diff --git a/pkg/analysis_server/lib/src/services/correction/dart/flutter_remove_widget.dart b/pkg/analysis_server/lib/src/services/correction/dart/flutter_remove_widget.dart index 193d3c8cc0e..bfbba7bebe5 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/flutter_remove_widget.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/flutter_remove_widget.dart @@ -18,7 +18,7 @@ class FlutterRemoveWidget extends ResolvedCorrectionProducer { @override AssistKind get assistKind => DartAssistKind.FLUTTER_REMOVE_WIDGET; - /// todo(pq): find out why overlapping edits are not being applied (and enable) + // TODO(pq): find out why overlapping edits are not being applied (and enable) @override bool get canBeAppliedInBulk => false; diff --git a/pkg/analysis_server/lib/src/services/correction/dart/import_library.dart b/pkg/analysis_server/lib/src/services/correction/dart/import_library.dart index a66920fa4f2..5d10cc90cb7 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/import_library.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/import_library.dart @@ -194,7 +194,7 @@ class ImportLibrary extends MultiCorrectionProducer { if (combinators.length == 1) { var combinator = combinators[0]; if (combinator is HideElementCombinator) { - // TODO(brianwilkerson) Support removing the extension name from a + // TODO(brianwilkerson): Support removing the extension name from a // hide combinator. } else if (combinator is ShowElementCombinator) { producers.add(_ImportLibraryShow( @@ -278,7 +278,7 @@ class ImportLibrary extends MultiCorrectionProducer { if (combinators.length == 1) { var combinator = combinators[0]; if (combinator is HideElementCombinator) { - // TODO(brianwilkerson) Support removing the element name from a + // TODO(brianwilkerson): Support removing the element name from a // hide combinator. } else if (combinator is ShowElementCombinator) { // prepare library name - unit name or 'dart:name' for SDK library diff --git a/pkg/analysis_server/lib/src/services/correction/dart/inline_invocation.dart b/pkg/analysis_server/lib/src/services/correction/dart/inline_invocation.dart index 1219719088b..5efa5a82490 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/inline_invocation.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/inline_invocation.dart @@ -59,7 +59,7 @@ class InlineInvocation extends ResolvedCorrectionProducer { var sections = cascade.cascadeSections; var target = cascade.target; if (target is! ListLiteral || sections[0] != invocation) { - // TODO(brianwilkerson) Consider extending this to handle set literals. + // TODO(brianwilkerson): Consider extending this to handle set literals. return; } var argument = invocation.argumentList.arguments[0]; diff --git a/pkg/analysis_server/lib/src/services/correction/dart/inline_typedef.dart b/pkg/analysis_server/lib/src/services/correction/dart/inline_typedef.dart index e7e88d2adbe..3ce3a30a8ae 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/inline_typedef.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/inline_typedef.dart @@ -59,7 +59,7 @@ class InlineTypedef extends ResolvedCorrectionProducer { } else { return; } - // TODO(brianwilkerson) Handle parts. + // TODO(brianwilkerson): Handle parts. var finder = _ReferenceFinder(_name); unit.accept(finder); var reference = finder.reference; diff --git a/pkg/analysis_server/lib/src/services/correction/dart/make_field_public.dart b/pkg/analysis_server/lib/src/services/correction/dart/make_field_public.dart index dc9ee254141..ef98fbc0347 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/make_field_public.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/make_field_public.dart @@ -67,11 +67,11 @@ class MakeFieldPublic extends ResolvedCorrectionProducer { extension on DartFileEditBuilder { void removeMember(NodeList members, ClassMember member) { - // TODO(brianwilkerson) Consider moving this to DartFileEditBuilder. + // TODO(brianwilkerson): Consider moving this to DartFileEditBuilder. var index = members.indexOf(member); if (index == 0) { if (members.length == 1) { - // TODO(brianwilkerson) Remove the whitespace before and after the + // TODO(brianwilkerson): Remove the whitespace before and after the // member. addDeletion(range.node(member)); } else { diff --git a/pkg/analysis_server/lib/src/services/correction/dart/organize_imports.dart b/pkg/analysis_server/lib/src/services/correction/dart/organize_imports.dart index 0d20071ee13..b56c19a14b5 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/organize_imports.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/organize_imports.dart @@ -27,7 +27,7 @@ class OrganizeImports extends ResolvedCorrectionProducer { Future compute(ChangeBuilder builder) async { var organizer = ImportOrganizer(unitResult.content, unit, unitResult.errors); - // todo (pq): consider restructuring organizer to allow a passed-in change + // TODO(pq): consider restructuring organizer to allow a passed-in change // builder for (var edit in organizer.organize()) { await builder.addDartFileEdit(file, (builder) { diff --git a/pkg/analysis_server/lib/src/services/correction/dart/qualify_reference.dart b/pkg/analysis_server/lib/src/services/correction/dart/qualify_reference.dart index fa369ddd883..be5530933df 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/qualify_reference.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/qualify_reference.dart @@ -43,7 +43,7 @@ class QualifyReference extends ResolvedCorrectionProducer { var enclosingElement = memberElement.enclosingElement; if (enclosingElement == null || enclosingElement.library != libraryElement) { - // TODO(brianwilkerson) Support qualifying references to members defined + // TODO(brianwilkerson): Support qualifying references to members defined // in other libraries. `DartEditBuilder` currently defines the method // `writeType`, which is close, but we also need to handle extensions, // which don't have a type. diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_dead_code.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_dead_code.dart index e51508eb233..e1d4897ad10 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/remove_dead_code.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_dead_code.dart @@ -115,7 +115,7 @@ class RemoveDeadCode extends ResolvedCorrectionProducer { Future _computeDoStatement( ChangeBuilder builder, DoStatement statement) async { if (statement.hasBreakStatement) { - // TODO(asashour) consider modifying the do statement to a label + // TODO(asashour): consider modifying the do statement to a label // https://github.com/dart-lang/sdk/issues/49091#issuecomment-1135489675 return true; } diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_unused.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_unused.dart index 582c43d356c..b3f8b17cb7f 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/remove_unused.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_unused.dart @@ -51,7 +51,7 @@ class RemoveUnusedElement extends _RemoveUnused { ? node.declaredElement! : (node as NamedCompilationUnitMember).declaredElement!; final references = _findAllReferences(unit, element); - // todo (pq): consider filtering for references that are limited to within the class. + // TODO(pq): consider filtering for references that are limited to within the class. if (references.isEmpty) { var parent = node.parent; var grandParent = parent?.parent; @@ -130,7 +130,7 @@ class RemoveUnusedField extends _RemoveUnused { ..._findAllReferences(unit, element), ]; for (var reference in references) { - // todo (pq): consider scoping this to parent or parent.parent. + // TODO(pq): consider scoping this to parent or parent.parent. final referenceNode = reference.thisOrAncestorMatching((node) => node is VariableDeclaration || node is ExpressionStatement || diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_local_variable.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_local_variable.dart index a266a786fe8..210efab8027 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_local_variable.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_unused_local_variable.dart @@ -272,7 +272,7 @@ class RemoveUnusedLocalVariable extends ResolvedCorrectionProducer { } SourceRange _forAssignmentExpression(AssignmentExpression node) { - // todo (pq): consider node.parent is! ExpressionStatement to handle + // TODO(pq): consider node.parent is! ExpressionStatement to handle // assignments in parens, etc. var parent = node.parent!; if (parent is ArgumentList) { diff --git a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_var.dart b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_var.dart index 12d8fee96a7..5397d7e384c 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/replace_with_var.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/replace_with_var.dart @@ -35,7 +35,7 @@ class ReplaceWithVar extends ResolvedCorrectionProducer { if (type == null) { return; } - // TODO(brianwilkerson) Optimize this by removing the duplication between + // TODO(brianwilkerson): Optimize this by removing the duplication between // [_canReplaceWithVar] and the rest of this method. if (!_canReplaceWithVar()) { return; diff --git a/pkg/analysis_server/lib/src/services/correction/dart/shadow_field.dart b/pkg/analysis_server/lib/src/services/correction/dart/shadow_field.dart index 482271ac4ea..78292408948 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/shadow_field.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/shadow_field.dart @@ -29,7 +29,7 @@ class ShadowField extends ResolvedCorrectionProducer { } if (!accessor.isGetter || accessor.enclosingElement is! InterfaceElement) { - // TODO(brianwilkerson) Should we also require that the getter be synthetic? + // TODO(brianwilkerson): Should we also require that the getter be synthetic? return; } @@ -40,7 +40,7 @@ class ShadowField extends ResolvedCorrectionProducer { var enclosingBlock = statement.parent; if (enclosingBlock is! Block) { - // TODO(brianwilkerson) Support adding a block between the statement and + // TODO(brianwilkerson): Support adding a block between the statement and // its parent (where the parent will be something like a while or if // statement). Also support the case where the parent is a case clause. return; @@ -65,9 +65,9 @@ class ShadowField extends ResolvedCorrectionProducer { // await builder.addDartFileEdit(file, (builder) { builder.addInsertion(offset, (builder) { - // TODO(brianwilkerson) Conditionally write a type annotation instead of + // TODO(brianwilkerson): Conditionally write a type annotation instead of // 'var' when we're able to discover user preferences. - // TODO(brianwilkerson) Consider writing `final` rather than `var`. + // TODO(brianwilkerson): Consider writing `final` rather than `var`. builder.write('var '); builder.write(fieldName); builder.write(' = this.'); @@ -75,7 +75,7 @@ class ShadowField extends ResolvedCorrectionProducer { builder.writeln(';'); builder.write(prefix); }); - // TODO(brianwilkerson) Consider removing unnecessary casts and null + // TODO(brianwilkerson): Consider removing unnecessary casts and null // checks that are no longer needed because promotion works. This would // be dependent on whether enhanced promotion is supported in the library // being edited. diff --git a/pkg/analysis_server/lib/src/services/correction/fix.dart b/pkg/analysis_server/lib/src/services/correction/fix.dart index c9b01b143a3..2f77b42cca2 100644 --- a/pkg/analysis_server/lib/src/services/correction/fix.dart +++ b/pkg/analysis_server/lib/src/services/correction/fix.dart @@ -22,7 +22,7 @@ bool hasFix(ErrorCode errorCode) { return FixProcessor.lintProducerMap.containsKey(lintName) || FixProcessor.lintMultiProducerMap.containsKey(lintName); } - // TODO(brianwilkerson) Either deprecate the part of the protocol supported by + // TODO(brianwilkerson): Either deprecate the part of the protocol supported by // this function, or handle error codes associated with non-dart files. return FixProcessor.nonLintProducerMap.containsKey(errorCode) || FixProcessor.nonLintMultiProducerMap.containsKey(errorCode); @@ -759,7 +759,7 @@ class DartFixKind { "Create method '{0}'", ); - // todo (pq): used by LintNames.hash_and_equals; consider removing. + // TODO(pq): used by LintNames.hash_and_equals; consider removing. static const CREATE_METHOD_MULTI = FixKind( 'dart.fix.create.method.multi', DartFixKindPriority.IN_FILE, @@ -891,7 +891,7 @@ class DartFixKind { 'Make final', ); - // todo (pq): consider parameterizing: 'Make {fields} final...' + // TODO(pq): consider parameterizing: 'Make {fields} final...' static const MAKE_FINAL_MULTI = FixKind( 'dart.fix.makeFinal.multi', DartFixKindPriority.IN_FILE, @@ -988,7 +988,8 @@ class DartFixKind { 'Remove argument', ); - // todo (pq): used by LintNames.avoid_redundant_argument_values; consider a parameterized message + // TODO(pq): used by LintNames.avoid_redundant_argument_values; + // consider a parameterized message static const REMOVE_ARGUMENT_MULTI = FixKind( 'dart.fix.remove.argument.multi', DartFixKindPriority.IN_FILE, @@ -1090,7 +1091,7 @@ class DartFixKind { 'Remove duplicate case statement', ); - // todo (pq): is this dangerous to bulk apply? Consider removing. + // TODO(pq): is this dangerous to bulk apply? Consider removing. static const REMOVE_DUPLICATE_CASE_MULTI = FixKind( 'dart.fix.remove.duplicateCase.multi', DartFixKindPriority.IN_FILE, @@ -1202,7 +1203,7 @@ class DartFixKind { 'Remove method declaration', ); - // todo (pq): parameterize to make scope explicit + // TODO(pq): parameterize to make scope explicit static const REMOVE_METHOD_DECLARATION_MULTI = FixKind( 'dart.fix.remove.methodDeclaration.multi', DartFixKindPriority.IN_FILE, @@ -1734,7 +1735,7 @@ class DartFixKind { 'Replace with identifier', ); - // todo (pq): parameterize message (used by LintNames.avoid_types_on_closure_parameters) + // TODO(pq): parameterize message (used by LintNames.avoid_types_on_closure_parameters) static const REPLACE_WITH_IDENTIFIER_MULTI = FixKind( 'dart.fix.replace.withIdentifier.multi', DartFixKindPriority.IN_FILE, diff --git a/pkg/analysis_server/lib/src/services/correction/fix/data_driven/element_descriptor.dart b/pkg/analysis_server/lib/src/services/correction/fix/data_driven/element_descriptor.dart index 13a2fe1d601..aff7cff37e3 100644 --- a/pkg/analysis_server/lib/src/services/correction/fix/data_driven/element_descriptor.dart +++ b/pkg/analysis_server/lib/src/services/correction/fix/data_driven/element_descriptor.dart @@ -43,41 +43,41 @@ class ElementDescriptor { /// Return `true` if the given [node] appears to be consistent with the /// element being described. bool matches(AstNode node) { - // TODO(brianwilkerson) Check the resolved element, if one exists, for more + // TODO(brianwilkerson): Check the resolved element, if one exists, for more // accurate results. return switch (kind) { ElementKind.classKind => - // TODO(brianwilkerson) Handle this case. + // TODO(brianwilkerson): Handle this case. false, ElementKind.constantKind => - // TODO(brianwilkerson) Handle this case. + // TODO(brianwilkerson): Handle this case. false, ElementKind.constructorKind => _matchesConstructor(node), ElementKind.enumKind => - // TODO(brianwilkerson) Handle this case. + // TODO(brianwilkerson): Handle this case. false, ElementKind.extensionKind => - // TODO(brianwilkerson) Handle this case. + // TODO(brianwilkerson): Handle this case. false, ElementKind.fieldKind => - // TODO(brianwilkerson) Handle this case. + // TODO(brianwilkerson): Handle this case. false, ElementKind.functionKind => _matchesFunction(node), ElementKind.getterKind => - // TODO(brianwilkerson) Handle this case. + // TODO(brianwilkerson): Handle this case. false, ElementKind.methodKind => _matchesMethod(node), ElementKind.mixinKind => - // TODO(brianwilkerson) Handle this case. + // TODO(brianwilkerson): Handle this case. false, ElementKind.setterKind => - // TODO(brianwilkerson) Handle this case. + // TODO(brianwilkerson): Handle this case. false, ElementKind.typedefKind => - // TODO(brianwilkerson) Handle this case. + // TODO(brianwilkerson): Handle this case. false, ElementKind.variableKind => - // TODO(brianwilkerson) Handle this case. + // TODO(brianwilkerson): Handle this case. false }; } @@ -133,14 +133,14 @@ class ElementDescriptor { if (components[0] == node.methodName.name) { var target = node.realTarget; if (target == null) { - // TODO(brianwilkerson) If `node.target == null` then the invocation + // TODO(brianwilkerson): If `node.target == null` then the invocation // should be in a subclass of the element's class. return true; } else { var type = target.staticType; if (type == null && target is SimpleIdentifier) { var element = target.staticElement; - // TODO(brianwilkerson) Handle more than `InterfaceElement`. + // TODO(brianwilkerson): Handle more than `InterfaceElement`. if (element is InterfaceElement) { type = element.thisType; } diff --git a/pkg/analysis_server/lib/src/services/correction/fix/data_driven/element_matcher.dart b/pkg/analysis_server/lib/src/services/correction/fix/data_driven/element_matcher.dart index a40fa7937ff..69e62b2a4de 100644 --- a/pkg/analysis_server/lib/src/services/correction/fix/data_driven/element_matcher.dart +++ b/pkg/analysis_server/lib/src/services/correction/fix/data_driven/element_matcher.dart @@ -101,7 +101,7 @@ class ElementMatcher { } else { // The node has more components than the element, which can happen when a // constructor is implicitly renamed because the class was renamed. - // TODO(brianwilkerson) Figure out whether we want to support this or + // TODO(brianwilkerson): Figure out whether we want to support this or // whether we want to require fix data authors to explicitly include the // change to the constructor. On the one hand it's more work for the // author, on the other hand it give us more data so we're less likely to @@ -158,7 +158,7 @@ class ElementMatcher { return null; } for (var importElement in library.libraryImports) { - // TODO(brianwilkerson) Filter based on combinators to help avoid making + // TODO(brianwilkerson): Filter based on combinators to help avoid making // invalid suggestions. var uri = importElement.importedLibrary?.source.uri; if (uri != null) { @@ -232,7 +232,7 @@ class _MatcherBuilder { kinds: [ElementKind.constructorKind], ); // } else if (parent is ExtensionOverride) { - // // TODO(brianwilkerson) Determine whether this branch can be reached. + // // `TODO`(brianwilkerson) Determine whether this branch can be reached. // _buildFromExtensionOverride(parent); } else if (parent is FunctionExpressionInvocation) { _buildFromFunctionExpressionInvocation(parent); @@ -264,15 +264,15 @@ class _MatcherBuilder { /// Build a matcher for the operator being invoked. void _buildFromBinaryExpression(BinaryExpression node) { - // TODO(brianwilkerson) Implement this method in order to support changes to + // TODO(brianwilkerson): Implement this method in order to support changes to // operators. } /// Build a matcher for the constructor being referenced. void _buildFromConstructorName(ConstructorName node) { - // TODO(brianwilkerson) Use the static element, if there is one, in order to + // TODO(brianwilkerson): Use the static element, if there is one, in order to // get a more exact matcher. - // TODO(brianwilkerson) Use 'new' for the name of the unnamed constructor. + // TODO(brianwilkerson): Use 'new' for the name of the unnamed constructor. var constructorName = node.name?.name ?? ''; // ?? 'new'; var className = node.type.name2.lexeme; _addMatcher( @@ -296,7 +296,7 @@ class _MatcherBuilder { /// Build a matcher for the function being invoked. void _buildFromFunctionExpressionInvocation( FunctionExpressionInvocation node) { - // TODO(brianwilkerson) This case was missed in the original implementation + // TODO(brianwilkerson): This case was missed in the original implementation // and there are no tests for it at this point, but it ought to be supported. } @@ -315,7 +315,7 @@ class _MatcherBuilder { /// Build a matcher for the method being invoked. void _buildFromMethodInvocation(MethodInvocation node) { - // TODO(brianwilkerson) Use the static element, if there is one, in order to + // TODO(brianwilkerson): Use the static element, if there is one, in order to // get a more exact matcher. // var element = node.methodName.staticElement; // if (element != null) { @@ -372,7 +372,7 @@ class _MatcherBuilder { if (parent is ConstructorName) { return _buildFromConstructorName(parent); } - // TODO(brianwilkerson) Use the static element, if there is one, in order to + // TODO(brianwilkerson): Use the static element, if there is one, in order to // get a more exact matcher. _addMatcher( components: [node.name2.lexeme], @@ -383,7 +383,7 @@ class _MatcherBuilder { ElementKind.typedefKind ], ); - // TODO(brianwilkerson) Determine whether we can ever get here as a result + // TODO(brianwilkerson): Determine whether we can ever get here as a result // of having a removed unnamed constructor. // _addMatcher( // components: ['', node.name.name], @@ -397,7 +397,7 @@ class _MatcherBuilder { if (parent is NamedType) { return _buildFromNamedType(parent); } - // TODO(brianwilkerson) Use the static element, if there is one, in order to + // TODO(brianwilkerson): Use the static element, if there is one, in order to // get a more exact matcher. var prefix = node.prefix; if (prefix.staticElement is PrefixElement) { @@ -474,7 +474,7 @@ class _MatcherBuilder { /// Build a matcher for the property being accessed. void _buildFromPropertyAccess(PropertyAccess node) { - // TODO(brianwilkerson) Use the static element, if there is one, in order to + // TODO(brianwilkerson): Use the static element, if there is one, in order to // get a more exact matcher. var propertyName = node.propertyName; var targetName = _nameOfTarget(node.realTarget); @@ -499,7 +499,7 @@ class _MatcherBuilder { /// Build a matcher for the element referenced by the identifier. void _buildFromSimpleIdentifier(SimpleIdentifier node, Token nameToken) { - // TODO(brianwilkerson) Use the static element, if there is one, in order to + // TODO(brianwilkerson): Use the static element, if there is one, in order to // get a more exact matcher. var parent = node.parent; if (parent is Label && parent.parent is NamedExpression) { @@ -522,7 +522,7 @@ class _MatcherBuilder { !_isPrefix(parent.target)) { _buildFromPropertyAccess(parent); } else { - // TODO(brianwilkerson) See whether the list of kinds can be specified. + // TODO(brianwilkerson): See whether the list of kinds can be specified. // If we cannot resolve the element. add the parent/target information, // where it should have been declared. if (node.staticType is InvalidType) { diff --git a/pkg/analysis_server/lib/src/services/correction/fix/data_driven/replaced_by.dart b/pkg/analysis_server/lib/src/services/correction/fix/data_driven/replaced_by.dart index 7a33983b579..03320725ad2 100644 --- a/pkg/analysis_server/lib/src/services/correction/fix/data_driven/replaced_by.dart +++ b/pkg/analysis_server/lib/src/services/correction/fix/data_driven/replaced_by.dart @@ -143,7 +143,7 @@ class ReplacedBy extends Change<_Data> { var grandparent = parent.parent; if (grandparent is ConstructorName && grandparent.name?.name == components[0]) { - // TODO(brianwilkerson) This doesn't correctly handle constructor + // TODO(brianwilkerson): This doesn't correctly handle constructor // invocations with type arguments. We really need to replace the // class and constructor names separately. return _Data(range.node(grandparent)); diff --git a/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_override_set_parser.dart b/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_override_set_parser.dart index 1b30db3f6a8..63a3fbf4858 100644 --- a/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_override_set_parser.dart +++ b/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_override_set_parser.dart @@ -15,7 +15,7 @@ import 'package:yaml/yaml.dart'; /// A parser used to parse the content of a configuration file. class TransformOverrideSetParser { - // TODO(brianwilkerson) Create a class or mixin that would allow this class + // TODO(brianwilkerson): Create a class or mixin that would allow this class // and `TransformSetParser` to share code. static const String _bulkApplyKey = 'bulkApply'; @@ -208,7 +208,7 @@ class TransformOverrideSetParser { } return TransformOverrideSet(overrides); } else { - // TODO(brianwilkerson) Consider having a different error code for the + // TODO(brianwilkerson): Consider having a different error code for the // top-level node (instead of using 'file' as the "key"). _reportError(TransformSetErrorCode.invalidValue, node, ['file', 'Map', _nodeType(node)]); diff --git a/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_parser.dart b/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_parser.dart index c293b455d59..d910bcbe730 100644 --- a/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_parser.dart +++ b/pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_parser.dart @@ -183,7 +183,7 @@ class TransformSetParser { var variableStart = template.indexOf(_openComponent); while (variableStart >= 0) { if (textStart < variableStart) { - // TODO(brianwilkerson) Check for an end brace without a start brace. + // TODO(brianwilkerson): Check for an end brace without a start brace. components .add(TemplateText(template.substring(textStart, variableStart))); } @@ -214,10 +214,10 @@ class TransformSetParser { variableStart = template.indexOf(_openComponent, textStart); } if (textStart < template.length) { - // TODO(brianwilkerson) Check for an end brace without a start brace. + // TODO(brianwilkerson): Check for an end brace without a start brace. components.add(TemplateText(template.substring(textStart))); } - // TODO(brianwilkerson) If there are no other errors, then report + // TODO(brianwilkerson): If there are no other errors, then report // unreferenced variables. return components; } @@ -406,14 +406,14 @@ class TransformSetParser { var argumentValue = _translateCodeTemplate(argumentValueNode, ErrorContext(key: _argumentValueKey, parentNode: node), canBeConditionallyRequired: true); - // TODO(brianwilkerson) We really ought to require an argument value for + // TODO(brianwilkerson): We really ought to require an argument value for // optional positional parameters too for the case where the added // parameter is being added before the end of the list and call sites might // already be providing a value for subsequent parameters. Unfortunately we // can't know at this point whether there are subsequent parameters in // order to require it only when it's potentially necessary. if (isRequired && argumentValue == null) { - // TODO(brianwilkerson) Report that required parameters must have an + // TODO(brianwilkerson): Report that required parameters must have an // argument value. return; } else if (argumentValue != null && @@ -1183,7 +1183,7 @@ class TransformSetParser { _reportError(TransformSetErrorCode.unsupportedVersion, versionNode); return null; } - // TODO(brianwilkerson) Version information is currently being ignored, + // TODO(brianwilkerson): Version information is currently being ignored, // but needs to be used to select a translator. var transforms = _translateList( node.valueAt(_transformsKey), @@ -1204,7 +1204,7 @@ class TransformSetParser { // any diagnostics. return null; } else { - // TODO(brianwilkerson) Consider having a different error code for the + // TODO(brianwilkerson): Consider having a different error code for the // top-level node (instead of using 'file' as the "key"). _reportError(TransformSetErrorCode.invalidValue, node, ['file', 'Map', _nodeType(node)]); @@ -1302,7 +1302,7 @@ class TransformSetParser { ElementKind.variableKind, }); // Static setters and setter-inducing elements can replace each other. - // TODO(brianwilkerson) We can't currently distinguish between final and + // TODO(brianwilkerson): We can't currently distinguish between final and // non-final elements, but we don't support replacing setters with final // elements, nor vice versa. We need a way to distinguish these cases if we // want to be able to report an error. diff --git a/pkg/analysis_server/lib/src/services/correction/fix/data_driven/value_generator.dart b/pkg/analysis_server/lib/src/services/correction/fix/data_driven/value_generator.dart index ec53b798066..18d14330e49 100644 --- a/pkg/analysis_server/lib/src/services/correction/fix/data_driven/value_generator.dart +++ b/pkg/analysis_server/lib/src/services/correction/fix/data_driven/value_generator.dart @@ -31,7 +31,7 @@ class CodeFragment extends ValueGenerator { if (target is AstNode) { return context.utils.getRangeText(range.node(target)); } else if (target is DartType) { - // TODO(brianwilkerson) If we end up needing it, figure out how to convert + // TODO(brianwilkerson): If we end up needing it, figure out how to convert // a type into valid code. throw UnsupportedError('Unexpected result of ${target.runtimeType}'); } else { @@ -89,7 +89,7 @@ class ImportedName extends ValueGenerator { @override bool validate(TemplateContext context) { - // TODO(brianwilkerson) Validate that the import can be added. + // TODO(brianwilkerson): Validate that the import can be added. return true; } diff --git a/pkg/analysis_server/lib/src/services/correction/fix/pubspec/fix_generator.dart b/pkg/analysis_server/lib/src/services/correction/fix/pubspec/fix_generator.dart index f069e31f7a8..f40b14cc148 100644 --- a/pkg/analysis_server/lib/src/services/correction/fix/pubspec/fix_generator.dart +++ b/pkg/analysis_server/lib/src/services/correction/fix/pubspec/fix_generator.dart @@ -56,7 +56,7 @@ class PubspecFixGenerator { /// Returns the end-of-line marker to use for the `pubspec.yaml` file. String get endOfLine { - // TODO(brianwilkerson) Share this with CorrectionUtils, probably by + // TODO(brianwilkerson): Share this with CorrectionUtils, probably by // creating a subclass of CorrectionUtils containing utilities that are // only dependent on knowing the content of the file. Also consider moving // this kind of utility into the ChangeBuilder API directly. @@ -239,7 +239,7 @@ class PubspecFixGenerator { return; } await builder.addGenericFileEdit(file, (builder) { - // TODO(brianwilkerson) Generalize this to add a key to any map by + // TODO(brianwilkerson): Generalize this to add a key to any map by // inserting the indentation of the line containing `firstOffset` after // the end-of-line marker. builder.addSimpleInsertion(firstOffset, 'name: $packageName$endOfLine'); diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart index 6e02fe6a41f..f294e58e44c 100644 --- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart +++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart @@ -374,7 +374,7 @@ class FixInFileProcessor { return fixState; } - // todo (pq): consider discarding the change if the producer's fixKind + // TODO(pq): consider discarding the change if the producer's fixKind // doesn't match a previously cached one. return _NotEmptyFixState( builder: localBuilder, @@ -392,7 +392,7 @@ class FixInFileProcessor { if (errorCode is LintCode) { return FixProcessor.lintProducerMap[errorCode.uniqueLintName] ?? []; } else { - // todo (pq): consider support for multiGenerators + // TODO(pq): consider support for multiGenerators return FixProcessor.nonLintProducerMap[errorCode] ?? []; } } @@ -492,7 +492,7 @@ class FixProcessor extends BaseProcessor { RemoveTypeAnnotation.other, ], LintNames.avoid_returning_null_for_future: [ - // TODO(brianwilkerson) Consider applying in bulk. + // TODO(brianwilkerson): Consider applying in bulk. AddAsync.new, WrapInFuture.new, ], @@ -500,7 +500,7 @@ class FixProcessor extends BaseProcessor { RemoveReturnedValue.new, ], LintNames.avoid_single_cascade_in_expression_statements: [ - // TODO(brianwilkerson) This fix should be applied to some non-lint + // TODO(brianwilkerson): This fix should be applied to some non-lint // diagnostics and should also be available as an assist. ReplaceCascadeWithDot.new, ], @@ -986,7 +986,7 @@ class FixProcessor extends BaseProcessor { ], CompileTimeErrorCode.UNDEFINED_SETTER: [ DataDriven.new, - // TODO(brianwilkerson) Support ImportLibrary for non-extension members. + // TODO(brianwilkerson): Support ImportLibrary for non-extension members. ImportLibrary.forExtensionMember, ], CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS: [ @@ -1426,14 +1426,14 @@ class FixProcessor extends BaseProcessor { CreateSetter.new, ], CompileTimeErrorCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER: [ - // TODO(brianwilkerson) Consider adding fixes to create a field, getter, + // TODO(brianwilkerson): Consider adding fixes to create a field, getter, // method or setter. The existing _addFix methods would need to be // updated so that only the appropriate subset is generated. QualifyReference.new, ], CompileTimeErrorCode .UNQUALIFIED_REFERENCE_TO_STATIC_MEMBER_OF_EXTENDED_TYPE: [ - // TODO(brianwilkerson) Consider adding fixes to create a field, getter, + // TODO(brianwilkerson): Consider adding fixes to create a field, getter, // method or setter. The existing producers would need to be updated so // that only the appropriate subset is generated. QualifyReference.new, @@ -1559,12 +1559,12 @@ class FixProcessor extends BaseProcessor { RemoveDeadCode.new, ], WarningCode.DEAD_CODE_CATCH_FOLLOWING_CATCH: [ - // TODO(brianwilkerson) Add a fix to move the unreachable catch clause to + // TODO(brianwilkerson): Add a fix to move the unreachable catch clause to // a place where it can be reached (when possible). RemoveDeadCode.new, ], WarningCode.DEAD_CODE_ON_CATCH_SUBTYPE: [ - // TODO(brianwilkerson) Add a fix to move the unreachable catch clause to + // TODO(brianwilkerson): Add a fix to move the unreachable catch clause to // a place where it can be reached (when possible). RemoveDeadCode.new, ], diff --git a/pkg/analysis_server/lib/src/services/correction/util.dart b/pkg/analysis_server/lib/src/services/correction/util.dart index 28c4e3cb5dd..a827db0d7fd 100644 --- a/pkg/analysis_server/lib/src/services/correction/util.dart +++ b/pkg/analysis_server/lib/src/services/correction/util.dart @@ -178,7 +178,7 @@ List findPrefixElementReferences( return collector.references; } -/// TODO(scheglov) replace with nodes once there will be +// TODO(scheglov): replace with nodes once there will be /// [CompilationUnit.getComments]. /// /// Returns [SourceRange]s of all comments in [unit]. @@ -1778,7 +1778,7 @@ class _InvertedCondition { static _InvertedCondition _binary2( _InvertedCondition left, String operation, _InvertedCondition right) { - // TODO(scheglov) consider merging with "_binary()" after testing + // TODO(scheglov): consider merging with "_binary()" after testing return _InvertedCondition( 1 << 20, '${left._source}$operation${right._source}'); } diff --git a/pkg/analysis_server/lib/src/services/flutter/property.dart b/pkg/analysis_server/lib/src/services/flutter/property.dart index 65fc5a6b480..4635b7d8203 100644 --- a/pkg/analysis_server/lib/src/services/flutter/property.dart +++ b/pkg/analysis_server/lib/src/services/flutter/property.dart @@ -246,7 +246,7 @@ class PropertyDescription { } parent._changeCode(builder, (builder) { builder.writeReference(classDescription.element); - // TODO(scheglov) constructor name + // TODO(scheglov): constructor name builder.write('('); builder.write(parameterName); builder.write(': '); @@ -353,13 +353,13 @@ class PropertyDescription { builder.format(range.node(functionBody)); } - /// TODO(scheglov) Generalize to identifying by type. + // TODO(scheglov): Generalize to identifying by type. bool _isChildArgument(NamedExpression argument) { var argumentName = argument.name.label.name; return argumentName == 'child'; } - /// TODO(scheglov) Generalize to identifying by type. + // TODO(scheglov): Generalize to identifying by type. bool _isChildrenArgument(NamedExpression argument) { var argumentName = argument.name.label.name; return argumentName == 'children'; diff --git a/pkg/analysis_server/lib/src/services/kythe/kythe_visitors.dart b/pkg/analysis_server/lib/src/services/kythe/kythe_visitors.dart index 0dc64cb5528..ff4c6b1d4d5 100644 --- a/pkg/analysis_server/lib/src/services/kythe/kythe_visitors.dart +++ b/pkg/analysis_server/lib/src/services/kythe/kythe_visitors.dart @@ -41,9 +41,9 @@ String? _getNodeKind(Element e) { String _getPath(ResourceProvider provider, Element? e, {String? sdkRootPath, String? corpus}) { - // TODO(jwren) This method simply serves to provide the WORKSPACE relative + // TODO(jwren): This method simply serves to provide the WORKSPACE relative // path for sources in Elements, it needs to be written in a more robust way. - // TODO(jwren) figure out what source generates a e != null, but + // TODO(jwren): figure out what source generates a e != null, but // e.source == null to ensure that it is not a bug somewhere in the stack. var source = e?.source; if (source == null) { diff --git a/pkg/analysis_server/lib/src/services/refactoring/agnostic/change_method_signature.dart b/pkg/analysis_server/lib/src/services/refactoring/agnostic/change_method_signature.dart index 50474cf38a1..4788d959c21 100644 --- a/pkg/analysis_server/lib/src/services/refactoring/agnostic/change_method_signature.dart +++ b/pkg/analysis_server/lib/src/services/refactoring/agnostic/change_method_signature.dart @@ -89,7 +89,7 @@ final class ChangeStatusFailure extends ChangeStatus {} /// The signal that the [ConstructorDeclaration] with a super formal parameter /// was found. This is not supported by the refactoring. /// -/// TODO(scheglov) Make [ChangeStatusFailure] sealed. +// TODO(scheglov): Make [ChangeStatusFailure] sealed. final class ChangeStatusFailureSuperFormalParameter extends ChangeStatusFailure { final ConstructorDeclaration constructorDeclaration; @@ -156,7 +156,7 @@ class FormalParameterUpdate { /// The new kind for the formal parameter, might be the same as it were /// initially, or different. /// - /// TODO(scheglov) We might need `defaultValueText` added. + // TODO(scheglov): We might need `defaultValueText` added. final FormalParameterKind kind; FormalParameterUpdate({ @@ -173,7 +173,7 @@ class MethodSignatureUpdate { /// class hierarchy, will be updated. The new formal parameters will be /// written in the order [formalParameters] field, with new kinds. /// - /// TODO(scheglov) Consider adding. + // TODO(scheglov): Consider adding. final List formalParameters; /// Normally, after writing formal parameters in the order specified by @@ -702,7 +702,7 @@ class _SignatureUpdater { }) async { final frameworkStatus = await framework.writeArguments( formalParameterUpdates: signatureUpdate.formalParameters.map((update) { - // TODO(scheglov) Maybe support adding formal parameters. + // TODO(scheglov): Maybe support adding formal parameters. final existing = selectionState.formalParameters[update.id]; final reference = _asFrameworkFormalParameterReference(existing); switch (update.kind) { diff --git a/pkg/analysis_server/lib/src/services/refactoring/framework/write_invocation_arguments.dart b/pkg/analysis_server/lib/src/services/refactoring/framework/write_invocation_arguments.dart index 4ee438fee01..ec44fbbbf0d 100644 --- a/pkg/analysis_server/lib/src/services/refactoring/framework/write_invocation_arguments.dart +++ b/pkg/analysis_server/lib/src/services/refactoring/framework/write_invocation_arguments.dart @@ -38,7 +38,7 @@ Future writeArguments({ continue; } if (update is FormalParameterUpdateExistingNamed) { - // TODO(scheglov) maybe support renames + // TODO(scheglov): maybe support renames newArguments.add( _ArgumentAsIs( argument: argument, diff --git a/pkg/analysis_server/lib/src/services/refactoring/legacy/extract_widget.dart b/pkg/analysis_server/lib/src/services/refactoring/legacy/extract_widget.dart index 5bf5358b85f..0dab251e5d8 100644 --- a/pkg/analysis_server/lib/src/services/refactoring/legacy/extract_widget.dart +++ b/pkg/analysis_server/lib/src/services/refactoring/legacy/extract_widget.dart @@ -654,7 +654,7 @@ class _ParametersCollector extends RecursiveAstVisitor { } } } - // TODO(scheglov) support for ParameterElement + // TODO(scheglov): support for ParameterElement if (type != null && uniqueElements.add(element)) { parameters.add(_Parameter(elementName, type)); diff --git a/pkg/analysis_server/lib/src/services/refactoring/legacy/refactoring.dart b/pkg/analysis_server/lib/src/services/refactoring/legacy/refactoring.dart index 1dcf9a549a2..c88de5e8b56 100644 --- a/pkg/analysis_server/lib/src/services/refactoring/legacy/refactoring.dart +++ b/pkg/analysis_server/lib/src/services/refactoring/legacy/refactoring.dart @@ -461,7 +461,7 @@ abstract class RenameRefactoring implements Refactoring { /// the class when on the `new` keyword). static RenameRefactoringElement? getElementToRename( AstNode node, Element? element) { - // TODO(scheglov) This is bad code. + // TODO(scheglov): This is bad code. SyntacticEntity? nameNode; if (node is AssignedVariablePattern) { nameNode = node.name; diff --git a/pkg/analysis_server/lib/src/services/refactoring/legacy/refactoring_internal.dart b/pkg/analysis_server/lib/src/services/refactoring/legacy/refactoring_internal.dart index 1a2c43ddeea..c65580ab0a8 100644 --- a/pkg/analysis_server/lib/src/services/refactoring/legacy/refactoring_internal.dart +++ b/pkg/analysis_server/lib/src/services/refactoring/legacy/refactoring_internal.dart @@ -61,7 +61,7 @@ abstract class RefactoringImpl implements Refactoring { /// The [SourceRange] in some [Source]. /// -/// TODO(scheglov) inline this class as SearchMatch +// TODO(scheglov): inline this class as SearchMatch class SourceReference { final SearchMatch _match; diff --git a/pkg/analysis_server/lib/src/services/user_prompts/dart_fix_prompt_manager.dart b/pkg/analysis_server/lib/src/services/user_prompts/dart_fix_prompt_manager.dart index 709557a1a55..a530ab4e2d1 100644 --- a/pkg/analysis_server/lib/src/services/user_prompts/dart_fix_prompt_manager.dart +++ b/pkg/analysis_server/lib/src/services/user_prompts/dart_fix_prompt_manager.dart @@ -70,7 +70,7 @@ class DartFixPromptManager { Map get currentContextSdkConstraints { return { for (final context in server.contextManager.analysisContexts) - // TODO(pq) getAllOptions.first + // TODO(pq): getAllOptions.first context.contextRoot.root.path: context.analysisOptions.sdkVersionConstraint?.toString(), }; diff --git a/pkg/analysis_server/lib/src/status/diagnostics.dart b/pkg/analysis_server/lib/src/status/diagnostics.dart index 57afa1eaed0..633080b105f 100644 --- a/pkg/analysis_server/lib/src/status/diagnostics.dart +++ b/pkg/analysis_server/lib/src/status/diagnostics.dart @@ -1454,7 +1454,7 @@ class PluginsPage extends DiagnosticPageWithNav { for (var entry in entries) { var requestName = entry.key; var data = entry.value; - // TODO(brianwilkerson) Consider displaying these times as a graph, + // TODO(brianwilkerson): Consider displaying these times as a graph, // similar to the one in CompletionPage.generateContent. var buffer = StringBuffer(); buffer.write(requestName); diff --git a/pkg/analysis_server/lib/src/status/pages.dart b/pkg/analysis_server/lib/src/status/pages.dart index 0b991b469d7..46acf767e8a 100644 --- a/pkg/analysis_server/lib/src/status/pages.dart +++ b/pkg/analysis_server/lib/src/status/pages.dart @@ -33,7 +33,7 @@ abstract class Page { } else { buf.writeln('
'); } - // TODO(brianwilkerson) Determine if await is necessary, if so, change the + // TODO(brianwilkerson): Determine if await is necessary, if so, change the // return type of [gen] to `Future`. await (gen() as dynamic); buf.writeln('
'); @@ -59,7 +59,7 @@ abstract class Page { Future generate(Map params) async { buf.clear(); - // TODO(brianwilkerson) Determine if await is necessary, if so, change the + // TODO(brianwilkerson): Determine if await is necessary, if so, change the // return type of [generatePage] to `Future`. await (generatePage(params) as dynamic); return buf.toString(); diff --git a/pkg/analysis_server/lib/src/utilities/extensions/completion_request.dart b/pkg/analysis_server/lib/src/utilities/extensions/completion_request.dart index 81ca3492a4f..6e504f84dbc 100644 --- a/pkg/analysis_server/lib/src/utilities/extensions/completion_request.dart +++ b/pkg/analysis_server/lib/src/utilities/extensions/completion_request.dart @@ -13,7 +13,7 @@ extension DartCompletionRequestExtensions on DartCompletionRequest { /// context type is a function type that matches an instantiation of the /// [element]. /// - /// TODO(scheglov) Validate that suggesting a tear-off instead of invocation + // TODO(scheglov): Validate that suggesting a tear-off instead of invocation /// is statistically a good choice. bool shouldSuggestTearOff(InterfaceElement element) { if (!libraryElement.featureSet.isEnabled(Feature.constructor_tearoffs)) { diff --git a/pkg/analysis_server/lib/src/utilities/extensions/range_factory.dart b/pkg/analysis_server/lib/src/utilities/extensions/range_factory.dart index fbf3d6cd676..657f4cb89cc 100644 --- a/pkg/analysis_server/lib/src/utilities/extensions/range_factory.dart +++ b/pkg/analysis_server/lib/src/utilities/extensions/range_factory.dart @@ -32,14 +32,14 @@ extension RangeFactoryExtensions on RangeFactory { /// See [nodeWithComments]. SourceRange nodeInListWithComments( LineInfo lineInfo, NodeList list, T node) { - // TODO(brianwilkerson) Improve the name and signature of this method and + // TODO(brianwilkerson): Improve the name and signature of this method and // make it part of the API of either `RangeFactory` or // `DartFileEditBuilder`. The implementation currently assumes that the // list is an argument list, and we might want to generalize that. - // TODO(brianwilkerson) Consider adding parameters to allow us to access the + // TODO(brianwilkerson): Consider adding parameters to allow us to access the // left and right parentheses in cases where the only element of the list // is being removed. - // TODO(brianwilkerson) Consider adding a `separator` parameter so that we + // TODO(brianwilkerson): Consider adding a `separator` parameter so that we // can handle things like statements in a block. if (list.length == 1) { if (list[0] != node) { diff --git a/pkg/analysis_server/lib/src/utilities/extensions/yaml.dart b/pkg/analysis_server/lib/src/utilities/extensions/yaml.dart index b3c0c2e0b79..78037db75d2 100644 --- a/pkg/analysis_server/lib/src/utilities/extensions/yaml.dart +++ b/pkg/analysis_server/lib/src/utilities/extensions/yaml.dart @@ -17,7 +17,7 @@ extension YamlNodeExtensions on YamlNode { } for (var element in node.nodes) { if (element is YamlScalar && element.value == null) { - // TODO(brianwilkerson) Testing for a null value probably gets + // TODO(brianwilkerson): Testing for a null value probably gets // confused when there are multiple null values. return element; } @@ -49,7 +49,7 @@ extension YamlNodeExtensions on YamlNode { /// Return `true` if this node contains the given [offset]. bool containsOffset(int offset) { - // TODO(brianwilkerson) Nodes at the end of the file contain any trailing + // TODO(brianwilkerson): Nodes at the end of the file contain any trailing // whitespace. This needs to be accounted for, here or elsewhere. var nodeOffset = span.start.offset; var nodeEnd = nodeOffset + span.length; diff --git a/pkg/analysis_server/lib/src/utilities/mocks.dart b/pkg/analysis_server/lib/src/utilities/mocks.dart index 94d2cd0ad81..990b518a9ca 100644 --- a/pkg/analysis_server/lib/src/utilities/mocks.dart +++ b/pkg/analysis_server/lib/src/utilities/mocks.dart @@ -70,7 +70,7 @@ class MockServerChannel implements ServerCommunicationChannel { StackTrace.fromString(params['stackTrace'] as String)); } // Wrap send notification in future to simulate websocket - // TODO(scheglov) ask Dan why and decide what to do + // TODO(scheglov): ask Dan why and decide what to do // new Future(() => notificationController.add(notification)); notificationController.add(notification); } diff --git a/pkg/analysis_server/lib/src/utilities/selection.dart b/pkg/analysis_server/lib/src/utilities/selection.dart index e0c75bcd16a..e5b21c1f6d2 100644 --- a/pkg/analysis_server/lib/src/utilities/selection.dart +++ b/pkg/analysis_server/lib/src/utilities/selection.dart @@ -98,7 +98,7 @@ class _ChildrenFinder extends SimpleAstVisitor { @override void visitCompilationUnit(CompilationUnit node) { - // TODO(brianwilkerson) Support selecting both directives and declarations. + // TODO(brianwilkerson): Support selecting both directives and declarations. _fromList(node.directives) || _fromList(node.declarations); } diff --git a/pkg/analysis_server/test/abstract_context.dart b/pkg/analysis_server/test/abstract_context.dart index ff51a37822e..d9049f3255a 100644 --- a/pkg/analysis_server/test/abstract_context.dart +++ b/pkg/analysis_server/test/abstract_context.dart @@ -37,7 +37,7 @@ class AbstractContextTest with ResourceProviderMixin { /// to this file, instead of the given file. File? fileForContextSelection; - /// TODO(scheglov) Stop writing into it. Convert into getter. + // TODO(scheglov): Stop writing into it. Convert into getter. late String testFilePath = '$testPackageLibPath/test.dart'; List get allDrivers { diff --git a/pkg/analysis_server/test/analysis/get_navigation_test.dart b/pkg/analysis_server/test/analysis/get_navigation_test.dart index 007eabff6ae..13a9238f77c 100644 --- a/pkg/analysis_server/test/analysis/get_navigation_test.dart +++ b/pkg/analysis_server/test/analysis/get_navigation_test.dart @@ -166,7 +166,7 @@ class Bar { expect(result['regions'], isEmpty); } - /// TODO(scheglov) Rewrite these tests to work with any file. + // TODO(scheglov): Rewrite these tests to work with any file. @FailingTest(reason: 'requires infrastructure rewriting') Future test_fileOutsideOfRoot() async { var file = newFile('/outside.dart', ''' diff --git a/pkg/analysis_server/test/analysis/notification_analysis_options_test.dart b/pkg/analysis_server/test/analysis/notification_analysis_options_test.dart index 214a96ea1a3..594c608b40d 100644 --- a/pkg/analysis_server/test/analysis/notification_analysis_options_test.dart +++ b/pkg/analysis_server/test/analysis/notification_analysis_options_test.dart @@ -69,7 +69,7 @@ void f() { await waitForTasksFinished(); // Verify options file. - // TODO(brianwilkerson) Implement options file analysis in the new driver. + // TODO(brianwilkerson): Implement options file analysis in the new driver. // expect(optionsFileErrors, isNotNull); // expect(optionsFileErrors, isEmpty); @@ -94,7 +94,7 @@ void f() { await waitForTasksFinished(); // Verify options file. - // TODO(brianwilkerson) Implement options file analysis in the new driver. + // TODO(brianwilkerson): Implement options file analysis in the new driver. // expect(optionsFileErrors, isNotNull); // expect(optionsFileErrors, isEmpty); @@ -112,7 +112,7 @@ analyzer: await waitForTasksFinished(); // Verify options file. - // TODO(brianwilkerson) Implement options file analysis in the new driver. + // TODO(brianwilkerson): Implement options file analysis in the new driver. // expect(optionsFileErrors, isEmpty); // Verify test file. @@ -156,7 +156,7 @@ linter: await waitForTasksFinished(); - // TODO(brianwilkerson) Implement options file analysis in the new driver. + // TODO(brianwilkerson): Implement options file analysis in the new driver. // expect(optionsFileErrors, hasLength(1)); // expect(optionsFileErrors.first.severity, AnalysisErrorSeverity.WARNING); // expect(optionsFileErrors.first.type, AnalysisErrorType.STATIC_WARNING); @@ -190,7 +190,7 @@ linter: await waitForTasksFinished(); - // TODO(brianwilkerson) Implement options file analysis in the new driver. + // TODO(brianwilkerson): Implement options file analysis in the new driver. // expect(optionsFileErrors, hasLength(1)); // expect(optionsFileErrors.first.severity, AnalysisErrorSeverity.ERROR); // expect(optionsFileErrors.first.type, AnalysisErrorType.COMPILE_TIME_ERROR); diff --git a/pkg/analysis_server/test/analysis/notification_highlights2_test.dart b/pkg/analysis_server/test/analysis/notification_highlights2_test.dart index 55fb559a52f..93de9c54ee5 100644 --- a/pkg/analysis_server/test/analysis/notification_highlights2_test.dart +++ b/pkg/analysis_server/test/analysis/notification_highlights2_test.dart @@ -2215,7 +2215,7 @@ void f(Object o) { ? SourceRange(0, testCode.code.length) : testCode.ranges[index].sourceRange; - // TODO(scheglov) Apparently, we don't sort in the server. + // TODO(scheglov): Apparently, we don't sort in the server. var sortedRegions = regions.sortedBy((e) => e.offset); var buffer = StringBuffer(); diff --git a/pkg/analysis_server/test/analysis/notification_navigation_test.dart b/pkg/analysis_server/test/analysis/notification_navigation_test.dart index 7e18c116073..b835f207e02 100644 --- a/pkg/analysis_server/test/analysis/notification_navigation_test.dart +++ b/pkg/analysis_server/test/analysis/notification_navigation_test.dart @@ -93,7 +93,7 @@ class AbstractNavigationTest extends PubPackageAnalysisServerTest { assertHasFileTarget(testFile.path, offset, length); } - /// TODO(scheglov) Improve target matching. + // TODO(scheglov): Improve target matching. void assertHasTargetInDartCore(String search) { var dartCoreFile = getFile('/sdk/lib/core/core.dart'); var dartCoreContent = dartCoreFile.readAsStringSync(); diff --git a/pkg/analysis_server/test/analysis/update_content_test.dart b/pkg/analysis_server/test/analysis/update_content_test.dart index 13d663568f1..6cc0f2eb3e8 100644 --- a/pkg/analysis_server/test/analysis/update_content_test.dart +++ b/pkg/analysis_server/test/analysis/update_content_test.dart @@ -193,7 +193,7 @@ void g() { ); await waitForTasksFinished(); expect(filesErrors[a], isEmpty); - // TODO(scheglov) We should get "flush" notification. + // TODO(scheglov): We should get "flush" notification. // expect(filesErrors[b], isNull); } diff --git a/pkg/analysis_server/test/analysis_server_base.dart b/pkg/analysis_server/test/analysis_server_base.dart index 9b1e490923b..8790fd5d5d8 100644 --- a/pkg/analysis_server/test/analysis_server_base.dart +++ b/pkg/analysis_server/test/analysis_server_base.dart @@ -26,7 +26,7 @@ import 'package:unified_analytics/unified_analytics.dart'; import 'mocks.dart'; import 'src/utilities/mock_packages.dart'; -/// TODO(scheglov) this is duplicate +// TODO(scheglov): this is duplicate class AnalysisOptionsFileConfig { final List experiments; final List lints; @@ -251,7 +251,7 @@ class PubPackageAnalysisServerTest extends ContextResolutionTest { ); } - /// TODO(scheglov) rename + // TODO(scheglov): rename void addTestFile(String content) { newFile(testFilePath, content); } @@ -277,7 +277,7 @@ class PubPackageAnalysisServerTest extends ContextResolutionTest { /// Returns the offset of [search] in [testFileContent]. /// Fails if not found. - /// TODO(scheglov) Rename it. + // TODO(scheglov): Rename it. int findOffset(String search) { return offsetInFile(testFile, search); } diff --git a/pkg/analysis_server/test/client/completion_driver_test.dart b/pkg/analysis_server/test/client/completion_driver_test.dart index 30a588af22a..41faa3f2ea0 100644 --- a/pkg/analysis_server/test/client/completion_driver_test.dart +++ b/pkg/analysis_server/test/client/completion_driver_test.dart @@ -156,7 +156,7 @@ $actual isNotNull); } - /// TODO(scheglov) Use it everywhere instead of [addTestFile]. + // TODO(scheglov): Use it everywhere instead of [addTestFile]. // ignore:unreachable_from_main Future computeSuggestions( String content, @@ -170,7 +170,7 @@ $actual requestOffset: driver.completionOffset, replacementOffset: driver.replacementOffset, replacementLength: driver.replacementLength, - isIncomplete: false, // TODO(scheglov) not correct + isIncomplete: false, // TODO(scheglov): not correct suggestions: suggestions, ); } @@ -204,7 +204,7 @@ name: test ); await driver.createProject(); - // todo (pq): add logic (possibly to driver) that waits for SDK suggestions + // TODO(pq): add logic (possibly to driver) that waits for SDK suggestions printerConfiguration = printer.Configuration( filter: (suggestion) { diff --git a/pkg/analysis_server/test/client/impl/completion_driver.dart b/pkg/analysis_server/test/client/impl/completion_driver.dart index 5f0c12ec83b..05dac8a20e7 100644 --- a/pkg/analysis_server/test/client/impl/completion_driver.dart +++ b/pkg/analysis_server/test/client/impl/completion_driver.dart @@ -36,7 +36,7 @@ CompletionSuggestion _createCompletionSuggestionFromAvailableSuggestion( } } - // todo (pq): in IDEA, this is "UNKNOWN" but here we need a value; figure out what's up. + // TODO(pq): in IDEA, this is "UNKNOWN" but here we need a value; figure out what's up. var suggestionKind = CompletionSuggestionKind.IDENTIFIER; if (suggestion.element.kind == ElementKind.CONSTRUCTOR || suggestion.element.kind == ElementKind.FUNCTION || diff --git a/pkg/analysis_server/test/domain_completion_test.dart b/pkg/analysis_server/test/domain_completion_test.dart index 9ef27da5293..31341b19c26 100644 --- a/pkg/analysis_server/test/domain_completion_test.dart +++ b/pkg/analysis_server/test/domain_completion_test.dart @@ -160,7 +160,7 @@ completion: Test var response = await handleRequest(request); expect(response.error?.code, RequestErrorCode.INVALID_PARAMETER); - // TODO(scheglov) Check that says "libraryUri". + // TODO(scheglov): Check that says "libraryUri". } Future test_invalidPath() async { @@ -2447,7 +2447,7 @@ extension MyClassExtension on MyClass { @failingTest Future test_imports_aborted_source_changed() async { - // TODO(brianwilkerson) Figure out whether this test makes sense when + // TODO(brianwilkerson): Figure out whether this test makes sense when // running the new driver. It waits for an initial empty notification then // waits for a new notification. But I think that under the driver we only // ever send one notification. diff --git a/pkg/analysis_server/test/domain_completion_util.dart b/pkg/analysis_server/test/domain_completion_util.dart index 183b2c62cd4..9d39d35155c 100644 --- a/pkg/analysis_server/test/domain_completion_util.dart +++ b/pkg/analysis_server/test/domain_completion_util.dart @@ -15,7 +15,7 @@ import 'constants.dart'; class AbstractCompletionDomainTest extends PubPackageAnalysisServerTest { late String completionId; - late int completionOffset; // TODO(scheglov) remove it + late int completionOffset; // TODO(scheglov): remove it int? replacementOffset; late int replacementLength; Map> receivedSuggestionsCompleters = {}; diff --git a/pkg/analysis_server/test/domain_execution_test.dart b/pkg/analysis_server/test/domain_execution_test.dart index 2b18ac353cb..15f4a9f18a7 100644 --- a/pkg/analysis_server/test/domain_execution_test.dart +++ b/pkg/analysis_server/test/domain_execution_test.dart @@ -31,7 +31,7 @@ void main() { // handler = ExecutionDomainHandler(server, server.executionContext); // }); // - // // TODO(brianwilkerson) Re-enable these tests if we re-enable the + // // `TODO`(brianwilkerson) Re-enable these tests if we re-enable the // // execution.mapUri request. // group('mapUri', () { // String contextId; @@ -160,7 +160,7 @@ class ExecutionDomainTest extends PubPackageAnalysisServerTest { Future test_deleteNonExistentContext() async { var request = ExecutionDeleteContextParams('13').toRequest('0'); var response = await handleSuccessfulRequest(request); - // TODO(brianwilkerson) It isn't currently specified to be an error if a + // TODO(brianwilkerson): It isn't currently specified to be an error if a // client attempts to delete a context that doesn't exist. Should it be? // expect(response, isResponseFailure('0')); expect(response, isResponseSuccess('0')); @@ -197,7 +197,7 @@ void contextFunction() { // contains( // predicate((s) => s.completion == 'foo'))); - // TODO(brianwilkerson) Restore the expectations above (and delete the line + // TODO(brianwilkerson): Restore the expectations above (and delete the line // below) after the functionality has been re-enabled. expect(result.suggestions, isEmpty); } diff --git a/pkg/analysis_server/test/integration/support/protocol_matchers.dart b/pkg/analysis_server/test/integration/support/protocol_matchers.dart index 023c9f48a07..d5380ec7006 100644 --- a/pkg/analysis_server/test/integration/support/protocol_matchers.dart +++ b/pkg/analysis_server/test/integration/support/protocol_matchers.dart @@ -13,6 +13,8 @@ import 'package:test/test.dart'; import 'integration_tests.dart'; +// ignore_for_file: flutter_style_todos + /// AddContentOverlay /// /// { diff --git a/pkg/analysis_server/test/lsp/diagnostic_test.dart b/pkg/analysis_server/test/lsp/diagnostic_test.dart index f2427f6d00f..16aeb306258 100644 --- a/pkg/analysis_server/test/lsp/diagnostic_test.dart +++ b/pkg/analysis_server/test/lsp/diagnostic_test.dart @@ -116,7 +116,7 @@ include: package:pedantic/analysis_options.yaml expect(initialDiagnostics!.first.severity, DiagnosticSeverity.Warning); expect(initialDiagnostics.first.code, 'include_file_not_found'); - // TODO(scheglov) The server does not handle the file change. + // TODO(scheglov): The server does not handle the file change. throw 'Times out'; // // Write a package file that allows resolving the include. diff --git a/pkg/analysis_server/test/lsp/server_abstract.dart b/pkg/analysis_server/test/lsp/server_abstract.dart index 2e7a6ec887e..726e0fe4891 100644 --- a/pkg/analysis_server/test/lsp/server_abstract.dart +++ b/pkg/analysis_server/test/lsp/server_abstract.dart @@ -1034,7 +1034,7 @@ mixin LspAnalysisServerTestMixin // an error it will still be handled as such when the future is later // awaited. - // TODO: Fix this static error. + // TODO(srawlins): Fix this static error. // ignore: body_might_complete_normally_catch_error outboundRequest.catchError((_) {}); }); diff --git a/pkg/analysis_server/test/plugin/protocol_dart_test.dart b/pkg/analysis_server/test/plugin/protocol_dart_test.dart index 93c3ee08fb7..092e9948352 100644 --- a/pkg/analysis_server/test/plugin/protocol_dart_test.dart +++ b/pkg/analysis_server/test/plugin/protocol_dart_test.dart @@ -254,7 +254,7 @@ enum E2 { three, four }'''); } expect(element.parameters, isNull); expect(element.returnType, '_E1'); - // TODO(danrubel) determine why enum constant is not marked as deprecated + // TODO(danrubel): determine why enum constant is not marked as deprecated //engine.ClassElement classElement = engineElement.enclosingElement3; //expect(classElement.isDeprecated, isTrue); expect( diff --git a/pkg/analysis_server/test/services/completion/dart/completion_test.dart b/pkg/analysis_server/test/services/completion/dart/completion_test.dart index 9a7a3b12523..82db258dd40 100644 --- a/pkg/analysis_server/test/services/completion/dart/completion_test.dart +++ b/pkg/analysis_server/test/services/completion/dart/completion_test.dart @@ -6,7 +6,7 @@ import 'package:test_reflective_loader/test_reflective_loader.dart'; import '../../../client/completion_driver_test.dart'; -// TODO(brianwilkerson) The contents of this file were generated from an older +// TODO(brianwilkerson): The contents of this file were generated from an older // style of tests. They need to be cleaned up (many contain test code that // isn't used in the test), renamed, and moved into the appropriate 'location' // or 'declaration' test class. @@ -5018,7 +5018,7 @@ suggestions kind: class '''); } else { - // TODO(brianwilkerson) 'int' should not be suggested twice + // TODO(brianwilkerson): 'int' should not be suggested twice assertResponse(r''' replacement left: 2 @@ -7020,7 +7020,7 @@ suggestions kind: constructorInvocation '''); } else { - // TODO(brianwilkerson) We should not be suggesting 'JsonDecoder'. + // TODO(brianwilkerson): We should not be suggesting 'JsonDecoder'. assertResponse(r''' replacement right: 2 @@ -7088,7 +7088,7 @@ k() { } '''); if (isProtocolVersion2) { - // TODO(brianwilkerson) We ought to be suggesting 'xdr.a' and 'xdr.b'. + // TODO(brianwilkerson): We ought to be suggesting 'xdr.a' and 'xdr.b'. assertResponse(r''' replacement left: 1 @@ -7133,7 +7133,7 @@ k() { } '''); if (isProtocolVersion2) { - // TODO(brianwilkerson) We ought to be suggesting 'xdr.a' and 'xdr.b'. + // TODO(brianwilkerson): We ought to be suggesting 'xdr.a' and 'xdr.b'. assertResponse(r''' replacement left: 1 @@ -8897,7 +8897,7 @@ suggestions kind: keyword '''); } else { - // TODO(brianwilkerson) Don't suggest 'HashMap'. + // TODO(brianwilkerson): Don't suggest 'HashMap'. assertResponse(r''' replacement right: 3 @@ -9448,7 +9448,7 @@ void f() { } '''); if (isProtocolVersion2) { - // TODO(brianwilkerson) We should be suggesting the named constructor here. + // TODO(brianwilkerson): We should be suggesting the named constructor here. assertResponse(r''' replacement left: 3 @@ -9864,7 +9864,7 @@ void f() { } '''); if (isProtocolVersion2) { - // TODO(brianwilkerson) The suggestions here are correct, except for the + // TODO(brianwilkerson): The suggestions here are correct, except for the // last line, which needs to be removed. assertResponse(r''' suggestions @@ -12165,7 +12165,7 @@ suggestions Future test_completion_libraryIdentifier_notEOF_1() async { allowedIdentifiers = {'parse', 'bool'}; - // TODO(brianwilkerson) This is the same as + // TODO(brianwilkerson): This is the same as // test_completion_libraryIdentifier_atEOF_1, probably this one needs // something following the directive. await computeSuggestions(''' diff --git a/pkg/analysis_server/test/services/completion/dart/declaration/class_member_test.dart b/pkg/analysis_server/test/services/completion/dart/declaration/class_member_test.dart index e4d64f1a7a2..f88ef064199 100644 --- a/pkg/analysis_server/test/services/completion/dart/declaration/class_member_test.dart +++ b/pkg/analysis_server/test/services/completion/dart/declaration/class_member_test.dart @@ -131,7 +131,7 @@ suggestions Future test_afterPeriod_beforeStatement_onlyStatic_notFromSuperclass() async { - // TODO(brianwilkerson) Split into two tests and remove extraneous code. + // TODO(brianwilkerson): Split into two tests and remove extraneous code. await computeSuggestions(''' class B { static int b0; @@ -154,7 +154,7 @@ suggestions } Future test_afterPeriod_onlyStatic_notFromSuperclass() async { - // TODO(brianwilkerson) Split into two tests and remove extraneous code. + // TODO(brianwilkerson): Split into two tests and remove extraneous code. await computeSuggestions(''' class B { static int b0; diff --git a/pkg/analysis_server/test/services/completion/dart/declaration/enum_test.dart b/pkg/analysis_server/test/services/completion/dart/declaration/enum_test.dart index b4a0b691726..1fec70d9908 100644 --- a/pkg/analysis_server/test/services/completion/dart/declaration/enum_test.dart +++ b/pkg/analysis_server/test/services/completion/dart/declaration/enum_test.dart @@ -362,7 +362,7 @@ suggestions '''); } else { _configureWithMyEnum(); - // TODO(scheglov) This is wrong. + // TODO(scheglov): This is wrong. assertResponse(r''' replacement left: 4 @@ -441,7 +441,7 @@ suggestions '''); } else { _configureWithMyEnum(); - // TODO(scheglov) This is wrong. + // TODO(scheglov): This is wrong. assertResponse(r''' replacement left: 5 @@ -472,7 +472,7 @@ void f() { '''); if (isProtocolVersion2) { - // TODO(scheglov) The kind should be a prefix. + // TODO(scheglov): The kind should be a prefix. assertResponse(r''' replacement left: 2 @@ -482,7 +482,7 @@ suggestions '''); } else { _configureWithMyEnum(); - // TODO(scheglov) This is wrong. + // TODO(scheglov): This is wrong. assertResponse(r''' replacement left: 2 @@ -512,7 +512,7 @@ void f() { } '''); - // TODO(scheglov) This is wrong. + // TODO(scheglov): This is wrong. // Should include constants, as [test_nothing_imported_withPrefix] does. assertResponse(r''' suggestions @@ -590,7 +590,7 @@ suggestions kind: enumConstant '''); } else { - // TODO(scheglov) This is wrong. + // TODO(scheglov): This is wrong. assertResponse(r''' suggestions MyEnum diff --git a/pkg/analysis_server/test/services/completion/dart/declaration/imported_reference_test.dart b/pkg/analysis_server/test/services/completion/dart/declaration/imported_reference_test.dart index 289ee4b18a8..52b4005b8ba 100644 --- a/pkg/analysis_server/test/services/completion/dart/declaration/imported_reference_test.dart +++ b/pkg/analysis_server/test/services/completion/dart/declaration/imported_reference_test.dart @@ -3639,7 +3639,7 @@ suggestions parameterTypes: dynamic,int '''); } else { - // TODO(brianwilkerson) Figure out why we're not producing parameter types. + // TODO(brianwilkerson): Figure out why we're not producing parameter types. assertResponse(r''' suggestions m0 @@ -3672,7 +3672,7 @@ suggestions parameterTypes: dynamic,int '''); } else { - // TODO(brianwilkerson) Figure out why we're not producing parameter types. + // TODO(brianwilkerson): Figure out why we're not producing parameter types. assertResponse(r''' suggestions m0 @@ -3705,7 +3705,7 @@ suggestions parameterTypes: dynamic,int '''); } else { - // TODO(brianwilkerson) Figure out why we're not producing parameter types. + // TODO(brianwilkerson): Figure out why we're not producing parameter types. assertResponse(r''' suggestions m0 @@ -3737,7 +3737,7 @@ suggestions parameterTypes: int?,int '''); } else { - // TODO(brianwilkerson) Figure out why we're not producing parameter types. + // TODO(brianwilkerson): Figure out why we're not producing parameter types. assertResponse(r''' suggestions m0 @@ -3792,7 +3792,7 @@ suggestions parameterTypes: dynamic,int '''); } else { - // TODO(brianwilkerson) Figure out why we're not producing parameter types. + // TODO(brianwilkerson): Figure out why we're not producing parameter types. assertResponse(r''' suggestions m0 @@ -3825,7 +3825,7 @@ suggestions parameterTypes: dynamic,int '''); } else { - // TODO(brianwilkerson) Figure out why we're not producing parameter types. + // TODO(brianwilkerson): Figure out why we're not producing parameter types. assertResponse(r''' suggestions m0 @@ -5198,7 +5198,7 @@ suggestions parameterTypes: dynamic,int '''); } else { - // TODO(brianwilkerson) Figure out why we're not producing parameter types. + // TODO(brianwilkerson): Figure out why we're not producing parameter types. assertResponse(r''' suggestions m0 @@ -5229,7 +5229,7 @@ suggestions parameterTypes: dynamic,int '''); } else { - // TODO(brianwilkerson) Figure out why we're not producing parameter types. + // TODO(brianwilkerson): Figure out why we're not producing parameter types. assertResponse(r''' suggestions m0 @@ -5260,7 +5260,7 @@ suggestions parameterTypes: dynamic,int '''); } else { - // TODO(brianwilkerson) Figure out why we're not producing parameter types. + // TODO(brianwilkerson): Figure out why we're not producing parameter types. assertResponse(r''' suggestions m0 @@ -5313,7 +5313,7 @@ suggestions parameterTypes: dynamic,int '''); } else { - // TODO(brianwilkerson) Figure out why we're not producing parameter types. + // TODO(brianwilkerson): Figure out why we're not producing parameter types. assertResponse(r''' suggestions m0 @@ -5346,7 +5346,7 @@ suggestions parameterTypes: dynamic,int '''); } else { - // TODO(brianwilkerson) Figure out why we're not producing parameter types. + // TODO(brianwilkerson): Figure out why we're not producing parameter types. assertResponse(r''' suggestions m0 @@ -5811,7 +5811,7 @@ class B extends A { } '''); if (isProtocolVersion2) { - // TODO(brianwilkerson) Figure out why there is no parameter information. + // TODO(brianwilkerson): Figure out why there is no parameter information. assertResponse(r''' suggestions x0 diff --git a/pkg/analysis_server/test/services/completion/dart/declaration/type_member_test.dart b/pkg/analysis_server/test/services/completion/dart/declaration/type_member_test.dart index 2d7e8f5992d..79b73f967c3 100644 --- a/pkg/analysis_server/test/services/completion/dart/declaration/type_member_test.dart +++ b/pkg/analysis_server/test/services/completion/dart/declaration/type_member_test.dart @@ -24,7 +24,7 @@ class TypeMemberTest2 extends AbstractCompletionDriverTest } mixin TypeMemberTestCases on AbstractCompletionDriverTest { - // TODO(brianwilkerson) These tests should be broken up depending on which + // TODO(brianwilkerson): These tests should be broken up depending on which // kind of container the member belongs to. @override bool get includeKeywords => false; diff --git a/pkg/analysis_server/test/services/completion/dart/declaration/uri_test.dart b/pkg/analysis_server/test/services/completion/dart/declaration/uri_test.dart index f8a0c143be2..c77f0c9c173 100644 --- a/pkg/analysis_server/test/services/completion/dart/declaration/uri_test.dart +++ b/pkg/analysis_server/test/services/completion/dart/declaration/uri_test.dart @@ -391,7 +391,7 @@ suggestions await computeSuggestions(''' import "" if (dart.library.io) "d^ '''); - // TODO(brianwilkerson) We should be suggesting `dart:` and `package:`. The + // TODO(brianwilkerson): We should be suggesting `dart:` and `package:`. The // test used to include those before being converted, but no longer does. assertResponse(r''' replacement @@ -584,7 +584,7 @@ suggestions await computeSuggestions(''' import "^" import '''); - // TODO(brianwilkerson) Before being converted, this test used to produce + // TODO(brianwilkerson): Before being converted, this test used to produce // 'other.dart' and 'foo/'. assertResponse(r''' suggestions @@ -626,7 +626,7 @@ suggestions await computeSuggestions(''' import "..^" import '''); - // TODO(brianwilkerson) Before being converted, this test used to produce + // TODO(brianwilkerson): Before being converted, this test used to produce // 'other.dart' and 'foo/'. if (isProtocolVersion2) { assertResponse(r''' @@ -678,7 +678,7 @@ suggestions await computeSuggestions(''' import "foo/^" import '''); - // TODO(brianwilkerson) Before being converted, this test used to produce + // TODO(brianwilkerson): Before being converted, this test used to produce // 'foo/bar.dart'. if (isProtocolVersion2) { assertResponse(r''' @@ -794,7 +794,7 @@ suggestions await computeSuggestions(''' import "../^" import '''); - // TODO(brianwilkerson) Before being converted this test used to produce + // TODO(brianwilkerson): Before being converted this test used to produce // '../blat.dart' and '../aaa/'. if (isProtocolVersion2) { assertResponse(r''' @@ -846,7 +846,7 @@ suggestions await computeSuggestions(''' import "../b^" import '''); - // TODO(brianwilkerson) Before being converted, this test used to produce + // TODO(brianwilkerson): Before being converted, this test used to produce // '../blat.dart'. if (isProtocolVersion2) { assertResponse(r''' @@ -1592,7 +1592,7 @@ suggestions await computeSuggestions(''' import "d^ '''); - // TODO(brianwilkerson) Before being converted, this test used to produce + // TODO(brianwilkerson): Before being converted, this test used to produce // 'dart:' and 'package:'. assertResponse(r''' replacement @@ -1695,7 +1695,7 @@ suggestions await computeSuggestions(''' library x; part "^" import '''); - // TODO(brianwilkerson) Before being converted, this test used to produce + // TODO(brianwilkerson): Before being converted, this test used to produce // 'other.dart' and 'foo/'. assertResponse(r''' suggestions @@ -1709,7 +1709,7 @@ suggestions await computeSuggestions(''' library x; part "..^" import '''); - // TODO(brianwilkerson) Before being converted, this test used to produce + // TODO(brianwilkerson): Before being converted, this test used to produce // 'other.dart' and 'foo/'. assertResponse(r''' replacement @@ -1725,7 +1725,7 @@ suggestions await computeSuggestions(''' library x; part "foo/^" import '''); - // TODO(brianwilkerson) Before being converted, this test used to produce + // TODO(brianwilkerson): Before being converted, this test used to produce // 'foo/bar.dart'. assertResponse(r''' replacement @@ -1741,7 +1741,7 @@ suggestions await computeSuggestions(''' library x; part "../^" import '''); - // TODO(brianwilkerson) Before being converted, this test used to produce + // TODO(brianwilkerson): Before being converted, this test used to produce // '../blat.dart'. assertResponse(r''' replacement diff --git a/pkg/analysis_server/test/services/completion/dart/location/class_body_test.dart b/pkg/analysis_server/test/services/completion/dart/location/class_body_test.dart index 37b09696fb7..f5cdc56ce8d 100644 --- a/pkg/analysis_server/test/services/completion/dart/location/class_body_test.dart +++ b/pkg/analysis_server/test/services/completion/dart/location/class_body_test.dart @@ -454,7 +454,7 @@ ${keywords.asKeywordSuggestions} final keywords = { Keyword.CONST, Keyword.DYNAMIC, - // TODO(scheglov) This does not look right. + // TODO(scheglov): This does not look right. Keyword.EXTERNAL, Keyword.FINAL, Keyword.VAR, diff --git a/pkg/analysis_server/test/services/completion/dart/location/class_declaration_test.dart b/pkg/analysis_server/test/services/completion/dart/location/class_declaration_test.dart index 04ee4bc21c6..ee252daa55a 100644 --- a/pkg/analysis_server/test/services/completion/dart/location/class_declaration_test.dart +++ b/pkg/analysis_server/test/services/completion/dart/location/class_declaration_test.dart @@ -126,7 +126,7 @@ suggestions await computeSuggestions(''' class A e^ implements foo { } '''); - // TODO(brianwilkerson) The keyword `with` should not be suggested when + // TODO(brianwilkerson): The keyword `with` should not be suggested when // using protocol 2 (so this these should require a conditional check). // The reason it is being suggested is as follows: The `e` is ignored by // the parser so it doesn't show up in the AST. As a result, the "entity" diff --git a/pkg/analysis_server/test/services/completion/dart/location/compilation_unit_member_test.dart b/pkg/analysis_server/test/services/completion/dart/location/compilation_unit_member_test.dart index 598dc3b45d0..91445e46c5c 100644 --- a/pkg/analysis_server/test/services/completion/dart/location/compilation_unit_member_test.dart +++ b/pkg/analysis_server/test/services/completion/dart/location/compilation_unit_member_test.dart @@ -209,8 +209,8 @@ suggestions imp import "package:foo/foo.dart"; '''); - // TODO(danrubel) should not suggest declaration keywords - // TODO(brianwilkerson) Should not suggest export or part directives. + // TODO(danrubel): should not suggest declaration keywords + // TODO(brianwilkerson): Should not suggest export or part directives. assertResponse(r''' suggestions abstract @@ -790,7 +790,7 @@ suggestions part of foo; ^ '''); - // TODO(brianwilkerson) We should not be suggesting directives. + // TODO(brianwilkerson): We should not be suggesting directives. assertResponse(r''' suggestions abstract @@ -1143,7 +1143,7 @@ library libA; imp^ import "package:foo/foo.dart"; '''); - // TODO(brianwilkerson) Should not suggest `export` or `part` directives. + // TODO(brianwilkerson): Should not suggest `export` or `part` directives. if (isProtocolVersion2) { assertResponse(r''' replacement diff --git a/pkg/analysis_server/test/services/completion/dart/location/compilation_unit_test.dart b/pkg/analysis_server/test/services/completion/dart/location/compilation_unit_test.dart index 3c1c752d87b..fb6a89cef23 100644 --- a/pkg/analysis_server/test/services/completion/dart/location/compilation_unit_test.dart +++ b/pkg/analysis_server/test/services/completion/dart/location/compilation_unit_test.dart @@ -61,7 +61,7 @@ suggestions selection: 8 '''); } else { - // TODO(scheglov) This is wrong, should filter. + // TODO(scheglov): This is wrong, should filter. _protocol1Directives(); } } @@ -81,7 +81,7 @@ suggestions selection: 8 '''); } else { - // TODO(scheglov) This is wrong, should filter. + // TODO(scheglov): This is wrong, should filter. _protocol1Directives(); } } @@ -101,7 +101,7 @@ suggestions selection: 6 '''); } else { - // TODO(scheglov) This is wrong, should filter. + // TODO(scheglov): This is wrong, should filter. _protocol1Directives(); } } diff --git a/pkg/analysis_server/test/services/completion/dart/location/function_expression_test.dart b/pkg/analysis_server/test/services/completion/dart/location/function_expression_test.dart index 4b098bc850c..3a6d6db7c79 100644 --- a/pkg/analysis_server/test/services/completion/dart/location/function_expression_test.dart +++ b/pkg/analysis_server/test/services/completion/dart/location/function_expression_test.dart @@ -144,7 +144,7 @@ suggestions } Future test_afterRightParen_beforeRightBrace() async { - // TODO(brianwilkerson) Not clear that this is testing what the author + // TODO(brianwilkerson): Not clear that this is testing what the author // thought it would test. Note the '}' where ')' is expected. await computeSuggestions(''' void f() {foo(() ^}} diff --git a/pkg/analysis_server/test/services/completion/dart/location/if_statement_test.dart b/pkg/analysis_server/test/services/completion/dart/location/if_statement_test.dart index 7f8154126e7..f0ecec9d798 100644 --- a/pkg/analysis_server/test/services/completion/dart/location/if_statement_test.dart +++ b/pkg/analysis_server/test/services/completion/dart/location/if_statement_test.dart @@ -44,7 +44,7 @@ final v01 = 0; int f01() => 0; '''); - // TODO(scheglov) This is wrong. + // TODO(scheglov): This is wrong. // We should not suggest `v01`. // We could suggest `f01`, but not as an invocation. // We suggest `A1`, but almost always we want `A1()`. @@ -95,7 +95,7 @@ int B04() => 0; '''); if (isProtocolVersion2) { - // TODO(scheglov) This is wrong. + // TODO(scheglov): This is wrong. assertResponse(r''' replacement left: 1 diff --git a/pkg/analysis_server/test/services/completion/dart/location/import_directive_test.dart b/pkg/analysis_server/test/services/completion/dart/location/import_directive_test.dart index bdcdb7e3452..8bed3dcd5c1 100644 --- a/pkg/analysis_server/test/services/completion/dart/location/import_directive_test.dart +++ b/pkg/analysis_server/test/services/completion/dart/location/import_directive_test.dart @@ -67,7 +67,7 @@ class F0 {} '''); // Part of the purpose of this test is to ensure that we don't suggest names // from other imports ('C0' and 'D0') or locally defined names ('F0'). - // TODO(scheglov) It might be also interesting what happens when we have + // TODO(scheglov): It might be also interesting what happens when we have // just a getter, just a setter, a pair of a getter and a setter. assertResponse(r''' suggestions diff --git a/pkg/analysis_server/test/services/completion/dart/location/record_pattern_test.dart b/pkg/analysis_server/test/services/completion/dart/location/record_pattern_test.dart index a5d38c1f753..ba3267a122d 100644 --- a/pkg/analysis_server/test/services/completion/dart/location/record_pattern_test.dart +++ b/pkg/analysis_server/test/services/completion/dart/location/record_pattern_test.dart @@ -52,7 +52,7 @@ void f(({int f01, int f02, int g01}) x0) { (f01: ^) = x0; } '''); - // TODO(scheglov) This is wrong. + // TODO(scheglov): This is wrong. assertResponse(r''' suggestions const diff --git a/pkg/analysis_server/test/services/completion/dart/location/relational_pattern_test.dart b/pkg/analysis_server/test/services/completion/dart/location/relational_pattern_test.dart index d51afeb6be3..a3ace730f50 100644 --- a/pkg/analysis_server/test/services/completion/dart/location/relational_pattern_test.dart +++ b/pkg/analysis_server/test/services/completion/dart/location/relational_pattern_test.dart @@ -95,7 +95,7 @@ class A01 {} class A02 {} class B01 {} '''); - // TODO(brianwilkerson) We lost `const`. + // TODO(brianwilkerson): We lost `const`. assertResponse(r''' suggestions A01 diff --git a/pkg/analysis_server/test/services/completion/dart/location/switch_expression_test.dart b/pkg/analysis_server/test/services/completion/dart/location/switch_expression_test.dart index 3d90ba189bb..c1219a06f20 100644 --- a/pkg/analysis_server/test/services/completion/dart/location/switch_expression_test.dart +++ b/pkg/analysis_server/test/services/completion/dart/location/switch_expression_test.dart @@ -151,7 +151,7 @@ int A04() => 0; int B04() => 0; '''); if (isProtocolVersion2) { - // TODO(scheglov) This is wrong. + // TODO(scheglov): This is wrong. assertResponse(r''' replacement left: 1 @@ -217,7 +217,7 @@ int A04() => 0; int B04() => 0; '''); if (isProtocolVersion2) { - // TODO(scheglov) This is wrong. + // TODO(scheglov): This is wrong. assertResponse(r''' replacement left: 1 diff --git a/pkg/analysis_server/test/services/completion/dart/location/switch_statement_test.dart b/pkg/analysis_server/test/services/completion/dart/location/switch_statement_test.dart index ad2443d7ca1..efa56ca3fc2 100644 --- a/pkg/analysis_server/test/services/completion/dart/location/switch_statement_test.dart +++ b/pkg/analysis_server/test/services/completion/dart/location/switch_statement_test.dart @@ -139,7 +139,7 @@ suggestions await computeSuggestions(''' void f() {switch(1) {^ default:}} '''); - // TODO(brianwilkerson) We shouldn't be suggesting `default` here. + // TODO(brianwilkerson): We shouldn't be suggesting `default` here. assertResponse(r''' suggestions case diff --git a/pkg/analysis_server/test/services/completion/dart/relevance/bool_assignment_test.dart b/pkg/analysis_server/test/services/completion/dart/relevance/bool_assignment_test.dart index 0254e45c4af..8ed4fef11df 100644 --- a/pkg/analysis_server/test/services/completion/dart/relevance/bool_assignment_test.dart +++ b/pkg/analysis_server/test/services/completion/dart/relevance/bool_assignment_test.dart @@ -43,7 +43,7 @@ The actual relevances are: ''') @override Future test_boolLiterals_imported() { - // TODO: implement test_boolLiterals_imported + // TODO(scheglov): implement test_boolLiterals_imported return super.test_boolLiterals_imported(); } } diff --git a/pkg/analysis_server/test/services/correction/name_suggestion_test.dart b/pkg/analysis_server/test/services/correction/name_suggestion_test.dart index c82f6f68958..9bbb267abce 100644 --- a/pkg/analysis_server/test/services/correction/name_suggestion_test.dart +++ b/pkg/analysis_server/test/services/correction/name_suggestion_test.dart @@ -150,7 +150,7 @@ void f(p) { getVariableNameSuggestionsForExpression(null, findNode.instanceCreation('new NoSuchClass.named()'), excluded), unorderedEquals(['noSuchClass', 'suchClass', 'class'])); - // TODO(scheglov) This test does not work. + // TODO(scheglov): This test does not work. // In "p.NoSuchClass" the identifier "p" is not resolved to a PrefixElement. // expect( // getVariableNameSuggestionsForExpression( diff --git a/pkg/analysis_server/test/services/search/search_engine_test.dart b/pkg/analysis_server/test/services/search/search_engine_test.dart index 7fdd6e80d1c..ebbeceda27b 100644 --- a/pkg/analysis_server/test/services/search/search_engine_test.dart +++ b/pkg/analysis_server/test/services/search/search_engine_test.dart @@ -23,7 +23,7 @@ void main() { }); } -/// TODO(scheglov) This class does not really belong here. +// TODO(scheglov): This class does not really belong here. /// Consider merging it into [AbstractContextTest]. class PubPackageResolutionTest extends AbstractContextTest { late ResolvedUnitResult result; diff --git a/pkg/analysis_server/test/src/cider/completion_test.dart b/pkg/analysis_server/test/src/cider/completion_test.dart index 741092e1f92..1e99068dfe8 100644 --- a/pkg/analysis_server/test/src/cider/completion_test.dart +++ b/pkg/analysis_server/test/src/cider/completion_test.dart @@ -817,7 +817,7 @@ import 'a.dart'; }; } - /// TODO(scheglov) Implement incremental updating + // TODO(scheglov): Implement incremental updating void _createFileResolver() { createFileResolver(); } diff --git a/pkg/analysis_server/test/src/computer/closing_labels_computer_test.dart b/pkg/analysis_server/test/src/computer/closing_labels_computer_test.dart index 72bcc5890f5..d3eeaf0a6fa 100644 --- a/pkg/analysis_server/test/src/computer/closing_labels_computer_test.dart +++ b/pkg/analysis_server/test/src/computer/closing_labels_computer_test.dart @@ -128,7 +128,7 @@ Widget build(BuildContext context) { } """; - // TODO(dantup) Results here are currently bad so this test is just checking + // TODO(dantup): Results here are currently bad so this test is just checking // that we don't crash. Need to confirm what to do here; the bad labels // might not be fixed until the code is using the new shared parser. // https://github.com/dart-lang/sdk/issues/30370 diff --git a/pkg/analysis_server/test/src/computer/imported_elements_computer_test.dart b/pkg/analysis_server/test/src/computer/imported_elements_computer_test.dart index 706a8aa16a6..dbd524a7fca 100644 --- a/pkg/analysis_server/test/src/computer/imported_elements_computer_test.dart +++ b/pkg/analysis_server/test/src/computer/imported_elements_computer_test.dart @@ -467,7 +467,7 @@ bool randomBool() { } Future _computeElements(String content, String selection) async { - // TODO(brianwilkerson) Automatically extract the selection from the content. + // TODO(brianwilkerson): Automatically extract the selection from the content. final file = newFile(sourcePath, content); var result = await getResolvedUnit(file); var computer = ImportedElementsComputer( diff --git a/pkg/analysis_server/test/src/g3/fixes_test.dart b/pkg/analysis_server/test/src/g3/fixes_test.dart index edef3dc26ee..a83839d8bf7 100644 --- a/pkg/analysis_server/test/src/g3/fixes_test.dart +++ b/pkg/analysis_server/test/src/g3/fixes_test.dart @@ -188,7 +188,7 @@ class C { } /// Write an analysis options file based on the given arguments. - /// TODO(scheglov) Use AnalysisOptionsFileConfig + // TODO(scheglov): Use AnalysisOptionsFileConfig void _writeAnalysisOptionsFile({ List? lints, }) { diff --git a/pkg/analysis_server/test/src/plugin/notification_manager_test.dart b/pkg/analysis_server/test/src/plugin/notification_manager_test.dart index 2cf7d0ed3ba..035d1e5d10d 100644 --- a/pkg/analysis_server/test/src/plugin/notification_manager_test.dart +++ b/pkg/analysis_server/test/src/plugin/notification_manager_test.dart @@ -348,7 +348,7 @@ class NotificationManagerTest extends ProtocolTestUtilities { @failingTest void test_recordOutlines_withSubscription() { _fail('The outline handling needs to be re-worked slightly'); - // TODO(brianwilkerson) Figure out outlines. What should we do when merge + // TODO(brianwilkerson): Figure out outlines. What should we do when merge // cannot produce a single outline? manager.setSubscriptions({ server.AnalysisService.OUTLINE: {fileA, fileB} @@ -359,14 +359,14 @@ class NotificationManagerTest extends ProtocolTestUtilities { var outline1 = outline(0, 0); var outline2 = outline(5, 7); manager.recordOutlines('a', fileA, [outline1, outline2]); - // TODO(brianwilkerson) Figure out how to test this. + // TODO(brianwilkerson): Figure out how to test this. // _verifyOutlines(fileA, [outline1, outline2]); // // Outlines from different plugins should be cumulative. // var outline3 = outline(10, 14); manager.recordOutlines('b', fileA, [outline3]); - // TODO(brianwilkerson) Figure out how to test this. + // TODO(brianwilkerson): Figure out how to test this. // _verifyOutlines(fileA, [outline1, outline2, outline3]); // // Overwriting outlines from one plugin should not affect outlines from @@ -374,7 +374,7 @@ class NotificationManagerTest extends ProtocolTestUtilities { // var outline4 = outline(15, 21); manager.recordOutlines('a', fileA, [outline4]); - // TODO(brianwilkerson) Figure out how to test this. + // TODO(brianwilkerson): Figure out how to test this. // _verifyOutlines(fileA, [outline4, outline3]); // // Recording outlines against a file should not affect the outlines for @@ -382,7 +382,7 @@ class NotificationManagerTest extends ProtocolTestUtilities { // var outline5 = outline(20, 28); manager.recordOutlines('a', fileB, [outline5]); - // TODO(brianwilkerson) Figure out how to test this. + // TODO(brianwilkerson): Figure out how to test this. // _verifyOutlines(fileB, [outline5]); } diff --git a/pkg/analysis_server/test/src/services/completion/yaml/analysis_options_generator_test.dart b/pkg/analysis_server/test/src/services/completion/yaml/analysis_options_generator_test.dart index 52d89bc6ffe..91c7348b538 100644 --- a/pkg/analysis_server/test/src/services/completion/yaml/analysis_options_generator_test.dart +++ b/pkg/analysis_server/test/src/services/completion/yaml/analysis_options_generator_test.dart @@ -127,7 +127,7 @@ code-style: assertSuggestion('${AnalyzerOptions.analyzer}: '); assertSuggestion('${AnalyzerOptions.codeStyle}: '); assertSuggestion('${AnalyzerOptions.include}: '); - // TODO(brianwilkerson) Replace this with a constant. + // TODO(brianwilkerson): Replace this with a constant. assertSuggestion('linter: '); } diff --git a/pkg/analysis_server/test/src/services/correction/assist/add_type_annotation_test.dart b/pkg/analysis_server/test/src/services/correction/assist/add_type_annotation_test.dart index 8f4f2f7b4a8..a3f9a5e8e38 100644 --- a/pkg/analysis_server/test/src/services/correction/assist/add_type_annotation_test.dart +++ b/pkg/analysis_server/test/src/services/correction/assist/add_type_annotation_test.dart @@ -469,7 +469,7 @@ void f(int Function(int) p) { v = p; } '''); - // TODO(brianwilkerson) Improve `DartChangeBuilder.writeType` so that + // TODO(brianwilkerson): Improve `DartChangeBuilder.writeType` so that // unnecessary parameter names (`p1`) are not written. await assertHasAssistAt('var ', ''' void f(int Function(int) p) { diff --git a/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_sized_box_test.dart b/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_sized_box_test.dart index ed0c8857dea..872ebb09481 100644 --- a/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_sized_box_test.dart +++ b/pkg/analysis_server/test/src/services/correction/assist/flutter_wrap_sized_box_test.dart @@ -8,7 +8,7 @@ import 'package:test_reflective_loader/test_reflective_loader.dart'; import 'assist_processor.dart'; -// todo: update for SizedBox +// TODO(devoncarew): update for SizedBox void main() { defineReflectiveSuite(() { diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_async_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_async_test.dart index aff2684e2ee..795e8c9afcb 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/add_async_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/add_async_test.dart @@ -343,7 +343,7 @@ class AvoidReturningNullForFutureTest extends FixProcessorLintTest { String get lintCode => LintNames.avoid_returning_null_for_future; @override - // TODO(brianwilkerson) Migrate this test to null safety. + // TODO(brianwilkerson): Migrate this test to null safety. String? get testPackageLanguageVersion => '2.9'; Future test_asyncFor() async { diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_diagnostic_property_reference_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_diagnostic_property_reference_test.dart index e51de1840f6..1027c4e156a 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/add_diagnostic_property_reference_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/add_diagnostic_property_reference_test.dart @@ -643,5 +643,5 @@ class C extends Widget with Diagnosticable { '''); } - // todo (pq): consider a test for a body w/ no CR + // TODO(pq): consider a test for a body w/ no CR } diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_missing_parameter_positional_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_missing_parameter_positional_test.dart index 4467cd95138..b692e049c3a 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/add_missing_parameter_positional_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/add_missing_parameter_positional_test.dart @@ -140,7 +140,7 @@ void f() { test(1); } '''); - // TODO(brianwilkerson) The fix needs to make the parameter nullable, but + // TODO(brianwilkerson): The fix needs to make the parameter nullable, but // I'm leaving the test as is to keep it passing. await assertHasFix(''' test([int i]) {} diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_null_check_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_null_check_test.dart index 0aad329f8c5..4619438d31a 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/add_null_check_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/add_null_check_test.dart @@ -669,7 +669,7 @@ var i = n! as int; } Future test_castNullable_unnecessaryCast() async { - // todo(pq): consider removing unnecessary 'as String' cast + // TODO(pq): consider removing unnecessary 'as String' cast await resolveTestCode(r''' String? s; var a = s as String; diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_super_parameter_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_super_parameter_test.dart index 1b6fad94041..a02e6c73989 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/add_super_parameter_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/add_super_parameter_test.dart @@ -28,7 +28,7 @@ class B extends A { B({required super.b, required super.c}); } '''); - // TODO(asashour) consider inserting the named argument in the same + // TODO(asashour): consider inserting the named argument in the same // position as in the superclass. await assertHasFix(''' class A { @@ -68,7 +68,7 @@ class B extends A { B(super.i,); } '''); - // TODO(asashour) consider inserting the comma at the end + // TODO(asashour): consider inserting the comma at the end await assertHasFix(''' class A { A(int i, {required int a, required int b}); diff --git a/pkg/analysis_server/test/src/services/correction/fix/change_to_test.dart b/pkg/analysis_server/test/src/services/correction/fix/change_to_test.dart index 0f5c01d30a3..ee59d588fd9 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/change_to_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/change_to_test.dart @@ -41,7 +41,7 @@ class MyClass { @failingTest Future test_annotation_variable() async { - // TODO(brianwilkerson) Add support for suggesting similar top-level + // TODO(brianwilkerson): Add support for suggesting similar top-level // variables. await resolveTestCode(''' const annotation = ''; diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/rename_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/rename_test.dart index 6b41ecf70a8..b04369d1660 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/rename_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/rename_test.dart @@ -1343,7 +1343,7 @@ class C with p.New {} @reflectiveTest class RenameSetterTest extends _AbstractRenameTest { @override - // TODO(asashour) consider changing the kind to `setter`, + // TODO(asashour): consider changing the kind to `setter`, // and matching it as `method` String get _kind => 'method'; diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/replaced_by_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/replaced_by_test.dart index a9989957e31..1c3f3be30a0 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/replaced_by_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/replaced_by_test.dart @@ -954,7 +954,7 @@ void g() { } var import = "import '$importUri'$prefixDeclaration;"; - //TODO(asashour) inserting imports should remove initial blank lines + // TODO(asashour): inserting imports should remove initial blank lines var oldImport = isOldRemoved ? '' : ''' diff --git a/pkg/analysis_server/test/src/services/correction/fix/fix_in_file_test.dart b/pkg/analysis_server/test/src/services/correction/fix/fix_in_file_test.dart index da800f0f8df..3210a7408ae 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/fix_in_file_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/fix_in_file_test.dart @@ -18,7 +18,7 @@ void main() { VerificationTests.defineTests(); } -//// todo (pq): update w/ a FixKind that we're sure we want to support as a file fix +// /todo (pq): update w/ a FixKind that we're sure we want to support as a file fix // @reflectiveTest // class MultiFixInFileTest extends FixInFileProcessorTest // with WithNullSafetyMixin { @@ -143,7 +143,7 @@ class VerificationTests { } static void verify_fixInFileFixKindsHaveMultiFixes() { - // todo (pq): find a better way to verify dynamic producers. + // TODO(pq): find a better way to verify dynamic producers. var dynamicProducerTypes = ['ReplaceWithIsEmpty']; group('VerificationTests | fixInFileFixKindsHaveMultiFixes | lint |', () { @@ -166,4 +166,4 @@ class VerificationTests { } } -/// todo (pq): add negative tests +// TODO(pq): add negative tests diff --git a/pkg/analysis_server/test/src/services/correction/fix/fix_processor.dart b/pkg/analysis_server/test/src/services/correction/fix/fix_processor.dart index d894ceed586..bbfbb2b0cac 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/fix_processor.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/fix_processor.dart @@ -588,12 +588,12 @@ mixin WithNullSafetyLintMixin on AbstractContextTest { } } -/// todo (pq): temporary +// TODO(pq): temporary extension FixExtension on Fix { bool isFixAllFix() => kind.canBeAppliedTogether(); } extension FixKindExtension on FixKind { - /// todo (pq): temporary + // TODO(pq): temporary bool canBeAppliedTogether() => priority == DartFixKindPriority.IN_FILE; } diff --git a/pkg/analysis_server/test/src/services/correction/fix/pubspec/test_support.dart b/pkg/analysis_server/test/src/services/correction/fix/pubspec/test_support.dart index ac50144f616..5ae3e692322 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/pubspec/test_support.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/pubspec/test_support.dart @@ -51,7 +51,7 @@ abstract class PubspecFixTest with ResourceProviderMixin { source: pubspecFile.createSource(), contents: node, provider: resourceProvider, - // TODO: Can/should we pass analysis-options here? + // TODO(sigurdm): Can/should we pass analysis-options here? analysisOptions: null); expect(errors.length, 1); error = errors[0]; diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_unused_import_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_unused_import_test.dart index 94a1c485978..f995e84f951 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/remove_unused_import_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/remove_unused_import_test.dart @@ -22,7 +22,7 @@ void main() { class RemoveUnusedImportBulkTest extends BulkFixProcessorTest { @FailingTest(reason: 'multiple deletions conflict') Future test_multipleOnSingleLine() async { - // TODO(brianwilkerson) Remove test_multipleOnSingleLine_temporary when this + // TODO(brianwilkerson): Remove test_multipleOnSingleLine_temporary when this // test starts to pass. await resolveTestCode(''' import 'dart:collection'; import 'dart:math'; import 'dart:async'; @@ -120,7 +120,7 @@ void f() {} @FailingTest(reason: 'multiple deletions conflict') Future test_all_singleLine() async { - // TODO(brianwilkerson) Remove test_multipleOnSingleLine_temporary when this + // TODO(brianwilkerson): Remove test_multipleOnSingleLine_temporary when this // test starts to pass. await resolveTestCode(''' import 'dart:math'; import 'dart:math'; import 'dart:math'; diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_null_with_closure_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_null_with_closure_test.dart index 1e779b7e4d2..bec0e2b8e6d 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/replace_null_with_closure_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/replace_null_with_closure_test.dart @@ -79,7 +79,7 @@ void f(String s) { @failingTest Future test_required() async { - // TODO(brianwilkerson) I suspect that the lint should not be generated in + // TODO(brianwilkerson): I suspect that the lint should not be generated in // this case because the parameter to `firstWhere` has the type // `bool Function(int)`. If that's true, then this test should be deleted. await resolveTestCode(''' diff --git a/pkg/analysis_server/test/src/services/correction/fix/sort_child_property_last_test.dart b/pkg/analysis_server/test/src/services/correction/fix/sort_child_property_last_test.dart index 213b17b7097..66db875269c 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/sort_child_property_last_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/sort_child_property_last_test.dart @@ -42,7 +42,7 @@ void f() { ); } '''); - // todo (pq): two diagnostics are produced but only the first is fixed. + // TODO(pq): two diagnostics are produced but only the first is fixed. // see: linter/test/rules/sort_child_properties_last.dart:nestedChildren() await assertHasFix(''' import 'package:flutter/material.dart'; diff --git a/pkg/analysis_server/test/src/services/refactoring/convert_all_formal_parameters_to_named_test.dart b/pkg/analysis_server/test/src/services/refactoring/convert_all_formal_parameters_to_named_test.dart index 971b3f62cb7..11eeb0202db 100644 --- a/pkg/analysis_server/test/src/services/refactoring/convert_all_formal_parameters_to_named_test.dart +++ b/pkg/analysis_server/test/src/services/refactoring/convert_all_formal_parameters_to_named_test.dart @@ -95,7 +95,7 @@ void f() { } Future test_multiple_files() async { - // TODO(scheglov) Unify behind `testPackageLibPath` + // TODO(scheglov): Unify behind `testPackageLibPath` final a = getFile('$projectFolderPath/lib/a.dart'); newFile(a.path, r''' import 'main.dart'; diff --git a/pkg/analysis_server/test/src/utilities/extensions/range_factory_test.dart b/pkg/analysis_server/test/src/utilities/extensions/range_factory_test.dart index 762e025834c..4e70a913950 100644 --- a/pkg/analysis_server/test/src/utilities/extensions/range_factory_test.dart +++ b/pkg/analysis_server/test/src/utilities/extensions/range_factory_test.dart @@ -98,7 +98,7 @@ abstract class BaseRangeFactoryTest extends AbstractSingleUnitTest { /// order to ensure backward compatibility. @reflectiveTest class RangeFactory_NodeInListTest extends BaseRangeFactoryTest { - // TODO(brianwilkerson) When the tested method becomes public API then these + // TODO(brianwilkerson): When the tested method becomes public API then these // two classes should be merged. Future test_argumentList_first_named() async { await resolveTestCode(''' diff --git a/pkg/analysis_server/test/stress/replay/replay.dart b/pkg/analysis_server/test/stress/replay/replay.dart index f4e975b9d42..28c9c890ac8 100644 --- a/pkg/analysis_server/test/stress/replay/replay.dart +++ b/pkg/analysis_server/test/stress/replay/replay.dart @@ -225,9 +225,9 @@ class Driver { featureSet: featureSet, ); var token = scanner.tokenize(); - // TODO(brianwilkerson) Randomize. Sometimes add zero (0) as a break point. + // TODO(brianwilkerson): Randomize. Sometimes add zero (0) as a break point. while (!token.isEof) { - // TODO(brianwilkerson) Break inside comments? + // TODO(brianwilkerson): Break inside comments? // Token comment = token.precedingComments; var offset = token.offset; var length = token.length; @@ -378,7 +378,7 @@ class Driver { editList.add(edit); } // - // TODO(brianwilkerson) Randomize. + // TODO(brianwilkerson): Randomize. // Randomly select operations from different files to simulate a user // editing multiple files simultaneously. // @@ -420,7 +420,7 @@ class Driver { server.sendServerSetSubscriptions([ServerService.STATUS]); server.sendAnalysisSetGeneralSubscriptions( [GeneralAnalysisService.ANALYZED_FILES]); - // TODO(brianwilkerson) Get the list of glob patterns from the server after + // TODO(brianwilkerson): Get the list of glob patterns from the server after // an API for getting them has been implemented. fileGlobs = [ Glob(path.context.separator, '**.dart'), @@ -431,7 +431,7 @@ class Driver { try { await _replayChanges(); } finally { - // TODO(brianwilkerson) This needs to be moved into a Zone in order to + // TODO(brianwilkerson): This needs to be moved into a Zone in order to // ensure that it is always run. server.sendServerShutdown(); repository.checkout('master'); @@ -515,7 +515,7 @@ class FileEdit { operations.add(Analysis_UpdateContent(filePath, overlay)); } - // TODO(brianwilkerson) Randomize. + // TODO(brianwilkerson): Randomize. // Make the order of edits random. Doing so will require updating the // offsets of edits after the selected edit point. addUpdateContent(AddContentOverlay(content)); diff --git a/pkg/analysis_server/test/stress/utilities/server.dart b/pkg/analysis_server/test/stress/utilities/server.dart index 157aabf3461..546d0aba6fa 100644 --- a/pkg/analysis_server/test/stress/utilities/server.dart +++ b/pkg/analysis_server/test/stress/utilities/server.dart @@ -176,7 +176,7 @@ class Server { /// Return a list of the paths of files that are currently being analyzed. List get analyzedDartFiles { bool isAnalyzed(String filePath) { - // TODO(brianwilkerson) This should use the path package to determine + // TODO(brianwilkerson): This should use the path package to determine // inclusion, and needs to take exclusions into account. for (var includedRoot in _analysisRootIncludes) { if (filePath.startsWith(includedRoot)) { diff --git a/pkg/analysis_server/test/verify_no_utf8_encode_test.dart b/pkg/analysis_server/test/verify_no_utf8_encode_test.dart index 6798ccace52..3fd14086743 100644 --- a/pkg/analysis_server/test/verify_no_utf8_encode_test.dart +++ b/pkg/analysis_server/test/verify_no_utf8_encode_test.dart @@ -10,7 +10,7 @@ import 'package:analyzer/src/util/file_paths.dart' as file_paths; import 'package:analyzer_utilities/package_root.dart'; import 'package:test/test.dart'; -/// TODO(scheglov) Remove it after SDK 3.1 published. +// TODO(scheglov): Remove it after SDK 3.1 published. void main() { group('_fe_analyzer_shared', () { buildTests(packagePath: '_fe_analyzer_shared'); diff --git a/pkg/analysis_server/test/verify_sorted_test.dart b/pkg/analysis_server/test/verify_sorted_test.dart index 08111263f6b..4b40969a15f 100644 --- a/pkg/analysis_server/test/verify_sorted_test.dart +++ b/pkg/analysis_server/test/verify_sorted_test.dart @@ -63,7 +63,7 @@ void buildTests({ void buildTestsForAnalysisServer() { var excludedPaths = [ 'test/mock_packages', - // TODO(brianwilkerson) Fix the generator to sort the generated files and + // TODO(brianwilkerson): Fix the generator to sort the generated files and // remove these exclusions. 'lib/protocol/protocol_constants.dart', 'lib/protocol/protocol_generated.dart', @@ -103,7 +103,7 @@ void buildTestsForAnalyzerCli() { } void buildTestsForAnalyzerPlugin() { - // TODO(brianwilkerson) Fix the generator to sort the generated files and + // TODO(brianwilkerson): Fix the generator to sort the generated files and // remove these exclusions. var excludedPaths = [ 'lib/protocol/protocol_common.dart', diff --git a/pkg/analysis_server/tool/code_completion/code_metrics.dart b/pkg/analysis_server/tool/code_completion/code_metrics.dart index 8ad4b4d84ac..fd34420b929 100644 --- a/pkg/analysis_server/tool/code_completion/code_metrics.dart +++ b/pkg/analysis_server/tool/code_completion/code_metrics.dart @@ -1459,7 +1459,7 @@ class CodeShapeMetricsComputer { sink.writeln(''); sink.writeln('Child data'); - // TODO(brianwilkerson) This misses all node kinds for which zero instances + // TODO(brianwilkerson): This misses all node kinds for which zero instances // were visited. var nodeData = data.nodeData; var parentData = data.parentData; diff --git a/pkg/analysis_server/tool/code_completion/completion_metrics.dart b/pkg/analysis_server/tool/code_completion/completion_metrics.dart index bde790cb748..c0d966738e6 100644 --- a/pkg/analysis_server/tool/code_completion/completion_metrics.dart +++ b/pkg/analysis_server/tool/code_completion/completion_metrics.dart @@ -1435,7 +1435,7 @@ class CompletionQualityMetricsComputer extends CompletionMetricsComputer { List _filterSuggestions( String prefix, List suggestions) { - // TODO(brianwilkerson) Replace this with a more realistic filtering + // TODO(brianwilkerson): Replace this with a more realistic filtering // algorithm. return suggestions .where((suggestion) => suggestion.completion.startsWith(prefix)) diff --git a/pkg/analysis_server/tool/code_completion/relevance_metrics.dart b/pkg/analysis_server/tool/code_completion/relevance_metrics.dart index faf6d342ffa..15a23d4ab14 100644 --- a/pkg/analysis_server/tool/code_completion/relevance_metrics.dart +++ b/pkg/analysis_server/tool/code_completion/relevance_metrics.dart @@ -1577,7 +1577,7 @@ class RelevanceDataCollector extends RecursiveAstVisitor { _recordDistance('member (extension)', 0); return; } - // TODO(brianwilkerson) It might be interesting to also know whether the + // TODO(brianwilkerson): It might be interesting to also know whether the // [element] was found in a class, interface, or mixin. var memberClass = member.thisOrAncestorOfType(); if (memberClass != null) { @@ -1693,7 +1693,7 @@ class RelevanceDataCollector extends RecursiveAstVisitor { var depth = _parameterReferenceDepth(node, definingElement); _recordDistance('function depth of referenced parameter', depth); } else if (element is LocalVariableElement) { - // TODO(brianwilkerson) This ignores the fact that nested functions can + // TODO(brianwilkerson): This ignores the fact that nested functions can // reference variables declared in enclosing functions. Consider // additionally measuring the number of function boundaries that are // crossed and then reporting the distance with a label such as @@ -1703,7 +1703,7 @@ class RelevanceDataCollector extends RecursiveAstVisitor { : featureComputer.localVariableDistance(node, element); _recordDistance('distance to local variable', distance); } else if (element != null) { - // TODO(brianwilkerson) We might want to cross reference the depth of + // TODO(brianwilkerson): We might want to cross reference the depth of // the declaration with the depth of the reference to see whether there // is a pattern. _recordDistance( diff --git a/pkg/analysis_server/tool/code_completion/relevance_table_generator.dart b/pkg/analysis_server/tool/code_completion/relevance_table_generator.dart index 6663ae96468..b20a7f5345d 100644 --- a/pkg/analysis_server/tool/code_completion/relevance_table_generator.dart +++ b/pkg/analysis_server/tool/code_completion/relevance_table_generator.dart @@ -876,7 +876,7 @@ class RelevanceDataCollector extends RecursiveAstVisitor { @override void visitInterpolationExpression(InterpolationExpression node) { - // TODO(brianwilkerson) Consider splitting this based on whether the + // TODO(brianwilkerson): Consider splitting this based on whether the // expression is a simple identifier ('$') or a full expression ('${'). _recordDataForNode('InterpolationExpression_expression', node.expression, allowedKeywords: expressionKeywords); @@ -1533,7 +1533,7 @@ const defaultElementKindRelevance = { var counts = entry.value; if (_hasElementKind(counts)) { var totalCount = _totalCount(counts); - // TODO(brianwilkerson) If two element kinds have the same count they + // TODO(brianwilkerson): If two element kinds have the same count they // ought to have the same probability. This doesn't correctly do that. var entries = counts.entries.toList() ..sort((first, second) => first.value.compareTo(second.value)); @@ -1609,7 +1609,7 @@ const defaultKeywordRelevance = { var counts = entry.value; if (_hasKeyword(counts)) { var totalCount = _totalCount(counts); - // TODO(brianwilkerson) If two keywords have the same count they ought to + // TODO(brianwilkerson): If two keywords have the same count they ought to // have the same probability. This doesn't correctly do that. var entries = counts.entries.toList() ..sort((first, second) => first.value.compareTo(second.value)); diff --git a/pkg/analysis_server/tool/code_completion/visitors.dart b/pkg/analysis_server/tool/code_completion/visitors.dart index 7d509ac0d10..21012719718 100644 --- a/pkg/analysis_server/tool/code_completion/visitors.dart +++ b/pkg/analysis_server/tool/code_completion/visitors.dart @@ -674,7 +674,7 @@ class ExpectedCompletionsVisitor extends RecursiveAstVisitor { if (elementKind == protocol.ElementKind.CLASS) { var constructorName = node.parent?.parent; if (constructorName is ConstructorName) { - // TODO(scheglov) Commented out, probably does not work now. + // TODO(scheglov): Commented out, probably does not work now. // var instanceCreationExpression = constructorName.parent; // if (instanceCreationExpression is InstanceCreationExpression && // constructorName.type.name == node) { @@ -815,7 +815,7 @@ class ExpectedCompletionsVisitor extends RecursiveAstVisitor { return false; } - // TODO (jwren) If there is a mode of completing at a token location where + // TODO(jwren): If there is a mode of completing at a token location where // the token is removed before the completion query happens, then this // should be disabled in such a case: // Named arguments, i.e. the 'foo' in 'method_call(foo: 1)' should not be diff --git a/pkg/analysis_server/tool/instrumentation/log/log.dart b/pkg/analysis_server/tool/instrumentation/log/log.dart index 001f5f356b2..4b4c9a634d5 100644 --- a/pkg/analysis_server/tool/instrumentation/log/log.dart +++ b/pkg/analysis_server/tool/instrumentation/log/log.dart @@ -397,7 +397,7 @@ abstract class JsonBasedEntry extends LogEntry { /// Encode any character in the given [string] that would prevent source code /// from being displayed correctly: end of line markers and spaces. String _encodeSourceCode(String string) { - // TODO(brianwilkerson) This method isn't working completely. Some source + // TODO(brianwilkerson): This method isn't working completely. Some source // code produces an error of // "log?start=3175:261 Uncaught SyntaxError: missing ) after argument list" // in the sample log I was using. @@ -407,7 +407,7 @@ abstract class JsonBasedEntry extends LogEntry { while (index < length) { var char = string.codeUnitAt(index); index++; - // TODO(brianwilkerson) Handle tabs and other special characters. + // TODO(brianwilkerson): Handle tabs and other special characters. if (char == '\r'.codeUnitAt(0)) { if (index < length && string.codeUnitAt(index) == '\n'.codeUnitAt(0)) { index++; diff --git a/pkg/analysis_server/tool/instrumentation/page/log_page.dart b/pkg/analysis_server/tool/instrumentation/page/log_page.dart index ca08f2b5dc3..04f86127125 100644 --- a/pkg/analysis_server/tool/instrumentation/page/log_page.dart +++ b/pkg/analysis_server/tool/instrumentation/page/log_page.dart @@ -262,7 +262,7 @@ function selectEntryGroup(pageStart) { sink.write('<'); sink.writeln(''); } - // TODO(brianwilkerson) Add a text field for selecting the start index. + // TODO(brianwilkerson): Add a text field for selecting the start index. if (pageEnd == length) { sink.writeln(''); } else { diff --git a/pkg/analysis_server/tool/instrumentation/page/stats_page.dart b/pkg/analysis_server/tool/instrumentation/page/stats_page.dart index b3e2450365b..f4c8190130e 100644 --- a/pkg/analysis_server/tool/instrumentation/page/stats_page.dart +++ b/pkg/analysis_server/tool/instrumentation/page/stats_page.dart @@ -192,7 +192,7 @@ class StatsPage extends PageWriter { var methodNames = latencyData.keys.toList()..sort(); for (var method in methodNames) { var latencies = latencyData[method]!..sort(); - // TODO(brianwilkerson) Add a spark-line distribution graph. + // TODO(brianwilkerson): Add a spark-line distribution graph. sink.write(''); sink.write(latencies[0]); sink.write(''); @@ -226,7 +226,7 @@ class StatsPage extends PageWriter { var methodNames = responseData.keys.toList()..sort(); for (var method in methodNames) { var responseTimes = responseData[method]!..sort(); - // TODO(brianwilkerson) Add a spark-line distribution graph. + // TODO(brianwilkerson): Add a spark-line distribution graph. sink.write(''); sink.write(responseTimes[0]); sink.write(''); diff --git a/pkg/analysis_server/tool/spec/codegen_java_types.dart b/pkg/analysis_server/tool/spec/codegen_java_types.dart index ec449fdbe95..7f741fdb2bd 100644 --- a/pkg/analysis_server/tool/spec/codegen_java_types.dart +++ b/pkg/analysis_server/tool/spec/codegen_java_types.dart @@ -142,7 +142,7 @@ class CodegenJavaType extends CodegenJavaVisitor { } else if (name.startsWith('List')) { return 'getAsJsonArray'; } else { - // TODO (jwren) cleanup + // TODO(jwren): cleanup return 'getAsJsonArray'; } } diff --git a/pkg/analysis_server/tool/spec/codegen_matchers.dart b/pkg/analysis_server/tool/spec/codegen_matchers.dart index 4707e493003..90433c5c3c8 100644 --- a/pkg/analysis_server/tool/spec/codegen_matchers.dart +++ b/pkg/analysis_server/tool/spec/codegen_matchers.dart @@ -98,6 +98,8 @@ class CodegenMatchersVisitor extends HierarchicalApiVisitor with CodeGenerator { writeln(); writeln("import 'integration_tests.dart';"); writeln(); + writeln('// ignore_for_file: flutter_style_todos'); + writeln(); var impliedTypes = computeImpliedTypes(api).values.toList(); impliedTypes.sort((ImpliedType first, ImpliedType second) => first.camelName.compareTo(second.camelName)); diff --git a/pkg/analysis_server/tool/spec/to_html.dart b/pkg/analysis_server/tool/spec/to_html.dart index 073b1dd1a80..9eb9d1e01f9 100644 --- a/pkg/analysis_server/tool/spec/to_html.dart +++ b/pkg/analysis_server/tool/spec/to_html.dart @@ -300,7 +300,7 @@ class ToHtmlVisitor extends HierarchicalApiVisitor link('refactorings', () => write('\u2191')); write(')'); }); - // TODO: Individual refactorings are not yet hyperlinked. + // TODO(paulberry): Individual refactorings are not yet hyperlinked. element('div', {'class': 'subindex'}, () { element('ul', {}, () { for (var refactoring in refactorings) {