From 88fdbea483f6a8b33e570a11e60e38f7176ae522 Mon Sep 17 00:00:00 2001 From: Jacob MacDonald Date: Tue, 9 Feb 2021 18:42:42 +0000 Subject: [PATCH] Update to the latest markdown, an internal Cl has been prepared and paired with this so the sdk roll can succeed. TEST=Fixes static errors Change-Id: Ia4e325936ea81d0d51fbf6dd939b732860d22100 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183760 Commit-Queue: Jake Macdonald Reviewed-by: Ben Konyi Reviewed-by: Nate Bosch --- .dart_tool/package_config.json | 4 ++-- DEPS | 2 +- pkg/vm_service/tool/common/generate_common.dart | 5 +---- pkg/vm_service/tool/common/src_gen_common.dart | 7 ++----- pkg/vm_service/tool/dart/generate_dart.dart | 5 +---- pkg/vm_service/tool/generate.dart | 3 --- pkg/vm_service/tool/java/generate_java.dart | 7 ++----- 7 files changed, 9 insertions(+), 24 deletions(-) diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json index aa12340f6bc..29268f2b376 100644 --- a/.dart_tool/package_config.json +++ b/.dart_tool/package_config.json @@ -404,7 +404,7 @@ "name": "markdown", "rootUri": "../third_party/pkg/markdown", "packageUri": "lib/", - "languageVersion": "2.6" + "languageVersion": "2.12" }, { "name": "matcher", @@ -782,4 +782,4 @@ "languageVersion": "2.12" } ] -} \ No newline at end of file +} diff --git a/DEPS b/DEPS index 397cf388be8..511fb43565e 100644 --- a/DEPS +++ b/DEPS @@ -121,7 +121,7 @@ vars = { "linter_tag": "0.1.129", "logging_rev": "e2f633b543ef89c54688554b15ca3d7e425b86a2", "markupsafe_rev": "8f45f5cfa0009d2a70589bcda0349b8cb2b72783", - "markdown_rev": "6f89681d59541ddb1cf3a58efbdaa2304ffc3f51", + "markdown_rev": "9c4beaac96d8f008078e00b027915f81b665d2de", "matcher_rev": "43d5cac48fcd386643016e767164da87c5c25e29", "mime_rev": "c931f4bed87221beaece356494b43731445ce7b8", "mockito_rev": "d39ac507483b9891165e422ec98d9fb480037c8b", diff --git a/pkg/vm_service/tool/common/generate_common.dart b/pkg/vm_service/tool/common/generate_common.dart index d91e730bdf0..345ea7df08a 100644 --- a/pkg/vm_service/tool/common/generate_common.dart +++ b/pkg/vm_service/tool/common/generate_common.dart @@ -4,9 +4,6 @@ library generate_vm_service_common; -// TODO(bkonyi): remove once markdown and pub_semver deps are updated to null -// safety for the SDK. -// ignore_for_file: import_of_legacy_library_into_null_safe import 'package:markdown/markdown.dart'; import 'package:pub_semver/pub_semver.dart'; @@ -23,7 +20,7 @@ class ApiParseUtil { // Extract version from header: `# Dart VM Service Protocol 2.0`. Element node = nodes.firstWhere((n) => isH1(n)) as Element; - Text text = node.children[0] as Text; + Text text = node.children![0] as Text; Match? match = regex.firstMatch(text.text); if (match == null) throw 'Unable to locate service protocol version'; diff --git a/pkg/vm_service/tool/common/src_gen_common.dart b/pkg/vm_service/tool/common/src_gen_common.dart index 4fd8313153a..1962c61b0e7 100644 --- a/pkg/vm_service/tool/common/src_gen_common.dart +++ b/pkg/vm_service/tool/common/src_gen_common.dart @@ -4,9 +4,6 @@ library src_gen_common; -// TODO(bkonyi): remove once markdown and pub_semver deps are updated to null -// safety for the SDK. -// ignore_for_file: import_of_legacy_library_into_null_safe import 'package:markdown/markdown.dart'; const int RUNE_SPACE = 32; @@ -27,9 +24,9 @@ bool isH1(Node node) => node is Element && node.tag == 'h1'; bool isH3(Node node) => node is Element && node.tag == 'h3'; bool isHeader(Node node) => node is Element && node.tag.startsWith('h'); String textForElement(Node node) => - (((node as Element).children.first) as Text).text; + (((node as Element).children!.first) as Text).text; String textForCode(Node node) => - textForElement((node as Element).children.first); + textForElement((node as Element).children!.first); /// foo ==> Foo String titleCase(String str) => diff --git a/pkg/vm_service/tool/dart/generate_dart.dart b/pkg/vm_service/tool/dart/generate_dart.dart index 3f4f20c4cbb..f512f5a8348 100644 --- a/pkg/vm_service/tool/dart/generate_dart.dart +++ b/pkg/vm_service/tool/dart/generate_dart.dart @@ -4,9 +4,6 @@ library generate_vm_service_dart; -// TODO(bkonyi): remove once markdown and pub_semver deps are updated to null -// safety for the SDK. -// ignore_for_file: import_of_legacy_library_into_null_safe import 'package:markdown/markdown.dart'; import '../common/generate_common.dart'; @@ -497,7 +494,7 @@ class Api extends Member with ApiParseUtil { return n.text; } else if (n is Element) { if (n.tag != 'h3') return n.tag; - return '${n.tag}:[${n.children.map((c) => printNode(c)).join(', ')}]'; + return '${n.tag}:[${n.children!.map((c) => printNode(c)).join(', ')}]'; } else { return '${n}'; } diff --git a/pkg/vm_service/tool/generate.dart b/pkg/vm_service/tool/generate.dart index bea71f8006a..321b125dc40 100644 --- a/pkg/vm_service/tool/generate.dart +++ b/pkg/vm_service/tool/generate.dart @@ -4,9 +4,6 @@ import 'dart:io'; -// TODO(bkonyi): remove once markdown and pub_semver deps are updated to null -// safety for the SDK. -// ignore_for_file: import_of_legacy_library_into_null_safe import 'package:markdown/markdown.dart'; import 'package:path/path.dart'; import 'package:pub_semver/pub_semver.dart'; diff --git a/pkg/vm_service/tool/java/generate_java.dart b/pkg/vm_service/tool/java/generate_java.dart index 3a3567a9630..e70b0a02ea9 100644 --- a/pkg/vm_service/tool/java/generate_java.dart +++ b/pkg/vm_service/tool/java/generate_java.dart @@ -4,9 +4,6 @@ library generate_vm_service_java; -// TODO(bkonyi): remove once markdown and pub_semver deps are updated to null -// safety for the SDK. -// ignore_for_file: import_of_legacy_library_into_null_safe import 'package:markdown/markdown.dart'; import 'package:pub_semver/pub_semver.dart'; @@ -280,7 +277,7 @@ class Api extends Member with ApiParseUtil { } else if (isHeader(node)) { h3Name = null; } else if (isPara(node)) { - var children = (node as Element).children; + var children = (node as Element).children!; if (children.isNotEmpty && children.first is Text) { var text = children.expand((child) { if (child is Text) return [child.text]; @@ -356,7 +353,7 @@ class Api extends Member with ApiParseUtil { return n.text; } else if (n is Element) { if (n.tag != 'h3') return n.tag; - return '${n.tag}:[${n.children.map((c) => printNode(c)).join(', ')}]'; + return '${n.tag}:[${n.children!.map((c) => printNode(c)).join(', ')}]'; } else { return '${n}'; }