Version 2.18.0-165.1.beta

Merge '2.18.0-165.0.dev' into beta
diff --git a/.github/ISSUE_TEMPLATE/1_cherry_pick.yml b/.github/ISSUE_TEMPLATE/1_cherry_pick.yml
new file mode 100644
index 0000000..a1c9afd
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/1_cherry_pick.yml
@@ -0,0 +1,69 @@
+name: Request a cherry-pick.
+description: You would like to request that a feature be cherry-picked into a release.
+title: '[CP] <title>'
+labels: ['cherry-pick-review']
+assignees:
+  - mit-mit
+  - whesse
+  - athomas
+  - vsmenon
+  - itsjustkevin
+body:
+  - type: input
+    id: commit_hash
+    attributes:
+      label: Commit(s) to merge
+      description: What are the shortened commit hash(es) that have been merged to main?
+    validations:
+      required: true
+  - type: input
+    id: target
+    attributes:
+      label: Target
+      description: Should this be cherry-picked to beta, stable or both??
+    validations:
+      required: true
+  - type: textarea
+    id: issue_description
+    attributes:
+      label: Issue Description
+      description: Brief description of the issue.  What is the issue? What platforms are the problems occuring on?
+    validations:
+      required: true
+  - type: textarea
+    id: fix
+    attributes:
+      label: What is the fix
+      description: Brief description of the fix.
+    validations:
+      required: true
+  - type: textarea
+    id: why
+    attributes:
+      label: Why cherry-pick
+      description: Describe the reasons, impacted users and functional issues to explain why this should be cherry-picked.
+    validations:
+      required: true
+  - type: dropdown
+    id: risk
+    attributes:
+      label: Risk
+      description: What is the risk level of this cherry-pick?
+      options:
+        - low
+        - medium
+        - high
+    validations:
+      required: true
+  - type: input
+    id: original_issue
+    attributes:
+      label: Issue link(s)
+      description: Add links to the original issues fixed by this cp
+    validations:
+      required: true
+  - type: textarea
+    id: extra_info
+    attributes:
+      label: Extra Info
+      description: Is there anything else we need to know about this cherry-pick?
diff --git a/.github/move.yml b/.github/move.yml
deleted file mode 100644
index bf0cceb..0000000
--- a/.github/move.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-# Configuration for move-issues - https://github.com/dessant/move-issues
-
-# Delete the command comment when it contains no other content
-deleteCommand: true
-
-# Close the source issue after moving
-closeSourceIssue: true
-
-# Lock the source issue after moving
-lockSourceIssue: false
-
-# Mention issue and comment authors
-mentionAuthors: true
-
-# Preserve mentions in the issue content
-keepContentMentions: true
-
-# Set custom aliases for targets
-aliases:
-  flutter: flutter/flutter
-  flutter-intellij: flutter/flutter-intellij
diff --git a/.github/no-response.yml b/.github/no-response.yml
deleted file mode 100644
index 81cec3e..0000000
--- a/.github/no-response.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-# Configuration for probot-no-response - https://github.com/probot/no-response
-
-# Number of days of inactivity before an issue is closed for lack of response.
-daysUntilClose: 21
-
-# Label requiring a response.
-responseRequiredLabel: "needs-info"
-
-# Comment to post when closing an Issue for lack of response.
-closeComment: >-
-  Without additional information, we are unfortunately not sure how to
-  resolve this issue. We are therefore reluctantly going to close this
-  bug for now. Please don't hesitate to comment on the bug if you have
-  any more information for us; we will reopen it right away!
-
-  Thanks for your contribution.
diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
new file mode 100644
index 0000000..b61b6ad
--- /dev/null
+++ b/.github/workflows/scorecards-analysis.yml
@@ -0,0 +1,54 @@
+name: Scorecards supply-chain security
+on:
+  # Only the default branch is supported.
+  branch_protection_rule:
+  schedule:
+    # “At 00:00 (UTC) daily.”
+    - cron: '0 0 * * *'
+
+# Declare default permissions as read only.
+permissions: read-all
+
+jobs:
+  analysis:
+    name: Scorecards analysis
+    runs-on: ubuntu-latest
+    permissions:
+      # Needed to upload the results to code-scanning dashboard.
+      security-events: write
+      actions: read
+      contents: read
+
+    steps:
+      - name: "Checkout code"
+        uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0
+        with:
+          persist-credentials: false
+
+      - name: "Run analysis"
+        uses: ossf/scorecard-action@c1aec4ac820532bab364f02a81873c555a0ba3a1 # v1.0.4
+        with:
+          results_file: results.sarif
+          results_format: sarif
+          # Read-only PAT token. To create it,
+          # follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation.
+          repo_token: ${{ secrets.SCORECARD_READ_TOKEN }}
+          # Publish the results to enable scorecard badges. For more details, see
+          # https://github.com/ossf/scorecard-action#publishing-results.
+          # For private repositories, `publish_results` will automatically be set to `false`,
+          # regardless of the value entered here.
+          publish_results: true
+
+      # Upload the results as artifacts (optional).
+      - name: "Upload artifact"
+        uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
+        with:
+          name: SARIF file
+          path: results.sarif
+          retention-days: 5
+
+      # Upload the results to GitHub's code scanning dashboard.
+      - name: "Upload to code-scanning"
+        uses: github/codeql-action/upload-sarif@5f532563584d71fdef14ee64d17bafb34f751ce5 # v1.0.26
+        with:
+          sarif_file: results.sarif
diff --git a/BUILD.gn b/BUILD.gn
index 4b587be..aad296d 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -103,6 +103,15 @@
   deps = [ "utils/compiler:dart2js" ]
 }
 
+group("dart2wasm") {
+  deps = [
+    ":runtime_precompiled",
+    "utils/dart2wasm:compile_dart2wasm_platform",
+    "utils/dart2wasm:dart2wasm_asserts_snapshot",
+    "utils/dart2wasm:dart2wasm_snapshot",
+  ]
+}
+
 group("dartanalyzer") {
   deps = [ "utils/dartanalyzer" ]
 }
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b283927..3b2dffa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,52 @@
 ## 2.18.0
 
+### Language
+
+The following features are new in the Dart 2.18 [language version][]. To use
+them, you must set the lower bound on the SDK constraint for your package to
+2.18 or greater (`sdk: '>=2.18.0 <3.0.0'`).
+
+[language version]: https://dart.dev/guides/language/evolution
+
+-  **[Enhanced type inference for generic invocations with function
+   literals][]**: Invocations of generic methods/constructors that supply
+   function literal arguments now have improved type inference.  This primarily
+   affects the `Iterable.fold` method.  For example, in previous versions of
+   Dart, the compiler would fail to infer an appropriate type for the parameter
+   `a`:
+
+   ```dart
+   void main() {
+     List<int> ints = [1, 2, 3];
+     var maximum = ints.fold(0, (a, b) => a < b ? b : a);
+   }
+   ```
+
+   With this improvement, `a` receives its type from the initial value, `0`.
+
+   On rare occasions, the wrong type will be inferred, leading to a compile-time
+   error, for example in this code, type inference will infer that `a` has a
+   type of `Null`:
+
+   ```dart
+   void main() {
+     List<int> ints = [1, 2, 3];
+     var maximumOrNull = ints.fold(null,
+         (a, b) => a == null || a < b ? b : a);
+   }
+   ```
+
+   This can be worked around by supplying the appropriate type as an explicit
+   type argument to `fold`:
+
+   ```dart
+   void main() {
+     List<int> ints = [1, 2, 3];
+     var maximumOrNull = ints.fold<int?>(null,
+         (a, b) => a == null || a < b ? b : a);
+   }
+   ```
+
 ### Core libraries
 
 #### `dart:html`
@@ -7,7 +54,251 @@
 - Add `connectionState` attribute and `connectionstatechange` listener to
   `RtcPeerConnection`.
 
-## 2.17.0
+#### `dart:io`
+
+- **Breaking Change** [#45630][]: The Dart VM no longer automatically restores
+    the initial terminal settings upon exit. Programs that change the `Stdin`
+    settings `lineMode` and `echoMode` are now responsible for restoring the
+    settings upon program exit. E.g. a program disabling `echoMode` will now
+    need to restore the setting itself and handle exiting by the appropriate
+    signals if desired:
+
+    ```dart
+    import 'dart:io';
+    import 'dart:async';
+
+    main() {
+      bool echoWasEnabled = stdin.echoMode;
+      try {
+        late StreamSubscription subscription;
+        subscription = ProcessSignal.sigint.watch().listen((ProcessSignal signal) {
+          stdin.echoMode = echoWasEnabled;
+          subscription.cancel();
+          Process.killPid(pid, signal); /* Die by the signal. */
+        });
+        stdin.echoMode = false;
+      } finally {
+        stdin.echoMode = echoWasEnabled;
+      }
+    }
+    ```
+
+    This change is needed to fix [#36453][] where the dart programs not caring
+    about the terminal settings can inadverently corrupt the terminal settings
+    when e.g. piping into less.
+
+    Furthermore the `echoMode` setting now only controls the `echo` local mode
+    and no longer sets the `echonl` local mode on POSIX systems (which controls
+    whether newline are echoed even if the regular echo mode is disabled). The
+    `echonl` local mode is usually turned off in common shell environments.
+    Programs that wish to control the `echonl` local mode can use the new
+    `echoNewlineMode` setting.
+
+    The Windows console code pages (if not UTF-8) and ANSI escape code support
+    (if disabled) remain restored when the VM exits.
+
+[#45630]: https://github.com/dart-lang/sdk/issues/45630
+[#36453]: https://github.com/dart-lang/sdk/issues/36453
+
+#### `dart:js_util`
+
+- Added `dartify` and a number of minor helper functions.
+
+### Tools
+
+#### Linter
+
+Updated the Linter to `1.24.0`, which includes changes that
+
+- fixes `prefer_final_parameters` to support super parameters.
+- adds new lint: `unnecessary_to_list_in_spreads`.
+- fixes `unawaited_futures` to handle string interpolated
+  futures.
+- updates `use_colored_box` to not flag nullable colors,
+- adds new lint: 
+  `unnecessary_null_aware_operator_on_extension_on_nullable`.
+- fixes `no_leading_underscores_for_local_identifiers`
+  to lint local function declarations.
+- fixes `avoid_init_to_null` to correctly handle super
+  initializing defaults that are non-null.
+- updates `no_leading_underscores_for_local_identifiers`
+  to allow identifiers with just underscores.
+- fixes `flutter_style_todos` to support usernames that
+  start with a digit.
+- updates `require_trailing_commas` to handle functions
+  in asserts and multi-line strings.
+- updates `unsafe_html` to allow assignments to
+  `img.src`.
+- fixes `unnecessary_null_checks` to properly handle map
+  literal entries.
+
+#### Pub
+
+* Breaking: `dart pub get` and `dart pub upgrade` no longer creates the
+  [deprecated](https://github.com/dart-lang/sdk/issues/47431) `.packages` file.
+  It can still be created with the `--legacy-packages-file` flag.
+* `dart pub outdated` now shows which of your dependencies are discontinued.
+
+## 2.17.3 - 2022-06-01
+
+This is a patch release that fixes:
+
+- a Dart VM compiler crash (issue [#100375][]).
+- code completion when writing method overrides (issue [#49027][]).
+- the `dart pub login` command (issue [#3424][]).
+- analysis of enhanced enums (issue [#49097][]).
+
+[#100375]: https://github.com/flutter/flutter/issues/100375
+[#49027]: https://github.com/dart-lang/sdk/issues/49027
+[#3424]: https://github.com/dart-lang/pub/issues/3424
+[#49097]: https://github.com/dart-lang/sdk/issues/49097
+
+## 2.17.1 - 2022-05-18
+
+This is a patch release that fixes:
+
+- an analyzer plugin crash (issue [#48682][]).
+- Dart FFI support for `late` `Finalizable` variables (issue [#49024]).
+- `dart compile` on macOS 10.15 (issue [#49010][]).
+
+[#48682]: https://github.com/dart-lang/sdk/issues/48682
+[#49024]: https://github.com/dart-lang/sdk/issues/49024
+[#49010]: https://github.com/dart-lang/sdk/issues/49010
+
+## 2.17.0 - 2022-05-11
+
+### Language
+
+The following features are new in the Dart 2.17 [language version][]. To use
+them, you must set the lower bound on the SDK constraint for your package to
+2.17 or greater (`sdk: '>=2.17.0 <3.0.0'`).
+
+[language version]: https://dart.dev/guides/language/evolution
+
+-   **[Enhanced enums with members][]**: Enum declarations can now define
+    members including fields, constructors, methods, getters, etc. For example:
+
+    ```dart
+    enum Water {
+      frozen(32),
+      lukewarm(100),
+      boiling(212);
+
+      final int tempInFahrenheit;
+      const Water(this.tempInFahrenheit);
+
+      @override
+      String toString() => "The $name water is $tempInFahrenheit F.";
+    }
+    ```
+
+    Constructors must be `const` since enum values are always constants. If the
+    constructor takes arguments, they are passed when the enum value is
+    declared.
+
+    The above enum can be used like so:
+
+    ```dart
+    void main() {
+      print(Water.frozen); // prints "The frozen water is 32 F."
+    }
+    ```
+
+[enhanced enums with members]: https://github.com/dart-lang/language/blob/master/accepted/future-releases/enhanced-enums/feature-specification.md
+
+-   **[Super parameters][]**: When extending a class whose constructor takes
+    parameters, the subclass constructor needs to provide arguments for them.
+    Often, these are passed as parameters to the subclass constructor, which
+    then forwards them to the superclass constructor. This is verbose because
+    the subclass constructor must list the name and type of each parameter in
+    its parameter list, and then explicitly forward each one as an argument to
+    the superclass constructor.
+
+    [@roy-sianez][] suggested [allowing `super.`][super dot] before a subclass
+    constructor parameter to implicitly forward it to the corresponding
+    superclass constructor parameter. Applying this feature to Flutter
+    eliminated [nearly 2,000 lines of code][flutter super]. For example, before:
+
+    ```dart
+    class CupertinoPage<T> extends Page<T> {
+      const CupertinoPage({
+        required this.child,
+        this.maintainState = true,
+        this.title,
+        this.fullscreenDialog = false,
+        LocalKey? key,
+        String? name,
+        Object? arguments,
+        String? restorationId,
+      }) : super(
+            key: key,
+            name: name,
+            arguments: arguments,
+            restorationId: restorationId,
+          );
+
+      // ...
+    }
+    ```
+
+    And using super parameters:
+
+    ```dart
+    class CupertinoPage<T> extends Page<T> {
+      const CupertinoPage({
+        required this.child,
+        this.maintainState = true,
+        this.title,
+        this.fullscreenDialog = false,
+        super.key,
+        super.name,
+        super.arguments,
+        super.restorationId,
+      });
+
+      // ...
+    }
+    ```
+
+    From our analysis, over 90% of explicit superclass constructor calls can be
+    completely eliminated, using `super.` parameters instead.
+
+[super parameters]: https://github.com/dart-lang/language/blob/master/working/1855%20-%20super%20parameters/proposal.md
+[@roy-sianez]: https://github.com/roy-sianez
+[super dot]: https://github.com/dart-lang/language/issues/1855
+[flutter super]: https://github.com/flutter/flutter/pull/100905/files
+
+-   **[Named args everywhere][]**: In a function call, Dart requires positional
+    arguments to appear before named arguments. This can be frustrating for
+    arguments like collection literals and function expressions that look best
+    as the last argument in the argument list but are positional, like the
+    `test()` function in the [test package][]:
+
+    ```dart
+    main() {
+      test('A test description', () {
+        // Very long function body here...
+      }, skip: true);
+    }
+    ```
+
+    It would be better if the `skip` argument appeared at the top of the call
+    to `test()` so that it wasn't easily overlooked, but since it's named and
+    the test body argument is positional, `skip` must be placed at the end.
+
+    Dart 2.17 removes this restriction. Named arguments can be freely
+    interleaved with positional arguments, allowing code like:
+
+    ```dart
+    main() {
+      test(skip: true, 'A test description', () {
+        // Very long function body here...
+      });
+    }
+    ```
+
+[named args everywhere]: https://github.com/dart-lang/language/blob/master/accepted/future-releases/named-arguments-anywhere/feature-specification.md
+[test package]: https://pub.dev/packages/test
 
 ### Language
 
@@ -276,7 +567,7 @@
 
 Updated the Linter to `1.22.0`, which includes changes that
 
-- fixes null-safe variance exceptions in `invariant_booleans`
+- fixes null-safe variance exceptions in `invariant_booleans`.
 - updates `depend_on_referenced_packages` to treat `flutter_gen` as a virtual
   package, not needing an explicit dependency.
 - updates `unnecessary_null_checks` and
diff --git a/DEPS b/DEPS
index f2884cf..b6c119a 100644
--- a/DEPS
+++ b/DEPS
@@ -39,27 +39,26 @@
 
   # Checked-in SDK version. The checked-in SDK is a Dart SDK distribution in a
   # cipd package used to run Dart scripts in the build and test infrastructure.
-  "sdk_tag": "version:2.17.0-266.1.beta",
+  "sdk_tag": "version:2.17.0",
 
   # co19 is a cipd package. Use update.sh in tests/co19[_2] to update these
-  # hashes. It requires access to the dart-build-access group, which EngProd
-  # has.
-  "co19_rev": "8f22acf210970dfe32750351031281af88b41708",
+  # hashes.
+  "co19_rev": "9849573cd1b8317e58247b8c1672e89b1cd842e2",
   # This line prevents conflicts when both packages are rolled simultaneously.
   "co19_2_rev": "b2034a17609472e374623f3dbe0efd9f5cb258af",
 
   # The internal benchmarks to use. See go/dart-benchmarks-internal
-  "benchmarks_internal_rev": "076df10d9b77af337f2d8029725787155eb1cd52",
+  "benchmarks_internal_rev": "599aa474a03c37be146f82dfbad85f34f25ffa47",
   "checkout_benchmarks_internal": False,
 
   # Checkout Android dependencies only on Mac and Linux.
   "download_android_deps":
-    "(host_os == mac or host_os == linux) and host_cpu == x64",
+    "host_os == mac or (host_os == linux and host_cpu == x64)",
 
   # Checkout extra javascript engines for testing or benchmarking.
   # d8, the V8 shell, is always checked out.
   "checkout_javascript_engines": False,
-  "d8_tag": "version:10.0.40",
+  "d8_tag": "version:10.4.31",
   "jsshell_tag": "version:95.0",
 
   # As Flutter does, we use Fuchsia's GN and Clang toolchain. These revision
@@ -76,22 +75,22 @@
   "gperftools_revision": "180bfa10d7cb38e8b3784d60943d50e8fcef0dcb",
 
   # Revisions of /third_party/* dependencies.
-  "args_rev": "3b3f55766af13d895d2020ec001a28e8dc147f91",
-  "async_rev": "3f58c326bd4928fca9ddc10c72b19cb7ac659256",
+  "args_rev": "862d929b980b993334974d38485a39d891d83918",
+  "async_rev": "f3ed5f690e2ec9dbe1bfc5184705575b4f6480e5",
   "bazel_worker_rev": "ceeba0982d4ff40d32371c9d35f3d2dc1868de20",
-  "benchmark_harness_rev": "c546dbd9f639f75cd2f75de8df2eb9f8ea15e8e7",
-  "boolean_selector_rev": "437e7f06c7e416bed91e16ae1df453555897e945",
+  "benchmark_harness_rev": "0530da692a5d689f4b5450a7c8d1a8abe3e2d555",
+  "boolean_selector_rev": "1d3565e2651d16566bb556955b96ea75018cbd0c",
   "boringssl_gen_rev": "ced85ef0a00bbca77ce5a91261a5f2ae61b1e62f",
   "boringssl_rev": "87f316d7748268eb56f2dc147bd593254ae93198",
   "browser-compat-data_tag": "ac8cae697014da1ff7124fba33b0b4245cc6cd1b", # v1.0.22
-  "browser_launcher_rev": "c6cc1025d6901926cf022e144ba109677e3548f1",
-  "characters_rev": "6ec389c4dfa8fce14820dc5cbf6e693202e7e052",
+  "browser_launcher_rev": "f841375ad337381e23d333b6eaaebde3d8266c68",
+  "characters_rev": "4b1d4b7737ad47cd2b8105c47e2159174010f29f",
   "charcode_rev": "84ea427711e24abf3b832923959caa7dd9a8514b",
   "chrome_rev": "19997",
   "cli_util_rev": "b0adbba89442b2ea6fef39c7a82fe79cb31e1168",
-  "clock_rev": "5631a0612f4ac7e1b32f7c9a00fc7c00a41615e1",
+  "clock_rev": "f594d86da123015186d5680b0d0e8255c52fc162",
   "collection_rev": "e1407da23b9f17400b3a905aafe2b8fa10db3d86",
-  "convert_rev": "e063fdca4bebffecbb5e6aa5525995120982d9ce",
+  "convert_rev": "00b251529c074df394b3391c7e3eea3dd9e5778e",
   "crypto_rev": "4297d240b0e1e780ec0a9eab23eaf1ad491f3e68",
   "csslib_rev": "518761b166974537f334dbf264e7f56cb157a96a",
 
@@ -107,73 +106,65 @@
   # For more details, see https://github.com/dart-lang/sdk/issues/30164.
   "dart_style_rev": "d7b73536a8079331c888b7da539b80e6825270ea",
 
-  "dartdoc_rev": "334072b0cad436c05f6bcecf8a1a59f2f0809b84",
-  "devtools_rev": "8c525828ba33029ed664bf8ea2829b6e5370535f",
-  "ffi_rev": "4dd32429880a57b64edaf54c9d5af8a9fa9a4ffb",
-  "file_rev": "1ebc38852ffed24b564910317982298b56c2cedd",
-  "fixnum_rev": "848341f061359ef7ddc0cad472c2ecbb036b28ac",
-  "glob_rev": "da1f4595ee2f87982cbcc663d4cac244822d9227",
+  "dartdoc_rev": "8549817bb1b59808108e83ef0e513157cb572d2a",
+  "devtools_rev": "51ac983d2db7eb19b3ce5956cb70b769d74fe784",
+  "ffi_rev": "0c8364a728cfe4e4ba859c53b99d56b3dbe3add4",
+  "file_rev": "0132eeedea2933513bf230513a766a8baeab0c4f",
+  "fixnum_rev": "3bfc2ed1eea7e7acb79ad4f17392f92c816fc5ce",
+  "glob_rev": "e10eb2407c58427144004458ef85c9bbf7286e56",
   "html_rev": "f108bce59d136c584969fd24a5006914796cf213",
-  "http_io_rev": "2fa188caf7937e313026557713f7feffedd4978b",
-  "http_multi_server_rev": "34bf7f04b61cce561f47f7f275c2cc811534a05a",
-  "http_parser_rev": "202391286ddc13c4c3c284ac5b511f04697250ed",
-  "http_rev": "2c9b418f5086f999c150d18172d2eec1f963de7b",
+  "http_multi_server_rev": "35a3b947256768426090e3b1f5132e4fc23c175d",
+  "http_parser_rev": "9126ee04e77fd8e4e2e6435b503ee4dd708d7ddc",
+  "http_rev": "2993ea5dff5ffb066b4a35c707e7a2b8dcfa17c2",
   "icu_rev": "81d656878ec611cb0b42d52c82e9dae93920d9ba",
-  "intl_rev": "9669926609e7efc17dfd74fbb44ec719a7e573cc",
+  "intl_rev": "9145f308f1458f37630a1ffce3b7d3b471ebbc56",
   "jinja2_rev": "2222b31554f03e62600cd7e383376a7c187967a1",
-  "json_rpc_2_rev": "7e00f893440a72de0637970325e4ea44bd1e8c8e",
-  "linter_rev": "14c916a16e78315e212cf79e7ccf4c19159a1bda",
+  "json_rpc_2_rev": "2de9a1f9821807fa2c85fd48e2f70b9cbcddcb67",
+  "linter_rev": "a8529c6692922b45bc287543b355c90d7b1286d3", # 1.24.0
   "lints_rev": "8294e5648ab49474541527e2911e72e4c5aefe55",
-  "logging_rev": "dfbe88b890c3b4f7bc06da5a7b3b43e9e263b688",
-  "markdown_rev": "7479783f0493f6717e1d7ae31cb37d39a91026b2",
+  "logging_rev": "f6979e3bc3b6e1847a08335b7eb6304e18986195",
+  "markdown_rev": "5699cafa9ef004875fd7de8ae9ea00e5295e87a4", # 5.0.0
   "markupsafe_rev": "8f45f5cfa0009d2a70589bcda0349b8cb2b72783",
-  "matcher_rev": "07595a7739d47a8315caba5a8e58fb9ae3d81261",
+  "matcher_rev": "12cdc5fbafd666ed908359ae215d5d0306087969",
   "mime_rev": "c2c5ffd594674f32dc277521369da1557a1622d3",
   "mockito_rev": "1e977a727e82a2e1bdb49b79ef1dce0f23aa1faa",
-  "oauth2_rev": "7cd3284049fe5badbec9f2bea2afc41d14c01057",
-  "package_config_rev": "8731bf10b5375542792a32a0f7c8a6f370583d96",
-  "path_rev": "baedce9d2ca11ea2cdf54395a74eb038087777a4",
-  "pedantic_rev": "66f2f6c27581c7936482e83be80b27be2719901c",
-  "platform_rev": "1ffad63428bbd1b3ecaa15926bacfb724023648c",
+  "oauth2_rev": "199ebf15cbd5b07958438184f32e41c4447a57bf",
+  "package_config_rev": "cff98c90acc457a3b0750f0a7da0e351a35e5d0c",
+  "path_rev": "3d41ea582f5b0b18de3d90008809b877ff3f69bc",
   "ply_rev": "604b32590ffad5cbb82e4afef1d305512d06ae93",
-  "pool_rev": "7abe634002a1ba8a0928eded086062f1307ccfae",
-  "process_rev": "56ece43b53b64c63ae51ec184b76bd5360c28d0b",
-  "protobuf_rev": "c1eb6cb51af39ccbaa1a8e19349546586a5c8e31",
-  "pub_rev": "a949b329b1b51f5f3973a790e0a0a45897d837de",
+  "pool_rev": "c40cc32eabecb9d60f1045d1403108d968805f9a",
+  "protobuf_rev": "b149f801cf7a5e959cf1dbf72d61068ac275f24b",
+  "pub_rev": "51435efcd574b7bc18d47a5dd620cb9759dea8f8",
   "pub_semver_rev": "ea6c54019948dc03042c595ce9413e17aaf7aa38",
   "root_certificates_rev": "692f6d6488af68e0121317a9c2c9eb393eb0ee50",
   "rust_revision": "b7856f695d65a8ebc846754f97d15814bcb1c244",
-  "shelf_packages_handler_rev": "78302e67c035047e6348e692b0c1182131f0fe35",
-  "shelf_proxy_rev": "124615d0614b38814970aa9638725d9d6b435268",
-  "shelf_rev": "78ac724a7944700340a3cef28c84bccbe62e9367",
-  "shelf_static_rev": "202ec1a53c9a830c17cf3b718d089cf7eba568ad",
-  "shelf_web_socket_rev": "24fb8a04befa75a94ac63a27047b231d1a22aab4",
+  "shelf_rev": "05f42601d22c9bfe490ceda50e812f83b7d1de77",
   "source_map_stack_trace_rev": "8eabd96b1811e30a11d3c54c9b4afae4fb72e98f",
   "source_maps_rev": "c07a01b8d5547ce3a47ee7a7a2b938a2bc09afe3",
   "source_span_rev": "8ae724c3e67f5afaacead44e93ff145bfb8775c7",
   "sse_rev": "9a54f1cdd91c8d79a6bf5ef8e849a12756607453",
   "stack_trace_rev": "5220580872625ddee41e9ca9a5f3364789b2f0f6",
   "stream_channel_rev": "3fa3e40c75c210d617b8b943b9b8f580e9866a89",
-  "string_scanner_rev": "0e53bf9059e8e22a3b346aac7ec755a0f8314eb6",
-  "sync_http_rev": "b59c134f2e34d12acac110d4f17f83e5a7db4330",
-  "term_glyph_rev": "4885b7f8af6931e23d3aa6d1767ee3f9a626923d",
+  "string_scanner_rev": "6579871b528036767b3200b390a3ecef28e4900d",
+  "sync_http_rev": "b6bd47965694dddffb6e62fb8a6c12d17c4ae4cd",
+  "term_glyph_rev": "d0f205c67ea70eea47b9f41c8440129a72a9c86e",
   "test_descriptor_rev": "ead23c1e7df079ac0f6457a35f7a71432892e527",
-  "test_process_rev": "7c73ec8a8a6e0e63d0ec27d70c21ca4323fb5e8f",
-  "test_reflective_loader_rev": "fcfce37666672edac849d2af6dffc0f8df236a94",
-  "test_rev": "b6aba5544628730b7d6a38eae1aef9117a1bb235",
-  "typed_data_rev": "29ce5a92b03326d0b8035916ac04f528874994bd",
+  "test_process_rev": "3e695bcfeab551473ddc288970f345f30e5e1375",
+  "test_reflective_loader_rev": "8d0de01bbe852fea1f8e33aba907abcba50a8a1e",
+  "test_rev": "d54846bc2b5cfa4e1445fda85c5e48a00940aa68",
+  "typed_data_rev": "8b19e29bcf4077147de4d67adeabeb48270c65eb",
   "usage_rev": "e85d575d6decb921c57a43b9844bba3607479f56",
-  "vector_math_rev": "0cbed0914d49a6a44555e6d5444c438a4a4c3fc1",
+  "vector_math_rev": "1c72944e8c2f02340a1d90b32aab2e3836cef8cc",
   "watcher_rev": "f76997ab0c857dc5537ac0975a9ada92b54ef949",
   "web_components_rev": "8f57dac273412a7172c8ade6f361b407e2e4ed02",
   "web_socket_channel_rev": "99dbdc5769e19b9eeaf69449a59079153c6a8b1f",
   "WebCore_rev": "bcb10901266c884e7b3740abc597ab95373ab55c",
   "webdev_rev": "8c814f9d89915418d8abe354ff9befec8f2906b2",
-  "webdriver_rev": "ff5ccb1522edf4bed578ead4d65e0cbc1f2c4f02",
-  "webkit_inspection_protocol_rev": "dd6fb5d8b536e19cedb384d0bbf1f5631923f1e8",
-  "yaml_edit_rev": "4fadb43801b07f90b3f0c6065dbce4efc6d8d55e",
-  "yaml_rev": "ad0779d1baa25c6b10a192d080efc45de02b6a32",
-  "zlib_rev": "faff052b6b6edcd6dd548513fe44ac0941427bf0",
+  "webdriver_rev": "e1a9ad671ee82e05eee463f922a34585ed2d2f15",
+  "webkit_inspection_protocol_rev": "e4965778e2837adc62354eec3a19123402997897",
+  "yaml_edit_rev": "0b74d85fac10b4fbf7d1a347debcf16c8f7b0e9c",
+  "yaml_rev": "0971c06490b9670add644ed62182acd6a5536946",
+  "zlib_rev": "27c2f474b71d0d20764f86f60ef8b00da1a16cda",
 
   # Windows deps
   "crashpad_rev": "bf327d8ceb6a669607b0dbab5a83a275d03f99ed",
@@ -183,7 +174,7 @@
   # Pinned browser versions used by the testing infrastructure. These are not
   # meant to be downloaded by users for local testing.
   "download_chrome": False,
-  "chrome_tag": "91",
+  "chrome_tag": "101.0.4951.41",
   "download_firefox": False,
   "firefox_tag": "98.0.2",
 }
@@ -348,8 +339,6 @@
       Var("dart_git") + "html.git" + "@" + Var("html_rev"),
   Var("dart_root") + "/third_party/pkg/http":
       Var("dart_git") + "http.git" + "@" + Var("http_rev"),
-  Var("dart_root") + "/third_party/pkg_tested/http_io":
-    Var("dart_git") + "http_io.git" + "@" + Var("http_io_rev"),
   Var("dart_root") + "/third_party/pkg/http_multi_server":
       Var("dart_git") + "http_multi_server.git" +
       "@" + Var("http_multi_server_rev"),
@@ -380,32 +369,16 @@
       "@" + Var("package_config_rev"),
   Var("dart_root") + "/third_party/pkg/path":
       Var("dart_git") + "path.git" + "@" + Var("path_rev"),
-  Var("dart_root") + "/third_party/pkg/pedantic":
-      Var("dart_git") + "pedantic.git" + "@" + Var("pedantic_rev"),
-  Var("dart_root") + "/third_party/pkg/platform":
-       Var("dart_git") + "platform.dart.git" + "@" + Var("platform_rev"),
   Var("dart_root") + "/third_party/pkg/pool":
       Var("dart_git") + "pool.git" + "@" + Var("pool_rev"),
   Var("dart_root") + "/third_party/pkg/protobuf":
        Var("dart_git") + "protobuf.git" + "@" + Var("protobuf_rev"),
-  Var("dart_root") + "/third_party/pkg/process":
-       Var("dart_git") + "process.dart.git" + "@" + Var("process_rev"),
   Var("dart_root") + "/third_party/pkg/pub_semver":
       Var("dart_git") + "pub_semver.git" + "@" + Var("pub_semver_rev"),
   Var("dart_root") + "/third_party/pkg/pub":
       Var("dart_git") + "pub.git" + "@" + Var("pub_rev"),
   Var("dart_root") + "/third_party/pkg/shelf":
       Var("dart_git") + "shelf.git" + "@" + Var("shelf_rev"),
-  Var("dart_root") + "/third_party/pkg/shelf_packages_handler":
-      Var("dart_git") + "shelf_packages_handler.git"
-      + "@" + Var("shelf_packages_handler_rev"),
-  Var("dart_root") + "/third_party/pkg/shelf_proxy":
-      Var("dart_git") + "shelf_proxy.git" + "@" + Var("shelf_proxy_rev"),
-  Var("dart_root") + "/third_party/pkg/shelf_static":
-      Var("dart_git") + "shelf_static.git" + "@" + Var("shelf_static_rev"),
-  Var("dart_root") + "/third_party/pkg/shelf_web_socket":
-      Var("dart_git") + "shelf_web_socket.git" +
-      "@" + Var("shelf_web_socket_rev"),
   Var("dart_root") + "/third_party/pkg/source_maps":
       Var("dart_git") + "source_maps.git" + "@" + Var("source_maps_rev"),
   Var("dart_root") + "/third_party/pkg/source_span":
@@ -531,7 +504,7 @@
   Var("dart_root") + "/third_party/android_tools/ndk": {
       "packages": [
           {
-            "package": "flutter/android/ndk/${{platform}}",
+            "package": "flutter/android/ndk/${{os}}-amd64",
             "version": "version:r21.0.6113669"
           }
       ],
@@ -542,7 +515,7 @@
   Var("dart_root") + "/third_party/android_tools/sdk/build-tools": {
       "packages": [
           {
-            "package": "flutter/android/sdk/build-tools/${{platform}}",
+            "package": "flutter/android/sdk/build-tools/${{os}}-amd64",
             "version": "version:30.0.1"
           }
       ],
@@ -553,7 +526,7 @@
   Var("dart_root") + "/third_party/android_tools/sdk/platform-tools": {
      "packages": [
           {
-            "package": "flutter/android/sdk/platform-tools/${{platform}}",
+            "package": "flutter/android/sdk/platform-tools/${{os}}-amd64",
             "version": "version:29.0.2"
           }
       ],
@@ -575,7 +548,7 @@
   Var("dart_root") + "/third_party/android_tools/sdk/tools": {
       "packages": [
           {
-            "package": "flutter/android/sdk/tools/${{platform}}",
+            "package": "flutter/android/sdk/tools/${{os}}-amd64",
             "version": "version:26.1.1"
           }
       ],
@@ -702,6 +675,12 @@
     'action': ['python3', 'sdk/tools/generate_package_config.py'],
   },
   {
+    # Generate the sdk/version file.
+    'name': 'Generate sdk/version',
+    'pattern': '.',
+    'action': ['python3', 'sdk/tools/generate_sdk_version_file.py'],
+  },
+  {
     # Pull Debian sysroot for i386 Linux
     'name': 'sysroot_i386',
     'pattern': '.',
diff --git a/OWNERS b/OWNERS
index 911f0bb..b179edd 100644
--- a/OWNERS
+++ b/OWNERS
@@ -17,7 +17,7 @@
 per-file CONTRIBUTING.md,LICENSE,PATENT_GRANT,README.*,SECURITY.md=file:/tools/OWNERS_PRODUCT
 
 # Top level build files
-per-file .clang-format,BUILD.gn,sdk_args.gni=file:/tools/OWNERS_VM
+per-file .clang-format,BUILD.gn,sdk_args.gni=file:/tools/OWNERS_BUILD
 
 # Generated file
 per-file .packages=*
diff --git a/benchmarks/AsyncLiveVars/dart/AsyncLiveVars.dart b/benchmarks/AsyncLiveVars/dart/AsyncLiveVars.dart
index 7969da6..2cd702cc 100644
--- a/benchmarks/AsyncLiveVars/dart/AsyncLiveVars.dart
+++ b/benchmarks/AsyncLiveVars/dart/AsyncLiveVars.dart
@@ -7,7 +7,7 @@
 
 import 'dart:async';
 
-import 'async_benchmark_base.dart' show AsyncBenchmarkBase;
+import 'package:benchmark_harness/benchmark_harness.dart';
 
 class MockClass {
   static final String str = "${int.parse('42')}";
diff --git a/benchmarks/AsyncLiveVars/dart/async_benchmark_base.dart b/benchmarks/AsyncLiveVars/dart/async_benchmark_base.dart
deleted file mode 100644
index 9a415b9..0000000
--- a/benchmarks/AsyncLiveVars/dart/async_benchmark_base.dart
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:benchmark_harness/benchmark_harness.dart'
-    show PrintEmitter, ScoreEmitter;
-
-// Similar to BenchmarkBase from package:benchmark_harness.
-class AsyncBenchmarkBase {
-  final String name;
-  final ScoreEmitter emitter;
-
-  // Empty constructor.
-  const AsyncBenchmarkBase(this.name, {this.emitter = const PrintEmitter()});
-
-  // The benchmark code.
-  // This function is not used, if both [warmup] and [exercise] are overwritten.
-  Future<void> run() async {}
-
-  // Runs a short version of the benchmark. By default invokes [run] once.
-  Future<void> warmup() async {
-    await run();
-  }
-
-  // Exercises the benchmark. By default invokes [run] 10 times.
-  Future<void> exercise() async {
-    for (var i = 0; i < 10; i++) {
-      await run();
-    }
-  }
-
-  // Not measured setup code executed prior to the benchmark runs.
-  Future<void> setup() async {}
-
-  // Not measures teardown code executed after the benchark runs.
-  Future<void> teardown() async {}
-
-  // Measures the score for this benchmark by executing it repeatedly until
-  // time minimum has been reached.
-  static Future<double> measureFor(Function f, int minimumMillis) async {
-    final int minimumMicros = minimumMillis * 1000;
-    int iter = 0;
-    final watch = Stopwatch();
-    watch.start();
-    int elapsed = 0;
-    while (elapsed < minimumMicros) {
-      await f();
-      elapsed = watch.elapsedMicroseconds;
-      iter++;
-    }
-    return elapsed / iter;
-  }
-
-  // Measures the score for the benchmark and returns it.
-  Future<double> measure() async {
-    await setup();
-    // Warmup for at least 100ms. Discard result.
-    await measureFor(warmup, 100);
-    // Run the benchmark for at least 2000ms.
-    final result = await measureFor(exercise, 2000);
-    await teardown();
-    return result;
-  }
-
-  Future<void> report() async {
-    emitter.emit(name, await measure());
-  }
-}
diff --git a/benchmarks/AsyncLiveVars/dart2/AsyncLiveVars.dart b/benchmarks/AsyncLiveVars/dart2/AsyncLiveVars.dart
index 9176274..20ac726 100644
--- a/benchmarks/AsyncLiveVars/dart2/AsyncLiveVars.dart
+++ b/benchmarks/AsyncLiveVars/dart2/AsyncLiveVars.dart
@@ -9,7 +9,7 @@
 
 import 'dart:async';
 
-import 'async_benchmark_base.dart' show AsyncBenchmarkBase;
+import 'package:benchmark_harness/benchmark_harness.dart';
 
 class MockClass {
   static final String str = "${int.parse('42')}";
diff --git a/benchmarks/AsyncLiveVars/dart2/async_benchmark_base.dart b/benchmarks/AsyncLiveVars/dart2/async_benchmark_base.dart
deleted file mode 100644
index 9a415b9..0000000
--- a/benchmarks/AsyncLiveVars/dart2/async_benchmark_base.dart
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:benchmark_harness/benchmark_harness.dart'
-    show PrintEmitter, ScoreEmitter;
-
-// Similar to BenchmarkBase from package:benchmark_harness.
-class AsyncBenchmarkBase {
-  final String name;
-  final ScoreEmitter emitter;
-
-  // Empty constructor.
-  const AsyncBenchmarkBase(this.name, {this.emitter = const PrintEmitter()});
-
-  // The benchmark code.
-  // This function is not used, if both [warmup] and [exercise] are overwritten.
-  Future<void> run() async {}
-
-  // Runs a short version of the benchmark. By default invokes [run] once.
-  Future<void> warmup() async {
-    await run();
-  }
-
-  // Exercises the benchmark. By default invokes [run] 10 times.
-  Future<void> exercise() async {
-    for (var i = 0; i < 10; i++) {
-      await run();
-    }
-  }
-
-  // Not measured setup code executed prior to the benchmark runs.
-  Future<void> setup() async {}
-
-  // Not measures teardown code executed after the benchark runs.
-  Future<void> teardown() async {}
-
-  // Measures the score for this benchmark by executing it repeatedly until
-  // time minimum has been reached.
-  static Future<double> measureFor(Function f, int minimumMillis) async {
-    final int minimumMicros = minimumMillis * 1000;
-    int iter = 0;
-    final watch = Stopwatch();
-    watch.start();
-    int elapsed = 0;
-    while (elapsed < minimumMicros) {
-      await f();
-      elapsed = watch.elapsedMicroseconds;
-      iter++;
-    }
-    return elapsed / iter;
-  }
-
-  // Measures the score for the benchmark and returns it.
-  Future<double> measure() async {
-    await setup();
-    // Warmup for at least 100ms. Discard result.
-    await measureFor(warmup, 100);
-    // Run the benchmark for at least 2000ms.
-    final result = await measureFor(exercise, 2000);
-    await teardown();
-    return result;
-  }
-
-  Future<void> report() async {
-    emitter.emit(name, await measure());
-  }
-}
diff --git a/benchmarks/Isolate/dart/Isolate.dart b/benchmarks/Isolate/dart/Isolate.dart
index b703340..55e5377 100644
--- a/benchmarks/Isolate/dart/Isolate.dart
+++ b/benchmarks/Isolate/dart/Isolate.dart
@@ -6,8 +6,7 @@
 import 'dart:isolate';
 import 'dart:typed_data';
 
-import 'package:benchmark_harness/benchmark_harness.dart'
-    show PrintEmitter, ScoreEmitter;
+import 'package:benchmark_harness/benchmark_harness.dart';
 
 class SendReceiveBytes extends AsyncBenchmarkBase {
   SendReceiveBytes(String name,
@@ -35,46 +34,6 @@
   late SendReceiveHelper helper;
 }
 
-// Identical to BenchmarkBase from package:benchmark_harness but async.
-abstract class AsyncBenchmarkBase {
-  final String name;
-  final ScoreEmitter emitter;
-
-  Future<void> run();
-  Future<void> setup();
-  Future<void> teardown();
-
-  const AsyncBenchmarkBase(this.name, {this.emitter = const PrintEmitter()});
-
-  // Returns the number of microseconds per call.
-  Future<double> measureFor(int minimumMillis) async {
-    final minimumMicros = minimumMillis * 1000;
-    int iter = 0;
-    final watch = Stopwatch();
-    watch.start();
-    int elapsed = 0;
-    while (elapsed < minimumMicros) {
-      await run();
-      elapsed = watch.elapsedMicroseconds;
-      iter++;
-    }
-    return elapsed / iter;
-  }
-
-  // Measures the score for the benchmark and returns it.
-  Future<double> measure() async {
-    await setup();
-    await measureFor(500); // warm-up
-    final result = await measureFor(4000); // actual measurement
-    await teardown();
-    return result;
-  }
-
-  Future<void> report() async {
-    emitter.emit(name, await measure());
-  }
-}
-
 class StartMessage {
   final SendPort sendPort;
   final bool useTransferable;
diff --git a/benchmarks/Isolate/dart2/Isolate.dart b/benchmarks/Isolate/dart2/Isolate.dart
index 24e102b..c8bfaab 100644
--- a/benchmarks/Isolate/dart2/Isolate.dart
+++ b/benchmarks/Isolate/dart2/Isolate.dart
@@ -8,8 +8,7 @@
 import 'dart:isolate';
 import 'dart:typed_data';
 
-import 'package:benchmark_harness/benchmark_harness.dart'
-    show PrintEmitter, ScoreEmitter;
+import 'package:benchmark_harness/benchmark_harness.dart';
 import 'package:meta/meta.dart';
 
 class SendReceiveBytes extends AsyncBenchmarkBase {
@@ -38,46 +37,6 @@
   SendReceiveHelper helper;
 }
 
-// Identical to BenchmarkBase from package:benchmark_harness but async.
-abstract class AsyncBenchmarkBase {
-  final String name;
-  final ScoreEmitter emitter;
-
-  Future<void> run();
-  Future<void> setup();
-  Future<void> teardown();
-
-  const AsyncBenchmarkBase(this.name, {this.emitter = const PrintEmitter()});
-
-  // Returns the number of microseconds per call.
-  Future<double> measureFor(int minimumMillis) async {
-    final minimumMicros = minimumMillis * 1000;
-    int iter = 0;
-    final watch = Stopwatch();
-    watch.start();
-    int elapsed = 0;
-    while (elapsed < minimumMicros) {
-      await run();
-      elapsed = watch.elapsedMicroseconds;
-      iter++;
-    }
-    return elapsed / iter;
-  }
-
-  // Measures the score for the benchmark and returns it.
-  Future<double> measure() async {
-    await setup();
-    await measureFor(500); // warm-up
-    final result = await measureFor(4000); // actual measurement
-    await teardown();
-    return result;
-  }
-
-  Future<void> report() async {
-    emitter.emit(name, await measure());
-  }
-}
-
 class StartMessage {
   final SendPort sendPort;
   final bool useTransferable;
diff --git a/benchmarks/IsolateBaseOverhead/dart/IsolateBaseOverhead.dart b/benchmarks/IsolateBaseOverhead/dart/IsolateBaseOverhead.dart
new file mode 100644
index 0000000..c9b8d24
--- /dev/null
+++ b/benchmarks/IsolateBaseOverhead/dart/IsolateBaseOverhead.dart
@@ -0,0 +1,56 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+import 'dart:io';
+import 'dart:isolate';
+
+const int count = 10000;
+
+// The benchmark will spawn a long chain of isolates, keeping all of them
+// alive until the last one which measures Rss at that point (i.e. when all
+// isolates are alive), thereby getting a good estimate of memory-overhead per
+// isolate.
+void main() async {
+  final onDone = ReceivePort();
+  final lastIsolatePort = ReceivePort();
+  final startRss = ProcessInfo.currentRss;
+  final startUs = DateTime.now().microsecondsSinceEpoch;
+  await Isolate.spawn(worker, WorkerInfo(count, lastIsolatePort.sendPort),
+      onExit: onDone.sendPort);
+  final result = await lastIsolatePort.first as List;
+  final lastIsolateRss = result[0] as int;
+  final lastIsolateUs = result[1] as int;
+  await onDone.first;
+  final doneUs = DateTime.now().microsecondsSinceEpoch;
+
+  final averageMemoryUsageInKB = (lastIsolateRss - startRss) / count / 1024;
+  final averageStartLatencyInUs = (lastIsolateUs - startUs) / count;
+  final averageFinishLatencyInUs = (doneUs - startUs) / count;
+
+  print('IsolateBaseOverhead.Rss(MemoryUse): $averageMemoryUsageInKB');
+  print(
+      'IsolateBaseOverhead.StartLatency(Latency): $averageStartLatencyInUs us.');
+  print(
+      'IsolateBaseOverhead.FinishLatency(Latency): $averageFinishLatencyInUs us.');
+}
+
+class WorkerInfo {
+  final int id;
+  final SendPort result;
+
+  WorkerInfo(this.id, this.result);
+}
+
+Future worker(WorkerInfo workerInfo) async {
+  if (workerInfo.id == 1) {
+    workerInfo.result
+        .send([ProcessInfo.currentRss, DateTime.now().microsecondsSinceEpoch]);
+    return;
+  }
+  final onExit = ReceivePort();
+  await Isolate.spawn(worker, WorkerInfo(workerInfo.id - 1, workerInfo.result),
+      onExit: onExit.sendPort);
+  await onExit.first;
+}
diff --git a/benchmarks/IsolateBaseOverhead/dart2/IsolateBaseOverhead.dart b/benchmarks/IsolateBaseOverhead/dart2/IsolateBaseOverhead.dart
new file mode 100644
index 0000000..c9b8d24
--- /dev/null
+++ b/benchmarks/IsolateBaseOverhead/dart2/IsolateBaseOverhead.dart
@@ -0,0 +1,56 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+import 'dart:io';
+import 'dart:isolate';
+
+const int count = 10000;
+
+// The benchmark will spawn a long chain of isolates, keeping all of them
+// alive until the last one which measures Rss at that point (i.e. when all
+// isolates are alive), thereby getting a good estimate of memory-overhead per
+// isolate.
+void main() async {
+  final onDone = ReceivePort();
+  final lastIsolatePort = ReceivePort();
+  final startRss = ProcessInfo.currentRss;
+  final startUs = DateTime.now().microsecondsSinceEpoch;
+  await Isolate.spawn(worker, WorkerInfo(count, lastIsolatePort.sendPort),
+      onExit: onDone.sendPort);
+  final result = await lastIsolatePort.first as List;
+  final lastIsolateRss = result[0] as int;
+  final lastIsolateUs = result[1] as int;
+  await onDone.first;
+  final doneUs = DateTime.now().microsecondsSinceEpoch;
+
+  final averageMemoryUsageInKB = (lastIsolateRss - startRss) / count / 1024;
+  final averageStartLatencyInUs = (lastIsolateUs - startUs) / count;
+  final averageFinishLatencyInUs = (doneUs - startUs) / count;
+
+  print('IsolateBaseOverhead.Rss(MemoryUse): $averageMemoryUsageInKB');
+  print(
+      'IsolateBaseOverhead.StartLatency(Latency): $averageStartLatencyInUs us.');
+  print(
+      'IsolateBaseOverhead.FinishLatency(Latency): $averageFinishLatencyInUs us.');
+}
+
+class WorkerInfo {
+  final int id;
+  final SendPort result;
+
+  WorkerInfo(this.id, this.result);
+}
+
+Future worker(WorkerInfo workerInfo) async {
+  if (workerInfo.id == 1) {
+    workerInfo.result
+        .send([ProcessInfo.currentRss, DateTime.now().microsecondsSinceEpoch]);
+    return;
+  }
+  final onExit = ReceivePort();
+  await Isolate.spawn(worker, WorkerInfo(workerInfo.id - 1, workerInfo.result),
+      onExit: onExit.sendPort);
+  await onExit.first;
+}
diff --git a/benchmarks/IsolateSendExit/dart/IsolateSendExitLatency.dart b/benchmarks/IsolateSendExit/dart/IsolateSendExitLatency.dart
new file mode 100644
index 0000000..8d00b01
--- /dev/null
+++ b/benchmarks/IsolateSendExit/dart/IsolateSendExitLatency.dart
@@ -0,0 +1,45 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+//
+// This test ensures that there are no long pauses when sending large objects
+// via exit/send.
+
+import 'dart:async';
+import 'dart:typed_data';
+import 'dart:math' as math;
+import 'dart:isolate';
+
+import 'latency.dart';
+
+main() async {
+  final statsFuture =
+      measureEventLoopLatency(const Duration(milliseconds: 1), 4000, work: () {
+    // Every 1 ms we allocate some objects which may trigger GC some time.
+    for (int i = 0; i < 32; i++) {
+      List.filled(32 * 1024 ~/ 8, null);
+    }
+  });
+
+  final result = await compute(() {
+    final l = <dynamic>[];
+    for (int i = 0; i < 10 * 1000 * 1000; ++i) {
+      l.add(Object());
+    }
+    return l;
+  });
+  if (result.length != 10 * 1000 * 1000) throw 'failed';
+
+  final stats = await statsFuture;
+  stats.report('IsolateSendExitLatency');
+}
+
+Future<T> compute<T>(T Function() fun) {
+  final rp = ReceivePort();
+  final sp = rp.sendPort;
+  Isolate.spawn((_) {
+    final value = fun();
+    Isolate.exit(sp, value);
+  }, null);
+  return rp.first.then((t) => t as T);
+}
diff --git a/benchmarks/IsolateSendExit/dart/latency.dart b/benchmarks/IsolateSendExit/dart/latency.dart
new file mode 100644
index 0000000..0a5054f
--- /dev/null
+++ b/benchmarks/IsolateSendExit/dart/latency.dart
@@ -0,0 +1,134 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+import 'dart:io';
+import 'dart:math' as math;
+import 'dart:typed_data';
+
+/// Measures event loop responsiveness.
+///
+/// Schedules new timer events, [tickDuration] in the future, and measures how
+/// long it takes for these events to actually arrive.
+///
+/// Runs [numberOfTicks] times before completing with [EventLoopLatencyStats].
+Future<EventLoopLatencyStats> measureEventLoopLatency(
+    Duration tickDuration, int numberOfTicks,
+    {void Function()? work}) {
+  final completer = Completer<EventLoopLatencyStats>();
+
+  final tickDurationInUs = tickDuration.inMicroseconds;
+  final buffer = _TickLatencies(numberOfTicks);
+  final sw = Stopwatch()..start();
+  int lastTimestamp = 0;
+
+  void trigger() {
+    final int currentTimestamp = sw.elapsedMicroseconds;
+
+    // Every tick we missed to schedule we'll add with difference to when we
+    // would've scheduled it and when we became responsive again.
+    bool done = false;
+    while (!done && lastTimestamp < (currentTimestamp - tickDurationInUs)) {
+      done = !buffer.add(currentTimestamp - lastTimestamp - tickDurationInUs);
+      lastTimestamp += tickDurationInUs;
+    }
+
+    if (work != null) {
+      work();
+    }
+
+    if (!done) {
+      lastTimestamp = currentTimestamp;
+      Timer(tickDuration, trigger);
+    } else {
+      completer.complete(buffer.makeStats());
+    }
+  }
+
+  Timer(tickDuration, trigger);
+
+  return completer.future;
+}
+
+/// Result of the event loop latency measurement.
+class EventLoopLatencyStats {
+  /// Minimum latency between scheduling a tick and it's arrival (in ms).
+  final double minLatency;
+
+  /// Average latency between scheduling a tick and it's arrival (in ms).
+  final double avgLatency;
+
+  /// Maximum latency between scheduling a tick and it's arrival (in ms).
+  final double maxLatency;
+
+  /// The 50th percentile (median) (in ms).
+  final double percentile50th;
+
+  /// The 90th percentile (in ms).
+  final double percentile90th;
+
+  /// The 95th percentile (in ms).
+  final double percentile95th;
+
+  /// The 99th percentile (in ms).
+  final double percentile99th;
+
+  EventLoopLatencyStats(
+      this.minLatency,
+      this.avgLatency,
+      this.maxLatency,
+      this.percentile50th,
+      this.percentile90th,
+      this.percentile95th,
+      this.percentile99th);
+
+  void report(String name) {
+    print('$name.Min(RunTimeRaw): $minLatency ms.');
+    print('$name.Avg(RunTimeRaw): $avgLatency ms.');
+    print('$name.Percentile50(RunTimeRaw): $percentile50th ms.');
+    print('$name.Percentile90(RunTimeRaw): $percentile90th ms.');
+    print('$name.Percentile95(RunTimeRaw): $percentile95th ms.');
+    print('$name.Percentile99(RunTimeRaw): $percentile99th ms.');
+    print('$name.Max(RunTimeRaw): $maxLatency ms.');
+  }
+}
+
+/// Accumulates tick latencies and makes statistics for it.
+class _TickLatencies {
+  final Uint64List _timestamps;
+  int _index = 0;
+
+  _TickLatencies(int numberOfTicks) : _timestamps = Uint64List(numberOfTicks);
+
+  /// Returns `true` while the buffer has not been filled yet.
+  bool add(int latencyInUs) {
+    _timestamps[_index++] = latencyInUs;
+    return _index < _timestamps.length;
+  }
+
+  EventLoopLatencyStats makeStats() {
+    if (_index != _timestamps.length) {
+      throw 'Buffer has not been fully filled yet.';
+    }
+
+    _timestamps.sort();
+    final length = _timestamps.length;
+    final double avg = _timestamps.fold(0, (int a, int b) => a + b) / length;
+    final int min = _timestamps.fold(0x7fffffffffffffff, math.min);
+    final int max = _timestamps.fold(0, math.max);
+    final percentile50th = _timestamps[50 * length ~/ 100];
+    final percentile90th = _timestamps[90 * length ~/ 100];
+    final percentile95th = _timestamps[95 * length ~/ 100];
+    final percentile99th = _timestamps[99 * length ~/ 100];
+
+    return EventLoopLatencyStats(
+        min / 1000,
+        avg / 1000,
+        max / 1000,
+        percentile50th / 1000,
+        percentile90th / 1000,
+        percentile95th / 1000,
+        percentile99th / 1000);
+  }
+}
diff --git a/benchmarks/IsolateSendExit/dart2/IsolateSendExitLatency.dart b/benchmarks/IsolateSendExit/dart2/IsolateSendExitLatency.dart
new file mode 100644
index 0000000..c165c73
--- /dev/null
+++ b/benchmarks/IsolateSendExit/dart2/IsolateSendExitLatency.dart
@@ -0,0 +1,47 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+//
+// This test ensures that there are no long pauses when sending large objects
+// via exit/send.
+
+// @dart=2.9
+
+import 'dart:async';
+import 'dart:typed_data';
+import 'dart:math' as math;
+import 'dart:isolate';
+
+import 'latency.dart';
+
+main() async {
+  final statsFuture =
+      measureEventLoopLatency(const Duration(milliseconds: 1), 4000, work: () {
+    // Every 1 ms we allocate some objects which may trigger GC some time.
+    for (int i = 0; i < 32; i++) {
+      List.filled(32 * 1024 ~/ 8, null);
+    }
+  });
+
+  final result = await compute(() {
+    final l = <dynamic>[];
+    for (int i = 0; i < 10 * 1000 * 1000; ++i) {
+      l.add(Object());
+    }
+    return l;
+  });
+  if (result.length != 10 * 1000 * 1000) throw 'failed';
+
+  final stats = await statsFuture;
+  stats.report('IsolateSendExitLatency');
+}
+
+Future<T> compute<T>(T Function() fun) {
+  final rp = ReceivePort();
+  final sp = rp.sendPort;
+  Isolate.spawn((_) {
+    final value = fun();
+    Isolate.exit(sp, value);
+  }, null);
+  return rp.first.then((t) => t as T);
+}
diff --git a/benchmarks/IsolateSendExit/dart2/latency.dart b/benchmarks/IsolateSendExit/dart2/latency.dart
new file mode 100644
index 0000000..8b3352c
--- /dev/null
+++ b/benchmarks/IsolateSendExit/dart2/latency.dart
@@ -0,0 +1,136 @@
+// Copyright (c) 2020, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// @dart=2.9
+
+import 'dart:async';
+import 'dart:io';
+import 'dart:math' as math;
+import 'dart:typed_data';
+
+/// Measures event loop responsiveness.
+///
+/// Schedules new timer events, [tickDuration] in the future, and measures how
+/// long it takes for these events to actually arrive.
+///
+/// Runs [numberOfTicks] times before completing with [EventLoopLatencyStats].
+Future<EventLoopLatencyStats> measureEventLoopLatency(
+    Duration tickDuration, int numberOfTicks,
+    {void Function() work}) {
+  final completer = Completer<EventLoopLatencyStats>();
+
+  final tickDurationInUs = tickDuration.inMicroseconds;
+  final buffer = _TickLatencies(numberOfTicks);
+  final sw = Stopwatch()..start();
+  int lastTimestamp = 0;
+
+  void trigger() {
+    final int currentTimestamp = sw.elapsedMicroseconds;
+
+    // Every tick we missed to schedule we'll add with difference to when we
+    // would've scheduled it and when we became responsive again.
+    bool done = false;
+    while (!done && lastTimestamp < (currentTimestamp - tickDurationInUs)) {
+      done = !buffer.add(currentTimestamp - lastTimestamp - tickDurationInUs);
+      lastTimestamp += tickDurationInUs;
+    }
+
+    if (work != null) {
+      work();
+    }
+
+    if (!done) {
+      lastTimestamp = currentTimestamp;
+      Timer(tickDuration, trigger);
+    } else {
+      completer.complete(buffer.makeStats());
+    }
+  }
+
+  Timer(tickDuration, trigger);
+
+  return completer.future;
+}
+
+/// Result of the event loop latency measurement.
+class EventLoopLatencyStats {
+  /// Minimum latency between scheduling a tick and it's arrival (in ms).
+  final double minLatency;
+
+  /// Average latency between scheduling a tick and it's arrival (in ms).
+  final double avgLatency;
+
+  /// Maximum latency between scheduling a tick and it's arrival (in ms).
+  final double maxLatency;
+
+  /// The 50th percentile (median) (in ms).
+  final double percentile50th;
+
+  /// The 90th percentile (in ms).
+  final double percentile90th;
+
+  /// The 95th percentile (in ms).
+  final double percentile95th;
+
+  /// The 99th percentile (in ms).
+  final double percentile99th;
+
+  EventLoopLatencyStats(
+      this.minLatency,
+      this.avgLatency,
+      this.maxLatency,
+      this.percentile50th,
+      this.percentile90th,
+      this.percentile95th,
+      this.percentile99th);
+
+  void report(String name) {
+    print('$name.Min(RunTimeRaw): $minLatency ms.');
+    print('$name.Avg(RunTimeRaw): $avgLatency ms.');
+    print('$name.Percentile50(RunTimeRaw): $percentile50th ms.');
+    print('$name.Percentile90(RunTimeRaw): $percentile90th ms.');
+    print('$name.Percentile95(RunTimeRaw): $percentile95th ms.');
+    print('$name.Percentile99(RunTimeRaw): $percentile99th ms.');
+    print('$name.Max(RunTimeRaw): $maxLatency ms.');
+  }
+}
+
+/// Accumulates tick latencies and makes statistics for it.
+class _TickLatencies {
+  final Uint64List _timestamps;
+  int _index = 0;
+
+  _TickLatencies(int numberOfTicks) : _timestamps = Uint64List(numberOfTicks);
+
+  /// Returns `true` while the buffer has not been filled yet.
+  bool add(int latencyInUs) {
+    _timestamps[_index++] = latencyInUs;
+    return _index < _timestamps.length;
+  }
+
+  EventLoopLatencyStats makeStats() {
+    if (_index != _timestamps.length) {
+      throw 'Buffer has not been fully filled yet.';
+    }
+
+    _timestamps.sort();
+    final length = _timestamps.length;
+    final double avg = _timestamps.fold(0, (int a, int b) => a + b) / length;
+    final int min = _timestamps.fold(0x7fffffffffffffff, math.min);
+    final int max = _timestamps.fold(0, math.max);
+    final percentile50th = _timestamps[50 * length ~/ 100];
+    final percentile90th = _timestamps[90 * length ~/ 100];
+    final percentile95th = _timestamps[95 * length ~/ 100];
+    final percentile99th = _timestamps[99 * length ~/ 100];
+
+    return EventLoopLatencyStats(
+        min / 1000,
+        avg / 1000,
+        max / 1000,
+        percentile50th / 1000,
+        percentile90th / 1000,
+        percentile95th / 1000,
+        percentile99th / 1000);
+  }
+}
diff --git a/benchmarks/Startup/dart/Startup.dart b/benchmarks/Startup/dart/Startup.dart
index 49889fb..03bd22e 100644
--- a/benchmarks/Startup/dart/Startup.dart
+++ b/benchmarks/Startup/dart/Startup.dart
@@ -76,7 +76,7 @@
       print(ends.toList());
       throw '$name is missing or ambiguous';
     }
-    print('Startup.$name(RunTime): $micros us.');
+    print('Startup.$name(StartupTime): $micros us.');
   }
 
   report('CreateIsolateGroupAndSetupHelper', null);
diff --git a/benchmarks/Startup/dart2/Startup.dart b/benchmarks/Startup/dart2/Startup.dart
index 26fb07b..b79e3a3 100644
--- a/benchmarks/Startup/dart2/Startup.dart
+++ b/benchmarks/Startup/dart2/Startup.dart
@@ -78,7 +78,7 @@
       print(ends.toList());
       throw '$name is missing or ambiguous';
     }
-    print('Startup.$name(RunTime): $micros us.');
+    print('Startup.$name(StartupTime): $micros us.');
   }
 
   report('CreateIsolateGroupAndSetupHelper', null);
diff --git a/benchmarks/TypeLiteral/dart/TypeLiteral.dart b/benchmarks/TypeLiteral/dart/TypeLiteral.dart
new file mode 100644
index 0000000..fb9f567
--- /dev/null
+++ b/benchmarks/TypeLiteral/dart/TypeLiteral.dart
@@ -0,0 +1,197 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+const int iterations = 100000;
+
+void main() {
+  SyncCallBenchmark('TypeLiteral.GenericFunction.T.dynamic', () {
+    for (int i = 0; i < iterations; ++i) {
+      getT<dynamic>();
+    }
+    return iterations;
+  }).report();
+  SyncCallBenchmark('TypeLiteral.GenericFunction.T.int', () {
+    for (int i = 0; i < iterations; ++i) {
+      getT<int>();
+    }
+    return iterations;
+  }).report();
+  SyncCallBenchmark('TypeLiteral.GenericFunction.T.nullableInt', () {
+    for (int i = 0; i < iterations; ++i) {
+      getT<int?>();
+    }
+    return iterations;
+  }).report();
+  SyncCallBenchmark('TypeLiteral.GenericFunction.ListOfT.int', () {
+    for (int i = 0; i < iterations; ++i) {
+      getListOfT<int>();
+    }
+    return iterations;
+  }).report();
+  SyncCallBenchmark('TypeLiteral.GenericFunction.ListOfT.nullableInt', () {
+    for (int i = 0; i < iterations; ++i) {
+      getListOfT<int?>();
+    }
+    return iterations;
+  }).report();
+  SyncCallBenchmark('TypeLiteral.GenericFunction.NullableT.int', () {
+    for (int i = 0; i < iterations; ++i) {
+      getNullableT<int>();
+    }
+    return iterations;
+  }).report();
+  SyncCallBenchmark('TypeLiteral.GenericFunction.NullableT.nullableInt', () {
+    for (int i = 0; i < iterations; ++i) {
+      getNullableT<int?>();
+    }
+    return iterations;
+  }).report();
+  SyncCallBenchmark('TypeLiteral.GenericFunction.ListOfNullableT.int', () {
+    for (int i = 0; i < iterations; ++i) {
+      getListOfT<int>();
+    }
+    return iterations;
+  }).report();
+  SyncCallBenchmark('TypeLiteral.GenericFunction.ListOfNullableT.nullableInt',
+      () {
+    for (int i = 0; i < iterations; ++i) {
+      getListOfNullableT<int?>();
+    }
+    return iterations;
+  }).report();
+  final foos = <Foo<Object?>>[
+    Foo<int>(),
+    Foo<int?>(),
+    Foo<dynamic>(),
+  ];
+  final Foo fooInt = foos[int.parse('0')];
+  final Foo fooNullableInt = foos[int.parse('1')];
+  final Foo fooDynamic = foos[int.parse('2')];
+  SyncCallBenchmark('TypeLiteral.GenericClass.T.dynamic', () {
+    for (int i = 0; i < iterations; ++i) {
+      fooDynamic.getT();
+    }
+    return iterations;
+  }).report();
+  SyncCallBenchmark('TypeLiteral.GenericClass.T.int', () {
+    for (int i = 0; i < iterations; ++i) {
+      fooInt.getT();
+    }
+    return iterations;
+  }).report();
+  SyncCallBenchmark('TypeLiteral.GenericClass.T.nullableInt', () {
+    for (int i = 0; i < iterations; ++i) {
+      fooNullableInt.getT();
+    }
+    return iterations;
+  }).report();
+  SyncCallBenchmark('TypeLiteral.GenericClass.ListOfT.int', () {
+    for (int i = 0; i < iterations; ++i) {
+      fooInt.getListOfT();
+    }
+    return iterations;
+  }).report();
+  SyncCallBenchmark('TypeLiteral.GenericClass.ListOfT.nullableInt', () {
+    for (int i = 0; i < iterations; ++i) {
+      fooNullableInt.getListOfT();
+    }
+    return iterations;
+  }).report();
+  SyncCallBenchmark('TypeLiteral.GenericClass.NullableT.int', () {
+    for (int i = 0; i < iterations; ++i) {
+      fooInt.getNullableT();
+    }
+    return iterations;
+  }).report();
+  SyncCallBenchmark('TypeLiteral.GenericClass.NullableT.nullableInt', () {
+    for (int i = 0; i < iterations; ++i) {
+      fooNullableInt.getNullableT();
+    }
+    return iterations;
+  }).report();
+  SyncCallBenchmark('TypeLiteral.GenericClass.ListOfNullableT.int', () {
+    for (int i = 0; i < iterations; ++i) {
+      fooInt.getListOfT();
+    }
+    return iterations;
+  }).report();
+  SyncCallBenchmark('TypeLiteral.GenericClass.ListOfNullableT.nullableInt', () {
+    for (int i = 0; i < iterations; ++i) {
+      fooNullableInt.getListOfNullableT();
+    }
+    return iterations;
+  }).report();
+}
+
+@pragma('vm:never-inline')
+@pragma('dart2js:noInline')
+Type getT<T>() => T;
+
+@pragma('vm:never-inline')
+@pragma('dart2js:noInline')
+Type getNullableT<T>() => MakeNullable<T?>;
+
+@pragma('vm:never-inline')
+@pragma('dart2js:noInline')
+Type getListOfT<T>() => List<T>;
+
+@pragma('vm:never-inline')
+@pragma('dart2js:noInline')
+Type getListOfNullableT<T>() => List<T?>;
+
+class Foo<T> {
+  @pragma('vm:never-inline')
+  @pragma('dart2js:noInline')
+  Type getT() => T;
+
+  @pragma('vm:never-inline')
+  @pragma('dart2js:noInline')
+  Type getNullableT() => MakeNullable<T?>;
+
+  @pragma('vm:never-inline')
+  @pragma('dart2js:noInline')
+  Type getListOfT() => List<T>;
+
+  @pragma('vm:never-inline')
+  @pragma('dart2js:noInline')
+  Type getListOfNullableT() => List<T?>;
+}
+
+typedef MakeNullable<X> = X?;
+
+// Same as from [Calls] benchmark.
+class SyncCallBenchmark {
+  final String name;
+  final int Function() performCalls;
+
+  SyncCallBenchmark(this.name, this.performCalls);
+
+  // Returns the number of nanoseconds per call.
+  double measureFor(Duration duration) {
+    final sw = Stopwatch()..start();
+    final durationInMicroseconds = duration.inMicroseconds;
+
+    int numberOfCalls = 0;
+    int totalMicroseconds = 0;
+    do {
+      numberOfCalls += performCalls();
+      totalMicroseconds = sw.elapsedMicroseconds;
+    } while (totalMicroseconds < durationInMicroseconds);
+
+    final int totalNanoseconds = sw.elapsed.inMicroseconds * 1000;
+    return totalNanoseconds / numberOfCalls;
+  }
+
+  // Runs warmup phase, runs benchmark and reports result.
+  void report() {
+    // Warmup for 100 ms.
+    measureFor(const Duration(milliseconds: 100));
+
+    // Run benchmark for 2 seconds.
+    final double nsPerCall = measureFor(const Duration(seconds: 2));
+
+    // Report result.
+    print('$name(RunTimeRaw): $nsPerCall ns.');
+  }
+}
diff --git a/build/OWNERS b/build/OWNERS
index 2b67506..24995df 100644
--- a/build/OWNERS
+++ b/build/OWNERS
@@ -1 +1 @@
-file:/tools/OWNERS_ENG
+file:/tools/OWNERS_BUILD
diff --git a/build/config/android/config.gni b/build/config/android/config.gni
index c61d41a..f5def03 100644
--- a/build/config/android/config.gni
+++ b/build/config/android/config.gni
@@ -26,6 +26,9 @@
   # architecture, which is different than the names GN uses.
   if (host_cpu == "x64" || host_cpu == "x86") {
     android_host_arch = "x86_64"
+  } else if (host_cpu == "arm64") {
+    # Run existing Android toolchain via Rosetta.
+    android_host_arch = "x86_64"
   } else {
     assert(false, "Need Android toolchain support for your build CPU arch.")
   }
diff --git a/build/toolchain/win/setup_toolchain.py b/build/toolchain/win/setup_toolchain.py
index d1d4fb5..10b878a 100644
--- a/build/toolchain/win/setup_toolchain.py
+++ b/build/toolchain/win/setup_toolchain.py
@@ -118,8 +118,15 @@
     args.extend(('&&', 'set'))
     popen = subprocess.Popen(
         args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-    variables, _ = popen.communicate()
-    env = _ExtractImportantEnvironment(variables)
+    stdout_data, stderr_data = popen.communicate()
+    if popen.returncode != 0:
+      print('Error, got returncode:', popen.returncode)
+      print('## stdout:')
+      print(stdout_data)
+      print('## stderr:')
+      print(stderr_data)
+      sys.exit(2)
+    env = _ExtractImportantEnvironment(stdout_data)
     env['PATH'] = runtime_dirs + ';' + env['PATH']
 
     if cpu == target_cpu:
diff --git a/build/win/chrome_win.croc b/build/win/chrome_win.croc
deleted file mode 100644
index acf8e39..0000000
--- a/build/win/chrome_win.croc
+++ /dev/null
@@ -1,26 +0,0 @@
-# -*- python -*-
-# Crocodile config file for Chromium windows
-
-{
-  # List of rules, applied in order
-  'rules' : [
-    # Specify inclusions before exclusions, since rules are in order.
-
-    # Don't include ChromeOS, posix, or linux specific files
-    {
-      'regexp' : '.*(_|/)(chromeos|linux|posix)(\\.|_)',
-      'include' : 0,
-    },
-    # Don't include ChromeOS dirs
-    {
-      'regexp' : '.*/chromeos/',
-      'include' : 0,
-    },
-
-    # Groups
-    {
-      'regexp' : '.*_test_win\\.',
-      'group' : 'test',
-    },
-  ],
-}
diff --git a/build/win/compatibility.manifest b/build/win/compatibility.manifest
deleted file mode 100644
index 10d10da..0000000
--- a/build/win/compatibility.manifest
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
-  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
-    <application>
-      <!--The ID below indicates application support for Windows Vista -->
-      <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
-      <!--The ID below indicates application support for Windows 7 -->
-      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
-      <!--The ID below indicates application support for Windows 8 -->
-      <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
-      <!--The ID below indicates application support for Windows 8.1 -->
-      <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
-      <!--The ID below indicates application support for Windows 10 -->
-      <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
-    </application>
-  </compatibility>
-</assembly>
diff --git a/build/win/dbghelp_xp/README.chromium b/build/win/dbghelp_xp/README.chromium
deleted file mode 100644
index a52cfad..0000000
--- a/build/win/dbghelp_xp/README.chromium
+++ /dev/null
@@ -1,2 +0,0 @@
-This dbghelp.dll is the redistributable version from the Windows 7 SDK, the

-last one to work on Windows XP.

diff --git a/build/win/dbghelp_xp/dbghelp.dll b/build/win/dbghelp_xp/dbghelp.dll
deleted file mode 100755
index 9f52a5d..0000000
--- a/build/win/dbghelp_xp/dbghelp.dll
+++ /dev/null
Binary files differ
diff --git a/build/win/importlibs/create_importlib_win.py b/build/win/importlibs/create_importlib_win.py
deleted file mode 100755
index b23a7c0..0000000
--- a/build/win/importlibs/create_importlib_win.py
+++ /dev/null
@@ -1,213 +0,0 @@
-#!/usr/bin/env python3
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-"""Creates an import library from an import description file."""
-import ast
-import logging
-import optparse
-import os
-import os.path
-import shutil
-import subprocess
-import sys
-import tempfile
-
-_USAGE = """\
-Usage: %prog [options] [imports-file]
-
-Creates an import library from imports-file.
-
-Note: this script uses the microsoft assembler (ml.exe) and the library tool
-    (lib.exe), both of which must be in path.
-"""
-
-_ASM_STUB_HEADER = """\
-; This file is autogenerated by create_importlib_win.py, do not edit.
-.386
-.MODEL FLAT, C
-.CODE
-
-; Stubs to provide mangled names to lib.exe for the
-; correct generation of import libs.
-"""
-
-_DEF_STUB_HEADER = """\
-; This file is autogenerated by create_importlib_win.py, do not edit.
-
-; Export declarations for generating import libs.
-"""
-
-_LOGGER = logging.getLogger()
-
-
-class _Error(Exception):
-    pass
-
-
-class _ImportLibraryGenerator(object):
-
-    def __init__(self, temp_dir):
-        self._temp_dir = temp_dir
-
-    def _Shell(self, cmd, **kw):
-        ret = subprocess.call(cmd, **kw)
-        _LOGGER.info('Running "%s" returned %d.', cmd, ret)
-        if ret != 0:
-            raise _Error('Command "%s" returned %d.' % (cmd, ret))
-
-    def _ReadImportsFile(self, imports_file):
-        # Slurp the imports file.
-        return ast.literal_eval(open(imports_file).read())
-
-    def _WriteStubsFile(self, import_names, output_file):
-        output_file.write(_ASM_STUB_HEADER)
-
-        for name in import_names:
-            output_file.write('%s PROC\n' % name)
-            output_file.write('%s ENDP\n' % name)
-
-        output_file.write('END\n')
-
-    def _WriteDefFile(self, dll_name, import_names, output_file):
-        output_file.write(_DEF_STUB_HEADER)
-        output_file.write('NAME %s\n' % dll_name)
-        output_file.write('EXPORTS\n')
-        for name in import_names:
-            name = name.split('@')[0]
-            output_file.write('  %s\n' % name)
-
-    def _CreateObj(self, dll_name, imports):
-        """Writes an assembly file containing empty declarations.
-
-    For each imported function of the form:
-
-    AddClipboardFormatListener@4 PROC
-    AddClipboardFormatListener@4 ENDP
-
-    The resulting object file is then supplied to lib.exe with a .def file
-    declaring the corresponding non-adorned exports as they appear on the
-    exporting DLL, e.g.
-
-    EXPORTS
-      AddClipboardFormatListener
-
-    In combination, the .def file and the .obj file cause lib.exe to generate
-    an x86 import lib with public symbols named like
-    "__imp__AddClipboardFormatListener@4", binding to exports named like
-    "AddClipboardFormatListener".
-
-    All of this is perpetrated in a temporary directory, as the intermediate
-    artifacts are quick and easy to produce, and of no interest to anyone
-    after the fact."""
-
-        # Create an .asm file to provide stdcall-like stub names to lib.exe.
-        asm_name = dll_name + '.asm'
-        _LOGGER.info('Writing asm file "%s".', asm_name)
-        with open(os.path.join(self._temp_dir, asm_name), 'wb') as stubs_file:
-            self._WriteStubsFile(imports, stubs_file)
-
-        # Invoke on the assembler to compile it to .obj.
-        obj_name = dll_name + '.obj'
-        cmdline = ['ml.exe', '/nologo', '/c', asm_name, '/Fo', obj_name]
-        self._Shell(cmdline, cwd=self._temp_dir, stdout=open(os.devnull))
-
-        return obj_name
-
-    def _CreateImportLib(self, dll_name, imports, architecture, output_file):
-        """Creates an import lib binding imports to dll_name for architecture.
-
-    On success, writes the import library to output file.
-    """
-        obj_file = None
-
-        # For x86 architecture we have to provide an object file for correct
-        # name mangling between the import stubs and the exported functions.
-        if architecture == 'x86':
-            obj_file = self._CreateObj(dll_name, imports)
-
-        # Create the corresponding .def file. This file has the non stdcall-adorned
-        # names, as exported by the destination DLL.
-        def_name = dll_name + '.def'
-        _LOGGER.info('Writing def file "%s".', def_name)
-        with open(os.path.join(self._temp_dir, def_name), 'wb') as def_file:
-            self._WriteDefFile(dll_name, imports, def_file)
-
-        # Invoke on lib.exe to create the import library.
-        # We generate everything into the temporary directory, as the .exp export
-        # files will be generated at the same path as the import library, and we
-        # don't want those files potentially gunking the works.
-        dll_base_name, ext = os.path.splitext(dll_name)
-        lib_name = dll_base_name + '.lib'
-        cmdline = [
-            'lib.exe',
-            '/machine:%s' % architecture,
-            '/def:%s' % def_name,
-            '/out:%s' % lib_name
-        ]
-        if obj_file:
-            cmdline.append(obj_file)
-
-        self._Shell(cmdline, cwd=self._temp_dir, stdout=open(os.devnull))
-
-        # Copy the .lib file to the output directory.
-        shutil.copyfile(os.path.join(self._temp_dir, lib_name), output_file)
-        _LOGGER.info('Created "%s".', output_file)
-
-    def CreateImportLib(self, imports_file, output_file):
-        # Read the imports file.
-        imports = self._ReadImportsFile(imports_file)
-
-        # Creates the requested import library in the output directory.
-        self._CreateImportLib(imports['dll_name'], imports['imports'],
-                              imports.get('architecture', 'x86'), output_file)
-
-
-def main():
-    parser = optparse.OptionParser(usage=_USAGE)
-    parser.add_option(
-        '-o', '--output-file', help='Specifies the output file path.')
-    parser.add_option(
-        '-k',
-        '--keep-temp-dir',
-        action='store_true',
-        help='Keep the temporary directory.')
-    parser.add_option(
-        '-v', '--verbose', action='store_true', help='Verbose logging.')
-
-    options, args = parser.parse_args()
-
-    if len(args) != 1:
-        parser.error('You must provide an imports file.')
-
-    if not options.output_file:
-        parser.error('You must provide an output file.')
-
-    options.output_file = os.path.abspath(options.output_file)
-
-    if options.verbose:
-        logging.basicConfig(level=logging.INFO)
-    else:
-        logging.basicConfig(level=logging.WARN)
-
-    temp_dir = tempfile.mkdtemp()
-    _LOGGER.info('Created temporary directory "%s."', temp_dir)
-    try:
-        # Create a generator and create the import lib.
-        generator = _ImportLibraryGenerator(temp_dir)
-
-        ret = generator.CreateImportLib(args[0], options.output_file)
-    except Exception, e:
-        _LOGGER.exception('Failed to create import lib.')
-        ret = 1
-    finally:
-        if not options.keep_temp_dir:
-            shutil.rmtree(temp_dir)
-            _LOGGER.info('Deleted temporary directory "%s."', temp_dir)
-
-    return ret
-
-
-if __name__ == '__main__':
-    sys.exit(main())
diff --git a/build/win/importlibs/filter_export_list.py b/build/win/importlibs/filter_export_list.py
deleted file mode 100755
index b1fc122..0000000
--- a/build/win/importlibs/filter_export_list.py
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/usr/bin/env python3
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-"""Help maintaining DLL import lists."""
-import ast
-import optparse
-import re
-import sys
-
-_EXPORT_RE = re.compile(
-    r"""
-  ^\s*(?P<ordinal>[0-9]+)  # The ordinal field.
-  \s+(?P<hint>[0-9A-F]+)   # The hint field.
-  \s(?P<rva>........)      # The RVA field.
-  \s+(?P<name>[^ ]+)       # And finally the name we're really after.
-""", re.VERBOSE)
-
-_USAGE = r"""\
-Usage: %prog [options] [master-file]
-
-This script filters a list of exports from a DLL, generated from something
-like the following command line:
-
-C:\> dumpbin /exports user32.dll
-
-against a master list of imports built from e.g.
-
-C:\> dumpbin /exports user32.lib
-
-The point of this is to trim non-public exports from the list, and to
-normalize the names to their stdcall-mangled form for the generation of
-import libraries.
-Note that the export names from the latter incanatation are stdcall-mangled,
-e.g. they are suffixed with "@" and the number of argument bytes to the
-function.
-"""
-
-
-def _ReadMasterFile(master_file):
-    # Slurp the master file.
-    with open(master_file) as f:
-        master_exports = ast.literal_eval(f.read())
-
-    master_mapping = {}
-    for export in master_exports:
-        name = export.split('@')[0]
-        master_mapping[name] = export
-
-    return master_mapping
-
-
-def main():
-    parser = optparse.OptionParser(usage=_USAGE)
-    parser.add_option(
-        '-r',
-        '--reverse',
-        action='store_true',
-        help='Reverse the matching, e.g. return the functions '
-        'in the master list that aren\'t in the input.')
-
-    options, args = parser.parse_args()
-    if len(args) != 1:
-        parser.error('Must provide a master file.')
-
-    master_mapping = _ReadMasterFile(args[0])
-
-    found_exports = []
-    for line in sys.stdin:
-        match = _EXPORT_RE.match(line)
-        if match:
-            export_name = master_mapping.get(match.group('name'), None)
-            if export_name:
-                found_exports.append(export_name)
-
-    if options.reverse:
-        # Invert the found_exports list.
-        found_exports = set(master_mapping.values()) - set(found_exports)
-
-    # Sort the found exports for tidy output.
-    print('\n'.join(sorted(found_exports)))
-    return 0
-
-
-if __name__ == '__main__':
-    sys.exit(main())
diff --git a/build/win/importlibs/x86/user32.winxp.imports b/build/win/importlibs/x86/user32.winxp.imports
deleted file mode 100644
index 24403a8..0000000
--- a/build/win/importlibs/x86/user32.winxp.imports
+++ /dev/null
@@ -1,670 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-# This file is used to create a custom import library for Chrome's use of
-# user32.dll exports. The set of exports defined below
-{
-  'architecture': 'x86',
-
-  # The DLL to bind to.
-  'dll_name': 'user32.dll',
-
-  # Name of the generated import library.
-  'importlib_name': 'user32.winxp.lib',
-
-  # This is the set of exports observed on a user32.dll from Windows XP SP2.
-  # The version of the DLL where these were observed is 5.1.2600.2180.
-  # Incidentally this set of exports also coincides with Windows XP SP3, where
-  # the version of the DLL is 5.1.2600.5512.
-  # Don't add new imports here unless and until the minimal supported
-  # Windows version has been bumped past Windows XP SP2+.
-  'imports': [
-    'ActivateKeyboardLayout@8',
-    'AdjustWindowRect@12',
-    'AdjustWindowRectEx@16',
-    'AllowSetForegroundWindow@4',
-    'AnimateWindow@12',
-    'AnyPopup@0',
-    'AppendMenuA@16',
-    'AppendMenuW@16',
-    'ArrangeIconicWindows@4',
-    'AttachThreadInput@12',
-    'BeginDeferWindowPos@4',
-    'BeginPaint@8',
-    'BlockInput@4',
-    'BringWindowToTop@4',
-    'BroadcastSystemMessage@20',
-    'BroadcastSystemMessageA@20',
-    'BroadcastSystemMessageExA@24',
-    'BroadcastSystemMessageExW@24',
-    'BroadcastSystemMessageW@20',
-    'CallMsgFilter@8',
-    'CallMsgFilterA@8',
-    'CallMsgFilterW@8',
-    'CallNextHookEx@16',
-    'CallWindowProcA@20',
-    'CallWindowProcW@20',
-    'CascadeChildWindows@8',
-    'CascadeWindows@20',
-    'ChangeClipboardChain@8',
-    'ChangeDisplaySettingsA@8',
-    'ChangeDisplaySettingsExA@20',
-    'ChangeDisplaySettingsExW@20',
-    'ChangeDisplaySettingsW@8',
-    'ChangeMenuA@20',
-    'ChangeMenuW@20',
-    'CharLowerA@4',
-    'CharLowerBuffA@8',
-    'CharLowerBuffW@8',
-    'CharLowerW@4',
-    'CharNextA@4',
-    'CharNextExA@12',
-    'CharNextW@4',
-    'CharPrevA@8',
-    'CharPrevExA@16',
-    'CharPrevW@8',
-    'CharToOemA@8',
-    'CharToOemBuffA@12',
-    'CharToOemBuffW@12',
-    'CharToOemW@8',
-    'CharUpperA@4',
-    'CharUpperBuffA@8',
-    'CharUpperBuffW@8',
-    'CharUpperW@4',
-    'CheckDlgButton@12',
-    'CheckMenuItem@12',
-    'CheckMenuRadioItem@20',
-    'CheckRadioButton@16',
-    'ChildWindowFromPoint@12',
-    'ChildWindowFromPointEx@16',
-    'ClientToScreen@8',
-    'ClipCursor@4',
-    'CloseClipboard@0',
-    'CloseDesktop@4',
-    'CloseWindow@4',
-    'CloseWindowStation@4',
-    'CopyAcceleratorTableA@12',
-    'CopyAcceleratorTableW@12',
-    'CopyIcon@4',
-    'CopyImage@20',
-    'CopyRect@8',
-    'CountClipboardFormats@0',
-    'CreateAcceleratorTableA@8',
-    'CreateAcceleratorTableW@8',
-    'CreateCaret@16',
-    'CreateCursor@28',
-    'CreateDesktopA@24',
-    'CreateDesktopW@24',
-    'CreateDialogIndirectParamA@20',
-    'CreateDialogIndirectParamW@20',
-    'CreateDialogParamA@20',
-    'CreateDialogParamW@20',
-    'CreateIcon@28',
-    'CreateIconFromResource@16',
-    'CreateIconFromResourceEx@28',
-    'CreateIconIndirect@4',
-    'CreateMDIWindowA@40',
-    'CreateMDIWindowW@40',
-    'CreateMenu@0',
-    'CreatePopupMenu@0',
-    'CreateWindowExA@48',
-    'CreateWindowExW@48',
-    'CreateWindowStationA@16',
-    'CreateWindowStationW@16',
-    'DdeAbandonTransaction@12',
-    'DdeAccessData@8',
-    'DdeAddData@16',
-    'DdeClientTransaction@32',
-    'DdeCmpStringHandles@8',
-    'DdeConnect@16',
-    'DdeConnectList@20',
-    'DdeCreateDataHandle@28',
-    'DdeCreateStringHandleA@12',
-    'DdeCreateStringHandleW@12',
-    'DdeDisconnect@4',
-    'DdeDisconnectList@4',
-    'DdeEnableCallback@12',
-    'DdeFreeDataHandle@4',
-    'DdeFreeStringHandle@8',
-    'DdeGetData@16',
-    'DdeGetLastError@4',
-    'DdeImpersonateClient@4',
-    'DdeInitializeA@16',
-    'DdeInitializeW@16',
-    'DdeKeepStringHandle@8',
-    'DdeNameService@16',
-    'DdePostAdvise@12',
-    'DdeQueryConvInfo@12',
-    'DdeQueryNextServer@8',
-    'DdeQueryStringA@20',
-    'DdeQueryStringW@20',
-    'DdeReconnect@4',
-    'DdeSetQualityOfService@12',
-    'DdeSetUserHandle@12',
-    'DdeUnaccessData@4',
-    'DdeUninitialize@4',
-    'DefDlgProcA@16',
-    'DefDlgProcW@16',
-    'DefFrameProcA@20',
-    'DefFrameProcW@20',
-    'DefMDIChildProcA@16',
-    'DefMDIChildProcW@16',
-    'DefRawInputProc@12',
-    'DefWindowProcA@16',
-    'DefWindowProcW@16',
-    'DeferWindowPos@32',
-    'DeleteMenu@12',
-    'DeregisterShellHookWindow@4',
-    'DestroyAcceleratorTable@4',
-    'DestroyCaret@0',
-    'DestroyCursor@4',
-    'DestroyIcon@4',
-    'DestroyMenu@4',
-    'DestroyWindow@4',
-    'DialogBoxIndirectParamA@20',
-    'DialogBoxIndirectParamW@20',
-    'DialogBoxParamA@20',
-    'DialogBoxParamW@20',
-    'DisableProcessWindowsGhosting@0',
-    'DispatchMessageA@4',
-    'DispatchMessageW@4',
-    'DlgDirListA@20',
-    'DlgDirListComboBoxA@20',
-    'DlgDirListComboBoxW@20',
-    'DlgDirListW@20',
-    'DlgDirSelectComboBoxExA@16',
-    'DlgDirSelectComboBoxExW@16',
-    'DlgDirSelectExA@16',
-    'DlgDirSelectExW@16',
-    'DragDetect@12',
-    'DragObject@20',
-    'DrawAnimatedRects@16',
-    'DrawCaption@16',
-    'DrawEdge@16',
-    'DrawFocusRect@8',
-    'DrawFrame@16',
-    'DrawFrameControl@16',
-    'DrawIcon@16',
-    'DrawIconEx@36',
-    'DrawMenuBar@4',
-    'DrawStateA@40',
-    'DrawStateW@40',
-    'DrawTextA@20',
-    'DrawTextExA@24',
-    'DrawTextExW@24',
-    'DrawTextW@20',
-    'EditWndProc@16',
-    'EmptyClipboard@0',
-    'EnableMenuItem@12',
-    'EnableScrollBar@12',
-    'EnableWindow@8',
-    'EndDeferWindowPos@4',
-    'EndDialog@8',
-    'EndMenu@0',
-    'EndPaint@8',
-    'EndTask@12',
-    'EnumChildWindows@12',
-    'EnumClipboardFormats@4',
-    'EnumDesktopWindows@12',
-    'EnumDesktopsA@12',
-    'EnumDesktopsW@12',
-    'EnumDisplayDevicesA@16',
-    'EnumDisplayDevicesW@16',
-    'EnumDisplayMonitors@16',
-    'EnumDisplaySettingsA@12',
-    'EnumDisplaySettingsExA@16',
-    'EnumDisplaySettingsExW@16',
-    'EnumDisplaySettingsW@12',
-    'EnumPropsA@8',
-    'EnumPropsExA@12',
-    'EnumPropsExW@12',
-    'EnumPropsW@8',
-    'EnumThreadWindows@12',
-    'EnumWindowStationsA@8',
-    'EnumWindowStationsW@8',
-    'EnumWindows@8',
-    'EqualRect@8',
-    'ExcludeUpdateRgn@8',
-    'ExitWindowsEx@8',
-    'FillRect@12',
-    'FindWindowA@8',
-    'FindWindowExA@16',
-    'FindWindowExW@16',
-    'FindWindowW@8',
-    'FlashWindow@8',
-    'FlashWindowEx@4',
-    'FrameRect@12',
-    'FreeDDElParam@8',
-    'GetActiveWindow@0',
-    'GetAltTabInfo@20',
-    'GetAltTabInfoA@20',
-    'GetAltTabInfoW@20',
-    'GetAncestor@8',
-    'GetAsyncKeyState@4',
-    'GetCapture@0',
-    'GetCaretBlinkTime@0',
-    'GetCaretPos@4',
-    'GetClassInfoA@12',
-    'GetClassInfoExA@12',
-    'GetClassInfoExW@12',
-    'GetClassInfoW@12',
-    'GetClassLongA@8',
-    'GetClassLongW@8',
-    'GetClassNameA@12',
-    'GetClassNameW@12',
-    'GetClassWord@8',
-    'GetClientRect@8',
-    'GetClipCursor@4',
-    'GetClipboardData@4',
-    'GetClipboardFormatNameA@12',
-    'GetClipboardFormatNameW@12',
-    'GetClipboardOwner@0',
-    'GetClipboardSequenceNumber@0',
-    'GetClipboardViewer@0',
-    'GetComboBoxInfo@8',
-    'GetCursor@0',
-    'GetCursorInfo@4',
-    'GetCursorPos@4',
-    'GetDC@4',
-    'GetDCEx@12',
-    'GetDesktopWindow@0',
-    'GetDialogBaseUnits@0',
-    'GetDlgCtrlID@4',
-    'GetDlgItem@8',
-    'GetDlgItemInt@16',
-    'GetDlgItemTextA@16',
-    'GetDlgItemTextW@16',
-    'GetDoubleClickTime@0',
-    'GetFocus@0',
-    'GetForegroundWindow@0',
-    'GetGUIThreadInfo@8',
-    'GetGuiResources@8',
-    'GetIconInfo@8',
-    'GetInputDesktop@0',
-    'GetInputState@0',
-    'GetKBCodePage@0',
-    'GetKeyNameTextA@12',
-    'GetKeyNameTextW@12',
-    'GetKeyState@4',
-    'GetKeyboardLayout@4',
-    'GetKeyboardLayoutList@8',
-    'GetKeyboardLayoutNameA@4',
-    'GetKeyboardLayoutNameW@4',
-    'GetKeyboardState@4',
-    'GetKeyboardType@4',
-    'GetLastActivePopup@4',
-    'GetLastInputInfo@4',
-    'GetLayeredWindowAttributes@16',
-    'GetListBoxInfo@4',
-    'GetMenu@4',
-    'GetMenuBarInfo@16',
-    'GetMenuCheckMarkDimensions@0',
-    'GetMenuContextHelpId@4',
-    'GetMenuDefaultItem@12',
-    'GetMenuInfo@8',
-    'GetMenuItemCount@4',
-    'GetMenuItemID@8',
-    'GetMenuItemInfoA@16',
-    'GetMenuItemInfoW@16',
-    'GetMenuItemRect@16',
-    'GetMenuState@12',
-    'GetMenuStringA@20',
-    'GetMenuStringW@20',
-    'GetMessageA@16',
-    'GetMessageExtraInfo@0',
-    'GetMessagePos@0',
-    'GetMessageTime@0',
-    'GetMessageW@16',
-    'GetMonitorInfoA@8',
-    'GetMonitorInfoW@8',
-    'GetMouseMovePointsEx@20',
-    'GetNextDlgGroupItem@12',
-    'GetNextDlgTabItem@12',
-    'GetOpenClipboardWindow@0',
-    'GetParent@4',
-    'GetPriorityClipboardFormat@8',
-    'GetProcessDefaultLayout@4',
-    'GetProcessWindowStation@0',
-    'GetPropA@8',
-    'GetPropW@8',
-    'GetQueueStatus@4',
-    'GetRawInputBuffer@12',
-    'GetRawInputData@20',
-    'GetRawInputDeviceInfoA@16',
-    'GetRawInputDeviceInfoW@16',
-    'GetRawInputDeviceList@12',
-    'GetRegisteredRawInputDevices@12',
-    'GetScrollBarInfo@12',
-    'GetScrollInfo@12',
-    'GetScrollPos@8',
-    'GetScrollRange@16',
-    'GetShellWindow@0',
-    'GetSubMenu@8',
-    'GetSysColor@4',
-    'GetSysColorBrush@4',
-    'GetSystemMenu@8',
-    'GetSystemMetrics@4',
-    'GetTabbedTextExtentA@20',
-    'GetTabbedTextExtentW@20',
-    'GetThreadDesktop@4',
-    'GetTitleBarInfo@8',
-    'GetTopWindow@4',
-    'GetUpdateRect@12',
-    'GetUpdateRgn@12',
-    'GetUserObjectInformationA@20',
-    'GetUserObjectInformationW@20',
-    'GetUserObjectSecurity@20',
-    'GetWindow@8',
-    'GetWindowContextHelpId@4',
-    'GetWindowDC@4',
-    'GetWindowInfo@8',
-    'GetWindowLongA@8',
-    'GetWindowLongW@8',
-    'GetWindowModuleFileName@12',
-    'GetWindowModuleFileNameA@12',
-    'GetWindowModuleFileNameW@12',
-    'GetWindowPlacement@8',
-    'GetWindowRect@8',
-    'GetWindowRgn@8',
-    'GetWindowRgnBox@8',
-    'GetWindowTextA@12',
-    'GetWindowTextLengthA@4',
-    'GetWindowTextLengthW@4',
-    'GetWindowTextW@12',
-    'GetWindowThreadProcessId@8',
-    'GetWindowWord@8',
-    'GrayStringA@36',
-    'GrayStringW@36',
-    'HideCaret@4',
-    'HiliteMenuItem@16',
-    'IMPGetIMEA@8',
-    'IMPGetIMEW@8',
-    'IMPQueryIMEA@4',
-    'IMPQueryIMEW@4',
-    'IMPSetIMEA@8',
-    'IMPSetIMEW@8',
-    'ImpersonateDdeClientWindow@8',
-    'InSendMessage@0',
-    'InSendMessageEx@4',
-    'InflateRect@12',
-    'InsertMenuA@20',
-    'InsertMenuItemA@16',
-    'InsertMenuItemW@16',
-    'InsertMenuW@20',
-    'InternalGetWindowText@12',
-    'IntersectRect@12',
-    'InvalidateRect@12',
-    'InvalidateRgn@12',
-    'InvertRect@8',
-    'IsCharAlphaA@4',
-    'IsCharAlphaNumericA@4',
-    'IsCharAlphaNumericW@4',
-    'IsCharAlphaW@4',
-    'IsCharLowerA@4',
-    'IsCharLowerW@4',
-    'IsCharUpperA@4',
-    'IsCharUpperW@4',
-    'IsChild@8',
-    'IsClipboardFormatAvailable@4',
-    'IsDialogMessage@8',
-    'IsDialogMessageA@8',
-    'IsDialogMessageW@8',
-    'IsDlgButtonChecked@8',
-    'IsGUIThread@4',
-    'IsHungAppWindow@4',
-    'IsIconic@4',
-    'IsMenu@4',
-    'IsRectEmpty@4',
-    'IsWinEventHookInstalled@4',
-    'IsWindow@4',
-    'IsWindowEnabled@4',
-    'IsWindowUnicode@4',
-    'IsWindowVisible@4',
-    'IsZoomed@4',
-    'KillTimer@8',
-    'LoadAcceleratorsA@8',
-    'LoadAcceleratorsW@8',
-    'LoadBitmapA@8',
-    'LoadBitmapW@8',
-    'LoadCursorA@8',
-    'LoadCursorFromFileA@4',
-    'LoadCursorFromFileW@4',
-    'LoadCursorW@8',
-    'LoadIconA@8',
-    'LoadIconW@8',
-    'LoadImageA@24',
-    'LoadImageW@24',
-    'LoadKeyboardLayoutA@8',
-    'LoadKeyboardLayoutW@8',
-    'LoadMenuA@8',
-    'LoadMenuIndirectA@4',
-    'LoadMenuIndirectW@4',
-    'LoadMenuW@8',
-    'LoadStringA@16',
-    'LoadStringW@16',
-    'LockSetForegroundWindow@4',
-    'LockWindowUpdate@4',
-    'LockWorkStation@0',
-    'LookupIconIdFromDirectory@8',
-    'LookupIconIdFromDirectoryEx@20',
-    'MapDialogRect@8',
-    'MapVirtualKeyA@8',
-    'MapVirtualKeyExA@12',
-    'MapVirtualKeyExW@12',
-    'MapVirtualKeyW@8',
-    'MapWindowPoints@16',
-    'MenuItemFromPoint@16',
-    'MessageBeep@4',
-    'MessageBoxA@16',
-    'MessageBoxExA@20',
-    'MessageBoxExW@20',
-    'MessageBoxIndirectA@4',
-    'MessageBoxIndirectW@4',
-    'MessageBoxTimeoutA@24',
-    'MessageBoxTimeoutW@24',
-    'MessageBoxW@16',
-    'ModifyMenuA@20',
-    'ModifyMenuW@20',
-    'MonitorFromPoint@12',
-    'MonitorFromRect@8',
-    'MonitorFromWindow@8',
-    'MoveWindow@24',
-    'MsgWaitForMultipleObjects@20',
-    'MsgWaitForMultipleObjectsEx@20',
-    'NotifyWinEvent@16',
-    'OemKeyScan@4',
-    'OemToCharA@8',
-    'OemToCharBuffA@12',
-    'OemToCharBuffW@12',
-    'OemToCharW@8',
-    'OffsetRect@12',
-    'OpenClipboard@4',
-    'OpenDesktopA@16',
-    'OpenDesktopW@16',
-    'OpenIcon@4',
-    'OpenInputDesktop@12',
-    'OpenWindowStationA@12',
-    'OpenWindowStationW@12',
-    'PackDDElParam@12',
-    'PaintDesktop@4',
-    'PeekMessageA@20',
-    'PeekMessageW@20',
-    'PostMessageA@16',
-    'PostMessageW@16',
-    'PostQuitMessage@4',
-    'PostThreadMessageA@16',
-    'PostThreadMessageW@16',
-    'PrintWindow@12',
-    'PrivateExtractIconsA@32',
-    'PrivateExtractIconsW@32',
-    'PtInRect@12',
-    'RealChildWindowFromPoint@12',
-    'RealGetWindowClass@12',
-    'RealGetWindowClassA@12',
-    'RealGetWindowClassW@12',
-    'RedrawWindow@16',
-    'RegisterClassA@4',
-    'RegisterClassExA@4',
-    'RegisterClassExW@4',
-    'RegisterClassW@4',
-    'RegisterClipboardFormatA@4',
-    'RegisterClipboardFormatW@4',
-    'RegisterDeviceNotificationA@12',
-    'RegisterDeviceNotificationW@12',
-    'RegisterHotKey@16',
-    'RegisterRawInputDevices@12',
-    'RegisterShellHookWindow@4',
-    'RegisterWindowMessageA@4',
-    'RegisterWindowMessageW@4',
-    'ReleaseCapture@0',
-    'ReleaseDC@8',
-    'RemoveMenu@12',
-    'RemovePropA@8',
-    'RemovePropW@8',
-    'ReplyMessage@4',
-    'ReuseDDElParam@20',
-    'ScreenToClient@8',
-    'ScrollDC@28',
-    'ScrollWindow@20',
-    'ScrollWindowEx@32',
-    'SendDlgItemMessageA@20',
-    'SendDlgItemMessageW@20',
-    'SendIMEMessageExA@8',
-    'SendIMEMessageExW@8',
-    'SendInput@12',
-    'SendMessageA@16',
-    'SendMessageCallbackA@24',
-    'SendMessageCallbackW@24',
-    'SendMessageTimeoutA@28',
-    'SendMessageTimeoutW@28',
-    'SendMessageW@16',
-    'SendNotifyMessageA@16',
-    'SendNotifyMessageW@16',
-    'SetActiveWindow@4',
-    'SetCapture@4',
-    'SetCaretBlinkTime@4',
-    'SetCaretPos@8',
-    'SetClassLongA@12',
-    'SetClassLongW@12',
-    'SetClassWord@12',
-    'SetClipboardData@8',
-    'SetClipboardViewer@4',
-    'SetCursor@4',
-    'SetCursorPos@8',
-    'SetDebugErrorLevel@4',
-    'SetDeskWallpaper@4',
-    'SetDlgItemInt@16',
-    'SetDlgItemTextA@12',
-    'SetDlgItemTextW@12',
-    'SetDoubleClickTime@4',
-    'SetFocus@4',
-    'SetForegroundWindow@4',
-    'SetKeyboardState@4',
-    'SetLastErrorEx@8',
-    'SetLayeredWindowAttributes@16',
-    'SetMenu@8',
-    'SetMenuContextHelpId@8',
-    'SetMenuDefaultItem@12',
-    'SetMenuInfo@8',
-    'SetMenuItemBitmaps@20',
-    'SetMenuItemInfoA@16',
-    'SetMenuItemInfoW@16',
-    'SetMessageExtraInfo@4',
-    'SetMessageQueue@4',
-    'SetParent@8',
-    'SetProcessDefaultLayout@4',
-    'SetProcessWindowStation@4',
-    'SetPropA@12',
-    'SetPropW@12',
-    'SetRect@20',
-    'SetRectEmpty@4',
-    'SetScrollInfo@16',
-    'SetScrollPos@16',
-    'SetScrollRange@20',
-    'SetShellWindow@4',
-    'SetSysColors@12',
-    'SetSystemCursor@8',
-    'SetThreadDesktop@4',
-    'SetTimer@16',
-    'SetUserObjectInformationA@16',
-    'SetUserObjectInformationW@16',
-    'SetUserObjectSecurity@12',
-    'SetWinEventHook@28',
-    'SetWindowContextHelpId@8',
-    'SetWindowLongA@12',
-    'SetWindowLongW@12',
-    'SetWindowPlacement@8',
-    'SetWindowPos@28',
-    'SetWindowRgn@12',
-    'SetWindowTextA@8',
-    'SetWindowTextW@8',
-    'SetWindowWord@12',
-    'SetWindowsHookA@8',
-    'SetWindowsHookExA@16',
-    'SetWindowsHookExW@16',
-    'SetWindowsHookW@8',
-    'ShowCaret@4',
-    'ShowCursor@4',
-    'ShowOwnedPopups@8',
-    'ShowScrollBar@12',
-    'ShowWindow@8',
-    'ShowWindowAsync@8',
-    'SubtractRect@12',
-    'SwapMouseButton@4',
-    'SwitchDesktop@4',
-    'SwitchToThisWindow@8',
-    'SystemParametersInfoA@16',
-    'SystemParametersInfoW@16',
-    'TabbedTextOutA@32',
-    'TabbedTextOutW@32',
-    'TileChildWindows@8',
-    'TileWindows@20',
-    'ToAscii@20',
-    'ToAsciiEx@24',
-    'ToUnicode@24',
-    'ToUnicodeEx@28',
-    'TrackMouseEvent@4',
-    'TrackPopupMenu@28',
-    'TrackPopupMenuEx@24',
-    'TranslateAccelerator@12',
-    'TranslateAcceleratorA@12',
-    'TranslateAcceleratorW@12',
-    'TranslateMDISysAccel@8',
-    'TranslateMessage@4',
-    'UnhookWinEvent@4',
-    'UnhookWindowsHook@8',
-    'UnhookWindowsHookEx@4',
-    'UnionRect@12',
-    'UnloadKeyboardLayout@4',
-    'UnpackDDElParam@16',
-    'UnregisterClassA@8',
-    'UnregisterClassW@8',
-    'UnregisterDeviceNotification@4',
-    'UnregisterHotKey@8',
-    'UpdateLayeredWindow@36',
-    'UpdateWindow@4',
-    'UserHandleGrantAccess@12',
-    'ValidateRect@8',
-    'ValidateRgn@8',
-    'VkKeyScanA@4',
-    'VkKeyScanExA@8',
-    'VkKeyScanExW@8',
-    'VkKeyScanW@4',
-    'WINNLSEnableIME@8',
-    'WINNLSGetEnableStatus@4',
-    'WINNLSGetIMEHotkey@4',
-    'WaitForInputIdle@8',
-    'WaitMessage@0',
-    'WinHelpA@16',
-    'WinHelpW@16',
-    'WindowFromDC@4',
-    'WindowFromPoint@8',
-    'keybd_event@16',
-    'mouse_event@20',
-    'wsprintfA',
-    'wsprintfW',
-    'wvsprintfA@12',
-    'wvsprintfW@12',
-  ]
-}
diff --git a/build/win/importlibs/x86/user32.winxp.lib b/build/win/importlibs/x86/user32.winxp.lib
deleted file mode 100644
index deb5577..0000000
--- a/build/win/importlibs/x86/user32.winxp.lib
+++ /dev/null
Binary files differ
diff --git a/build/win/reorder-imports.py b/build/win/reorder-imports.py
deleted file mode 100755
index 45c4c9a..0000000
--- a/build/win/reorder-imports.py
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/usr/bin/env python3
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import glob
-import optparse
-import os
-import shutil
-import subprocess
-import sys
-
-
-def reorder_imports(input_dir, output_dir, architecture):
-    """Run swapimports.exe on the initial chrome.exe, and write to the output
-  directory. Also copy over any related files that might be needed
-  (pdbs, manifests etc.).
-  """
-
-    input_image = os.path.join(input_dir, 'chrome.exe')
-    output_image = os.path.join(output_dir, 'chrome.exe')
-
-    swap_exe = os.path.join(
-        __file__,
-        '..\\..\\..\\third_party\\syzygy\\binaries\\exe\\swapimport.exe')
-
-    args = [
-        swap_exe,
-        '--input-image=%s' % input_image,
-        '--output-image=%s' % output_image, '--overwrite', '--no-logo'
-    ]
-
-    if architecture == 'x64':
-        args.append('--x64')
-
-    args.append('chrome_elf.dll')
-
-    subprocess.call(args)
-
-    for fname in glob.iglob(os.path.join(input_dir, 'chrome.exe.*')):
-        shutil.copy(fname, os.path.join(output_dir, os.path.basename(fname)))
-    return 0
-
-
-def main(argv):
-    usage = 'reorder_imports.py -i <input_dir> -o <output_dir> -a <target_arch>'
-    parser = optparse.OptionParser(usage=usage)
-    parser.add_option(
-        '-i', '--input', help='reorder chrome.exe in DIR', metavar='DIR')
-    parser.add_option(
-        '-o', '--output', help='write new chrome.exe to DIR', metavar='DIR')
-    parser.add_option(
-        '-a', '--arch', help='architecture of build (optional)', default='ia32')
-    opts, args = parser.parse_args()
-
-    if not opts.input or not opts.output:
-        parser.error('Please provide and input and output directory')
-    return reorder_imports(opts.input, opts.output, opts.arch)
-
-
-if __name__ == "__main__":
-    sys.exit(main(sys.argv[1:]))
diff --git a/build/win/use_ansi_codes.py b/build/win/use_ansi_codes.py
deleted file mode 100755
index c453c7b..0000000
--- a/build/win/use_ansi_codes.py
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env python3
-# Copyright (c) 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-"""Prints if the terminal is likely to understand ANSI codes."""
-
-import os
-
-# Add more terminals here as needed.
-print('ANSICON' in os.environ)
diff --git a/pkg/.gitignore b/pkg/.gitignore
index b95fe80..46ccecf 100644
--- a/pkg/.gitignore
+++ b/pkg/.gitignore
@@ -10,4 +10,3 @@
 .dart_tool
 .idea/
 .packages
-analysis_server/language_model/
diff --git a/pkg/_fe_analyzer_shared/benchmark/exhaustiveness/large_fields_call_counts.dart b/pkg/_fe_analyzer_shared/benchmark/exhaustiveness/large_fields_call_counts.dart
new file mode 100644
index 0000000..ec1695f
--- /dev/null
+++ b/pkg/_fe_analyzer_shared/benchmark/exhaustiveness/large_fields_call_counts.dart
@@ -0,0 +1,116 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:_fe_analyzer_shared/src/exhaustiveness/exhaustive.dart';
+import 'package:_fe_analyzer_shared/src/exhaustiveness/profile.dart' as profile;
+import 'package:_fe_analyzer_shared/src/exhaustiveness/space.dart';
+import 'package:_fe_analyzer_shared/src/exhaustiveness/static_type.dart';
+
+import '../../test/exhaustiveness/utils.dart';
+
+void main() {
+  profile.enabled = true;
+
+  //   (A)
+  //   /|\
+  //  B C D
+  var a = StaticType('A', isSealed: true);
+  var b = StaticType('B', inherits: [a]);
+  var c = StaticType('C', inherits: [a]);
+  var d = StaticType('D', inherits: [a]);
+  var t = StaticType('T', fields: {'w': a, 'x': a, 'y': a, 'z': a});
+
+  expectExhaustiveOnlyAll(t, [
+    {'w': b, 'x': b, 'y': b, 'z': b},
+    {'w': b, 'x': b, 'y': b, 'z': c},
+    {'w': b, 'x': b, 'y': b, 'z': d},
+    {'w': b, 'x': b, 'y': c, 'z': b},
+    {'w': b, 'x': b, 'y': c, 'z': c},
+    {'w': b, 'x': b, 'y': c, 'z': d},
+    {'w': b, 'x': b, 'y': d, 'z': b},
+    {'w': b, 'x': b, 'y': d, 'z': c},
+    {'w': b, 'x': b, 'y': d, 'z': d},
+    {'w': b, 'x': c, 'y': b, 'z': b},
+    {'w': b, 'x': c, 'y': b, 'z': c},
+    {'w': b, 'x': c, 'y': b, 'z': d},
+    {'w': b, 'x': c, 'y': c, 'z': b},
+    {'w': b, 'x': c, 'y': c, 'z': c},
+    {'w': b, 'x': c, 'y': c, 'z': d},
+    {'w': b, 'x': c, 'y': d, 'z': b},
+    {'w': b, 'x': c, 'y': d, 'z': c},
+    {'w': b, 'x': c, 'y': d, 'z': d},
+    {'w': b, 'x': d, 'y': b, 'z': b},
+    {'w': b, 'x': d, 'y': b, 'z': c},
+    {'w': b, 'x': d, 'y': b, 'z': d},
+    {'w': b, 'x': d, 'y': c, 'z': b},
+    {'w': b, 'x': d, 'y': c, 'z': c},
+    {'w': b, 'x': d, 'y': c, 'z': d},
+    {'w': b, 'x': d, 'y': d, 'z': b},
+    {'w': b, 'x': d, 'y': d, 'z': c},
+    {'w': b, 'x': d, 'y': d, 'z': d},
+    {'w': c, 'x': b, 'y': b, 'z': b},
+    {'w': c, 'x': b, 'y': b, 'z': c},
+    {'w': c, 'x': b, 'y': b, 'z': d},
+    {'w': c, 'x': b, 'y': c, 'z': b},
+    {'w': c, 'x': b, 'y': c, 'z': c},
+    {'w': c, 'x': b, 'y': c, 'z': d},
+    {'w': c, 'x': b, 'y': d, 'z': b},
+    {'w': c, 'x': b, 'y': d, 'z': c},
+    {'w': c, 'x': b, 'y': d, 'z': d},
+    {'w': c, 'x': c, 'y': b, 'z': b},
+    {'w': c, 'x': c, 'y': b, 'z': c},
+    {'w': c, 'x': c, 'y': b, 'z': d},
+    {'w': c, 'x': c, 'y': c, 'z': b},
+    {'w': c, 'x': c, 'y': c, 'z': c},
+    {'w': c, 'x': c, 'y': c, 'z': d},
+    {'w': c, 'x': c, 'y': d, 'z': b},
+    {'w': c, 'x': c, 'y': d, 'z': c},
+    {'w': c, 'x': c, 'y': d, 'z': d},
+    {'w': c, 'x': d, 'y': b, 'z': b},
+    {'w': c, 'x': d, 'y': b, 'z': c},
+    {'w': c, 'x': d, 'y': b, 'z': d},
+    {'w': c, 'x': d, 'y': c, 'z': b},
+    {'w': c, 'x': d, 'y': c, 'z': c},
+    {'w': c, 'x': d, 'y': c, 'z': d},
+    {'w': c, 'x': d, 'y': d, 'z': b},
+    {'w': c, 'x': d, 'y': d, 'z': c},
+    {'w': c, 'x': d, 'y': d, 'z': d},
+    {'w': d, 'x': b, 'y': b, 'z': b},
+    {'w': d, 'x': b, 'y': b, 'z': c},
+    {'w': d, 'x': b, 'y': b, 'z': d},
+    {'w': d, 'x': b, 'y': c, 'z': b},
+    {'w': d, 'x': b, 'y': c, 'z': c},
+    {'w': d, 'x': b, 'y': c, 'z': d},
+    {'w': d, 'x': b, 'y': d, 'z': b},
+    {'w': d, 'x': b, 'y': d, 'z': c},
+    {'w': d, 'x': b, 'y': d, 'z': d},
+    {'w': d, 'x': c, 'y': b, 'z': b},
+    {'w': d, 'x': c, 'y': b, 'z': c},
+    {'w': d, 'x': c, 'y': b, 'z': d},
+    {'w': d, 'x': c, 'y': c, 'z': b},
+    {'w': d, 'x': c, 'y': c, 'z': c},
+    {'w': d, 'x': c, 'y': c, 'z': d},
+    {'w': d, 'x': c, 'y': d, 'z': b},
+    {'w': d, 'x': c, 'y': d, 'z': c},
+    {'w': d, 'x': c, 'y': d, 'z': d},
+    {'w': d, 'x': d, 'y': b, 'z': b},
+    {'w': d, 'x': d, 'y': b, 'z': c},
+    {'w': d, 'x': d, 'y': b, 'z': d},
+    {'w': d, 'x': d, 'y': c, 'z': b},
+    {'w': d, 'x': d, 'y': c, 'z': c},
+    {'w': d, 'x': d, 'y': c, 'z': d},
+    {'w': d, 'x': d, 'y': d, 'z': b},
+    {'w': d, 'x': d, 'y': d, 'z': c},
+    {'w': d, 'x': d, 'y': d, 'z': d},
+  ]);
+}
+
+/// Test that [cases] are exhaustive over [type] if and only if all cases are
+/// included and that all subsets of the cases are not exhaustive.
+void expectExhaustiveOnlyAll(StaticType type, List<Object> cases) {
+  var spaces = parseSpaces(cases);
+  profile.reset();
+  print(isExhaustive(Space(type), spaces));
+  profile.log();
+}
diff --git a/pkg/_fe_analyzer_shared/benchmark/exhaustiveness/large_fields_timed.dart b/pkg/_fe_analyzer_shared/benchmark/exhaustiveness/large_fields_timed.dart
new file mode 100644
index 0000000..ae2b282
--- /dev/null
+++ b/pkg/_fe_analyzer_shared/benchmark/exhaustiveness/large_fields_timed.dart
@@ -0,0 +1,128 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:math';
+
+import 'package:_fe_analyzer_shared/src/exhaustiveness/exhaustive.dart';
+import 'package:_fe_analyzer_shared/src/exhaustiveness/space.dart';
+import 'package:_fe_analyzer_shared/src/exhaustiveness/static_type.dart';
+
+import '../../test/exhaustiveness/utils.dart';
+
+void main() {
+  //   (A)
+  //   /|\
+  //  B C D
+  var a = StaticType('A', isSealed: true);
+  var b = StaticType('B', inherits: [a]);
+  var c = StaticType('C', inherits: [a]);
+  var d = StaticType('D', inherits: [a]);
+  var t = StaticType('T', fields: {'w': a, 'x': a, 'y': a, 'z': a});
+
+  expectExhaustiveOnlyAll(t, [
+    {'w': b, 'x': b, 'y': b, 'z': b},
+    {'w': b, 'x': b, 'y': b, 'z': c},
+    {'w': b, 'x': b, 'y': b, 'z': d},
+    {'w': b, 'x': b, 'y': c, 'z': b},
+    {'w': b, 'x': b, 'y': c, 'z': c},
+    {'w': b, 'x': b, 'y': c, 'z': d},
+    {'w': b, 'x': b, 'y': d, 'z': b},
+    {'w': b, 'x': b, 'y': d, 'z': c},
+    {'w': b, 'x': b, 'y': d, 'z': d},
+    {'w': b, 'x': c, 'y': b, 'z': b},
+    {'w': b, 'x': c, 'y': b, 'z': c},
+    {'w': b, 'x': c, 'y': b, 'z': d},
+    {'w': b, 'x': c, 'y': c, 'z': b},
+    {'w': b, 'x': c, 'y': c, 'z': c},
+    {'w': b, 'x': c, 'y': c, 'z': d},
+    {'w': b, 'x': c, 'y': d, 'z': b},
+    {'w': b, 'x': c, 'y': d, 'z': c},
+    {'w': b, 'x': c, 'y': d, 'z': d},
+    {'w': b, 'x': d, 'y': b, 'z': b},
+    {'w': b, 'x': d, 'y': b, 'z': c},
+    {'w': b, 'x': d, 'y': b, 'z': d},
+    {'w': b, 'x': d, 'y': c, 'z': b},
+    {'w': b, 'x': d, 'y': c, 'z': c},
+    {'w': b, 'x': d, 'y': c, 'z': d},
+    {'w': b, 'x': d, 'y': d, 'z': b},
+    {'w': b, 'x': d, 'y': d, 'z': c},
+    {'w': b, 'x': d, 'y': d, 'z': d},
+    {'w': c, 'x': b, 'y': b, 'z': b},
+    {'w': c, 'x': b, 'y': b, 'z': c},
+    {'w': c, 'x': b, 'y': b, 'z': d},
+    {'w': c, 'x': b, 'y': c, 'z': b},
+    {'w': c, 'x': b, 'y': c, 'z': c},
+    {'w': c, 'x': b, 'y': c, 'z': d},
+    {'w': c, 'x': b, 'y': d, 'z': b},
+    {'w': c, 'x': b, 'y': d, 'z': c},
+    {'w': c, 'x': b, 'y': d, 'z': d},
+    {'w': c, 'x': c, 'y': b, 'z': b},
+    {'w': c, 'x': c, 'y': b, 'z': c},
+    {'w': c, 'x': c, 'y': b, 'z': d},
+    {'w': c, 'x': c, 'y': c, 'z': b},
+    {'w': c, 'x': c, 'y': c, 'z': c},
+    {'w': c, 'x': c, 'y': c, 'z': d},
+    {'w': c, 'x': c, 'y': d, 'z': b},
+    {'w': c, 'x': c, 'y': d, 'z': c},
+    {'w': c, 'x': c, 'y': d, 'z': d},
+    {'w': c, 'x': d, 'y': b, 'z': b},
+    {'w': c, 'x': d, 'y': b, 'z': c},
+    {'w': c, 'x': d, 'y': b, 'z': d},
+    {'w': c, 'x': d, 'y': c, 'z': b},
+    {'w': c, 'x': d, 'y': c, 'z': c},
+    {'w': c, 'x': d, 'y': c, 'z': d},
+    {'w': c, 'x': d, 'y': d, 'z': b},
+    {'w': c, 'x': d, 'y': d, 'z': c},
+    {'w': c, 'x': d, 'y': d, 'z': d},
+    {'w': d, 'x': b, 'y': b, 'z': b},
+    {'w': d, 'x': b, 'y': b, 'z': c},
+    {'w': d, 'x': b, 'y': b, 'z': d},
+    {'w': d, 'x': b, 'y': c, 'z': b},
+    {'w': d, 'x': b, 'y': c, 'z': c},
+    {'w': d, 'x': b, 'y': c, 'z': d},
+    {'w': d, 'x': b, 'y': d, 'z': b},
+    {'w': d, 'x': b, 'y': d, 'z': c},
+    {'w': d, 'x': b, 'y': d, 'z': d},
+    {'w': d, 'x': c, 'y': b, 'z': b},
+    {'w': d, 'x': c, 'y': b, 'z': c},
+    {'w': d, 'x': c, 'y': b, 'z': d},
+    {'w': d, 'x': c, 'y': c, 'z': b},
+    {'w': d, 'x': c, 'y': c, 'z': c},
+    {'w': d, 'x': c, 'y': c, 'z': d},
+    {'w': d, 'x': c, 'y': d, 'z': b},
+    {'w': d, 'x': c, 'y': d, 'z': c},
+    {'w': d, 'x': c, 'y': d, 'z': d},
+    {'w': d, 'x': d, 'y': b, 'z': b},
+    {'w': d, 'x': d, 'y': b, 'z': c},
+    {'w': d, 'x': d, 'y': b, 'z': d},
+    {'w': d, 'x': d, 'y': c, 'z': b},
+    {'w': d, 'x': d, 'y': c, 'z': c},
+    {'w': d, 'x': d, 'y': c, 'z': d},
+    {'w': d, 'x': d, 'y': d, 'z': b},
+    {'w': d, 'x': d, 'y': d, 'z': c},
+    {'w': d, 'x': d, 'y': d, 'z': d},
+  ]);
+}
+
+/// Test that [cases] are exhaustive over [type] if and only if all cases are
+/// included and that all subsets of the cases are not exhaustive.
+void expectExhaustiveOnlyAll(StaticType type, List<Object> cases) {
+  const trials = 100;
+
+  var best = 9999999;
+  for (var j = 0; j < 100000; j++) {
+    var watch = Stopwatch()..start();
+    for (var i = 0; i < trials; i++) {
+      var spaces = parseSpaces(cases);
+      var actual = isExhaustive(Space(type), spaces);
+      if (!actual) {
+        throw 'Expected exhaustive';
+      }
+    }
+
+    var elapsed = watch.elapsedMilliseconds;
+    best = min(elapsed, best);
+    print('${elapsed / trials}ms (best ${best / trials}ms)');
+  }
+}
diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/equal.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/equal.dart
new file mode 100644
index 0000000..63f527d
--- /dev/null
+++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/equal.dart
@@ -0,0 +1,71 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'profile.dart' as profile;
+import 'space.dart';
+
+/// Returns `true` if [left] and [right] are equivalent spaces.
+///
+/// Equality is defined purely structurally/syntactically.
+bool equal(Space left, Space right, String reason) {
+  profile.count('equal', reason);
+
+  if (identical(left, right)) return true;
+
+  // Empty is only equal to itself (and will get caught by the previous check).
+  if (left == Space.empty) return false;
+  if (right == Space.empty) return false;
+
+  if (left is UnionSpace && right is UnionSpace) {
+    return _equalUnions(left, right);
+  }
+
+  if (left is ExtractSpace && right is ExtractSpace) {
+    return _equalExtracts(left, right);
+  }
+
+  // If we get here, one is a union and one is an extract.
+  return false;
+}
+
+/// Returns `true` if [left] and [right] have the same type and the same fields
+/// with equal subspaces.
+bool _equalExtracts(ExtractSpace left, ExtractSpace right) {
+  // Must have the same type.
+  if (left.type != right.type) return false;
+
+  // And the same fields.
+  Set<String> fields = {...left.fields.keys, ...right.fields.keys};
+  if (left.fields.length != fields.length) return false;
+  if (right.fields.length != fields.length) return false;
+
+  for (String field in fields) {
+    if (!equal(left.fields[field]!, right.fields[field]!, 'recurse extract')) {
+      return false;
+    }
+  }
+
+  return true;
+}
+
+/// Returns `true` if [left] and [right] contain equal arms in any order.
+///
+/// Assumes that all duplicates have already been removed from each union.
+bool _equalUnions(UnionSpace left, UnionSpace right) {
+  if (left.arms.length != right.arms.length) return false;
+
+  /// For each left arm, should find an equal right arm.
+  for (Space leftArm in left.arms) {
+    bool found = false;
+    for (Space rightArm in right.arms) {
+      if (equal(leftArm, rightArm, 'recurse union')) {
+        found = true;
+        break;
+      }
+    }
+    if (!found) return false;
+  }
+
+  return true;
+}
diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/exhaustive.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/exhaustive.dart
new file mode 100644
index 0000000..17fbf9f
--- /dev/null
+++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/exhaustive.dart
@@ -0,0 +1,49 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'space.dart';
+import 'static_type.dart';
+import 'subtract.dart';
+
+/// Returns `true` if [cases] exhaustively covers all possible values of
+/// [value].
+///
+/// This is defined simply in terms of subtraction and unions: [cases] is a
+/// union space, and it's exhaustive if subtracting it from [value] leaves
+/// nothing.
+bool isExhaustive(Space value, List<Space> cases) {
+  return subtract(value, new Space.union(cases)) == Space.empty;
+}
+
+/// Checks the [cases] representing a series of switch cases to see if they
+/// exhaustively cover all possible values of the matched [valueType]. Also
+/// checks to see if any case can't be matched because it's covered by previous
+/// cases.
+///
+/// Returns a string containing any unreachable case or non-exhaustive match
+/// errors. Returns an empty string if all cases are reachable and the cases
+/// are exhaustive.
+String reportErrors(StaticType valueType, List<Space> cases) {
+  List<String> errors = <String>[];
+
+  Space remaining = new Space(valueType);
+  for (int i = 0; i < cases.length; i++) {
+    // See if this case is covered by previous ones.
+    if (i > 0) {
+      Space previous = new Space.union(cases.sublist(0, i));
+      if (subtract(cases[i], previous) == Space.empty) {
+        errors.add('Case #${i + 1} ${cases[i]} is covered by $previous.');
+      }
+    }
+
+    remaining = subtract(remaining, cases[i]);
+  }
+
+  if (remaining != Space.empty) {
+    errors.add(
+        '$valueType is not exhaustively matched by ${new Space.union(cases)}.');
+  }
+
+  return errors.join('\n');
+}
diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/intersect.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/intersect.dart
new file mode 100644
index 0000000..e710c60
--- /dev/null
+++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/intersect.dart
@@ -0,0 +1,107 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'profile.dart' as profile;
+import 'space.dart';
+import 'static_type.dart';
+
+/// Calculates the intersection of [left] and [right].
+///
+/// This is used to tell if two field spaces on a pair of spaces being
+/// subtracted have no common values.
+Space intersect(Space left, Space right) {
+  profile.count('intersect');
+
+  // The intersection with an empty space is always empty.
+  if (left == Space.empty) return Space.empty;
+  if (right == Space.empty) return Space.empty;
+
+  // The intersection of a union is the union of the intersections of its arms.
+  if (left is UnionSpace) {
+    return new Space.union(
+        left.arms.map((arm) => intersect(arm, right)).toList());
+  }
+
+  if (right is UnionSpace) {
+    return new Space.union(
+        right.arms.map((arm) => intersect(left, arm)).toList());
+  }
+
+  // Otherwise, we're intersecting two [ExtractSpaces].
+  return _intersectExtracts(left as ExtractSpace, right as ExtractSpace);
+}
+
+/// Returns the intersection of two static types [left] and [right].
+///
+/// Returns `null` if the intersection is empty.
+StaticType? intersectTypes(StaticType left, StaticType right) {
+  // If one type is a subtype, the subtype is the intersection.
+  if (left.isSubtypeOf(right)) return left;
+  if (right.isSubtypeOf(left)) return right;
+
+  if (left.isNullable) {
+    if (right.isNullable) {
+      StaticType? intersection =
+          intersectTypes(left.underlying, right.underlying);
+      if (intersection == null) return null;
+      return intersection.nullable;
+    } else {
+      return intersectTypes(left.underlying, right);
+    }
+  } else if (right.isNullable) {
+    return intersectTypes(left, right.underlying);
+  }
+
+  // If we allow sealed types to share subtypes, then this will need to be more
+  // sophisticated. Here:
+  //
+  //   (A) (B)
+  //   / \ / \
+  //  C   D   E
+  //
+  // The intersection of A and B should be D. Here:
+  //
+  //  (A)   (B)
+  //   | \  / |
+  //   |\ \/ /|
+  //   | \/\/ |
+  //   C D  E F
+  //
+  // It should be D, E.
+
+  // Unrelated types.
+  return null;
+}
+
+/// Returns the interaction of extract spaces [left] and [right].
+Space _intersectExtracts(ExtractSpace left, ExtractSpace right) {
+  StaticType? type = intersectTypes(left.type, right.type);
+
+  // If the types are disjoint, the intersection is empty.
+  if (type == null) return Space.empty;
+
+  // Recursively intersect the fields.
+  List<String> fieldNames =
+      {...left.fields.keys, ...right.fields.keys}.toList();
+
+  // Sorting isn't needed for correctness, just to make the tests less brittle.
+  fieldNames.sort();
+
+  Map<String, Space> fields = <String, Space>{};
+  for (String name in fieldNames) {
+    Space field = _intersectFields(left.fields[name], right.fields[name]);
+
+    // If the fields are disjoint, then the entire space will have no values.
+    if (field == Space.empty) return Space.empty;
+    fields[name] = field;
+  }
+
+  return new Space(type, fields);
+}
+
+Space _intersectFields(Space? left, Space? right) {
+  if (left == null) return right!;
+  if (right == null) return left;
+  return intersect(left, right);
+}
diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/intersect_empty.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/intersect_empty.dart
new file mode 100644
index 0000000..2baa029
--- /dev/null
+++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/intersect_empty.dart
@@ -0,0 +1,60 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'space.dart';
+import 'static_type.dart';
+
+/// Calculates whether the intersection of [left] and [right] is empty.
+///
+/// This is used to tell if two field spaces on a pair of spaces being
+/// subtracted have no common values.
+bool intersectEmpty(Space left, Space right) {
+  // The intersection with an empty space is always empty.
+  if (left == Space.empty) return true;
+  if (right == Space.empty) return true;
+
+  // The intersection of a union is empty if all of the arms are.
+  if (left is UnionSpace) {
+    return left.arms.every((arm) => intersectEmpty(arm, right));
+  }
+
+  if (right is UnionSpace) {
+    return right.arms.every((arm) => intersectEmpty(left, arm));
+  }
+
+  // Otherwise, we're intersecting two [ExtractSpaces].
+  return _intersectExtracts(left as ExtractSpace, right as ExtractSpace);
+}
+
+/// Returns true if the intersection of two static types [left] and [right] is
+/// empty.
+bool intersectTypes(StaticType left, StaticType right) {
+  // If one type is a subtype, the subtype is the intersection.
+  if (left.isSubtypeOf(right)) return false;
+  if (right.isSubtypeOf(left)) return false;
+
+  // Unrelated types.
+  return true;
+}
+
+/// Returns the interaction of extract spaces [left] and [right].
+bool _intersectExtracts(ExtractSpace left, ExtractSpace right) {
+  if (intersectTypes(left.type, right.type)) return true;
+
+  // Recursively intersect the fields.
+  List<String> fieldNames =
+      {...left.fields.keys, ...right.fields.keys}.toList();
+  for (String name in fieldNames) {
+    // If the fields are disjoint, then the entire space will have no values.
+    if (_intersectFields(left.fields[name], right.fields[name])) return true;
+  }
+
+  return false;
+}
+
+bool _intersectFields(Space? left, Space? right) {
+  if (left == null) return right! == Space.empty;
+  if (right == null) return left == Space.empty;
+  return intersectEmpty(left, right);
+}
diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/profile.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/profile.dart
new file mode 100644
index 0000000..694b568
--- /dev/null
+++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/profile.dart
@@ -0,0 +1,47 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:math';
+
+bool enabled = false;
+
+final _counts = <String, int>{};
+
+void count(String name, [String? subname]) {
+  if (!enabled) return;
+  _counts.putIfAbsent(name, () => 0);
+  _counts[name] = _counts[name]! + 1;
+
+  if (subname != null) {
+    count('$name/$subname');
+  }
+}
+
+void log() {
+  List<String> names = _counts.keys.toList();
+  names.sort();
+  int nameLength =
+      names.fold<int>(0, (length, name) => max(length, name.length));
+  int countLength = _counts.values
+      .fold<int>(0, (length, count) => max(length, count.toString().length));
+
+  for (String name in names) {
+    print('${name.padRight(nameLength)} = '
+        '${_counts[name].toString().padLeft(countLength)}');
+  }
+}
+
+void reset() {
+  _counts.clear();
+}
+
+void run(void Function() callback) {
+  reset();
+  try {
+    callback();
+  } finally {
+    log();
+    reset();
+  }
+}
diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/space.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/space.dart
new file mode 100644
index 0000000..fe14656
--- /dev/null
+++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/space.dart
@@ -0,0 +1,150 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'equal.dart';
+import 'static_type.dart';
+
+/// The main space for matching types and destructuring.
+///
+/// It has a type which determines the type of values it contains. The type may
+/// be [StaticType.top] to indicate that it doesn't filter by type.
+///
+/// It may also contain zero or more named fields. The space then only contains
+/// values where the field values are contained by the corresponding field
+/// spaces.
+class ExtractSpace extends Space {
+  /// The type of values the space matches.
+  final StaticType type;
+
+  /// Any field subspaces the space matches.
+  final Map<String, Space> fields;
+
+  ExtractSpace._(this.type, [this.fields = const {}]) : super._();
+
+  /// An [ExtractSpace] with no type and no fields contains all values.
+  @override
+  bool get isTop => type == StaticType.top && fields.isEmpty;
+
+  @override
+  String toString() {
+    if (isTop) return '()';
+
+    // If there are no fields, just show the type.
+    if (fields.isEmpty) return type.name;
+
+    StringBuffer buffer = new StringBuffer();
+
+    // We model a bare record pattern by treating it like an extractor on top.
+    if (type != StaticType.top) buffer.write(type.name);
+
+    buffer.write('(');
+    bool first = true;
+
+    // Positional fields have stringified number names.
+    for (int i = 0;; i++) {
+      Space? pattern = fields[i.toString()];
+      if (pattern == null) break;
+
+      if (!first) buffer.write(', ');
+      buffer.write(pattern);
+      first = false;
+    }
+
+    fields.forEach((name, pattern) {
+      // Skip positional fields.
+      if (int.tryParse(name) != null) return;
+
+      if (!first) buffer.write(', ');
+      buffer.write('$name: $pattern');
+      first = false;
+    });
+
+    buffer.write(')');
+
+    return buffer.toString();
+  }
+}
+
+// TODO(paulberry, rnystrom): List spaces.
+
+abstract class Space {
+  static final _EmptySpace empty = new _EmptySpace._();
+  static final Space top = new Space(StaticType.top);
+
+  factory Space(StaticType type, [Map<String, Space> fields = const {}]) =>
+      new ExtractSpace._(type, fields);
+
+  factory Space.record([Map<String, Space> fields = const {}]) =>
+      new Space(StaticType.top, fields);
+
+  factory Space.union(List<Space> arms) {
+    // Simplify the arms if possible.
+    List<Space> allArms = <Space>[];
+
+    void addSpace(Space space) {
+      // Discard duplicate arms. Duplicates can appear when working through a
+      // series of cases that destructure multiple fields with different types.
+      // Discarding the duplicates isn't necessary for correctness (a union with
+      // redundant arms contains the same set of values), but improves
+      // performance greatly. In the "sealed subtypes large T with all cases"
+      // test, you end up with a union containing 2520 arms, 2488 are
+      // duplicates. With this check, the largest union has only 5 arms.
+      //
+      // This is O(n^2) since we define only equality on spaces, but a real
+      // implementation would likely define hash code too and then simply
+      // create a hash set to merge duplicates in O(n) time.
+      for (Space existing in allArms) {
+        if (equal(existing, space, 'dedupe union')) return;
+      }
+
+      allArms.add(space);
+    }
+
+    for (Space space in arms) {
+      // Discard empty arms.
+      if (space == empty) continue;
+
+      // Flatten unions. We don't need to flatten recursively since we always
+      // go through this constructor to create unions. A UnionSpace will never
+      // contain UnionSpaces.
+      if (space is UnionSpace) {
+        for (Space arm in space.arms) {
+          addSpace(arm);
+        }
+      } else {
+        addSpace(space);
+      }
+    }
+
+    if (allArms.isEmpty) return empty;
+    if (allArms.length == 1) return allArms.first;
+    return new UnionSpace._(allArms);
+  }
+
+  Space._();
+
+  /// An untyped record space with no fields matches all values and thus isn't
+  /// very useful.
+  bool get isTop => false;
+}
+
+/// A union of spaces. The space A|B contains all of the values of A and B.
+class UnionSpace extends Space {
+  final List<Space> arms;
+
+  UnionSpace._(this.arms) : super._() {
+    assert(arms.length > 1);
+  }
+
+  @override
+  String toString() => arms.join('|');
+}
+
+/// The uninhabited space.
+class _EmptySpace extends Space {
+  _EmptySpace._() : super._();
+
+  @override
+  String toString() => '∅';
+}
diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/static_type.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/static_type.dart
new file mode 100644
index 0000000..647e36d
--- /dev/null
+++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/static_type.dart
@@ -0,0 +1,139 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// TODO(paulberry,rnystrom): Generics.
+
+/// A static type in the type system.
+class StaticType {
+  /// Built-in top type that all types are a subtype of.
+  static final StaticType top = new StaticType('top', inherits: []);
+
+  static final StaticType nullType = new StaticType('Null');
+
+  final String name;
+
+  late final StaticType nullable = new StaticType._nullable(this);
+
+  /// If this type is a nullable type, then this is the underlying type.
+  ///
+  /// Otherwise `null`.
+  final StaticType? _underlying;
+
+  /// Whether this type is sealed. A sealed type is implicitly abstract and has
+  /// a closed set of known subtypes. This means that every instance of the
+  /// type must be an instance of one of those subtypes. Conversely, if an
+  /// instance is *not* an instance of one of those subtypes, that it must not
+  /// be an instance of this type.
+  ///
+  /// Note that subtypes of a sealed type do not themselves have to be sealed.
+  /// Consider:
+  ///
+  ///      (A)
+  ///      / \
+  ///     B   C
+  ///
+  /// Here, A is sealed and B and C are not. There may be many unknown
+  /// subclasses of B and C, or classes implementing their interfaces. That
+  /// doesn't interfere with exhaustiveness checking because it's still the
+  /// case that any instance of A must be either a B or C *or some subtype of
+  /// one of those two types*.
+  final bool isSealed;
+
+  final Map<String, StaticType> _fields;
+
+  final List<StaticType> _supertypes = [];
+
+  final List<StaticType> _subtypes = [];
+
+  StaticType(this.name,
+      {this.isSealed = false,
+      List<StaticType>? inherits,
+      Map<String, StaticType> fields = const {}})
+      : _underlying = null,
+        _fields = fields {
+    if (inherits != null) {
+      for (StaticType type in inherits) {
+        _supertypes.add(type);
+        type._subtypes.add(this);
+      }
+    } else {
+      _supertypes.add(top);
+    }
+
+    int sealed = 0;
+    for (StaticType supertype in _supertypes) {
+      if (supertype.isSealed) sealed++;
+    }
+
+    // We don't allow a sealed type's subtypes to be shared with some other
+    // sibling supertype, as in D here:
+    //
+    //   (A) (B)
+    //   / \ / \
+    //  C   D   E
+    //
+    // We could remove this restriction but doing so will require
+    // expandTypes() to be more complex. In the example here, if we subtract
+    // E from A, the result should be C|D. That requires knowing that B should
+    // be expanded, which expandTypes() doesn't currently handle.
+    if (sealed > 1) {
+      throw new ArgumentError('Can only have one sealed supertype.');
+    }
+  }
+
+  StaticType._nullable(StaticType underlying)
+      : name = '${underlying.name}?',
+        _underlying = underlying,
+        isSealed = true,
+        // No fields because it may match null which doesn't have them.
+        _fields = {} {}
+
+  /// The static types of the fields this type exposes for record destructuring.
+  ///
+  /// Includes inherited fields.
+  Map<String, StaticType> get fields {
+    return {
+      for (StaticType supertype in _supertypes) ...supertype.fields,
+      ..._fields
+    };
+  }
+
+  bool get isNullable => _underlying != null;
+
+  /// The immediate subtypes of this type.
+  Iterable<StaticType> get subtypes => _subtypes;
+
+  /// The underlying type of this nullable type. It's an error to call this on
+  /// a non-nullable type.
+  StaticType get underlying => _underlying!;
+
+  bool isSubtypeOf(StaticType other) {
+    if (this == other) return true;
+
+    // Null is a subtype of all nullable types.
+    if (this == nullType && other._underlying != null) return true;
+
+    // A nullable type is a subtype if the underlying type and Null both are.
+    StaticType? underlying = _underlying;
+    if (underlying != null) {
+      return underlying.isSubtypeOf(other) && nullType.isSubtypeOf(other);
+    }
+
+    // A non-nullable type is a subtype of the underlying type of a nullable
+    // type.
+    StaticType? otherUnderlying = other._underlying;
+    if (otherUnderlying != null) {
+      return isSubtypeOf(otherUnderlying);
+    }
+
+    for (StaticType supertype in _supertypes) {
+      if (supertype.isSubtypeOf(other)) return true;
+    }
+
+    return false;
+  }
+
+  @override
+  String toString() => name;
+}
diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/subtract.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/subtract.dart
new file mode 100644
index 0000000..2da2157
--- /dev/null
+++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/subtract.dart
@@ -0,0 +1,182 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'intersect_empty.dart';
+import 'profile.dart' as profile;
+import 'space.dart';
+import 'static_type.dart';
+
+/// Recursively replaces [left] with a union of its sealed subtypes as long as
+/// doing so enables it to more precisely match against [right].
+List<StaticType> expandType(StaticType left, StaticType right) {
+  // If [left] is nullable and right is null or non-nullable, then expand the
+  // nullable type.
+  if (left.isNullable && (right == StaticType.nullType || !right.isNullable)) {
+    return [...expandType(left.underlying, right), StaticType.nullType];
+  }
+
+  // If [right] is nullable, then expand using its underlying type.
+  if (right.isNullable) {
+    return expandType(left, right.underlying);
+  }
+
+  // If [left] is a sealed supertype and [right] is in its subtype hierarchy,
+  // then expand out the subtypes (recursively) to more precisely match [right].
+  if (left.isSealed && left != right && right.isSubtypeOf(left)) {
+    return {
+      for (StaticType subtype in left.subtypes) ...expandType(subtype, right),
+    }.toList();
+  }
+
+  return [left];
+}
+
+/// Returns a new [Space] that contains all of the values of [left] that are
+/// not also in [right].
+Space subtract(Space left, Space right) {
+  profile.count('subtract');
+
+  // Subtracting from empty is still empty.
+  if (left == Space.empty) return Space.empty;
+
+  // Subtracting nothing leaves it unchanged.
+  if (right == Space.empty) return left;
+
+  // Distribute a union on the left.
+  // A|B - x => A-x | B-x
+  if (left is UnionSpace) {
+    return new Space.union(
+        left.arms.map((arm) => subtract(arm, right)).toList());
+  }
+
+  // Distribute a union on the right.
+  // x - A|B => x - A - B
+  if (right is UnionSpace) {
+    Space result = left;
+    for (Space arm in right.arms) {
+      result = subtract(result, arm);
+    }
+    return result;
+  }
+
+  // Otherwise, it must be two extract spaces.
+  return _subtractExtract(left as ExtractSpace, right as ExtractSpace);
+}
+
+/// Returns `true` if every field in [leftFields] is covered by the
+/// corresponding field in [rightFields].
+bool _isLeftSubspace(StaticType leftType, List<String> fieldNames,
+    Map<String, Space> leftFields, Map<String, Space> rightFields) {
+  for (String name in fieldNames) {
+    if (subtract(leftFields[name]!, rightFields[name]!) != Space.empty) {
+      return false;
+    }
+  }
+
+  // If we get here, every field covered.
+  return true;
+}
+
+/// Subtract [right] from [left].
+Space _subtractExtract(ExtractSpace left, ExtractSpace right) {
+  List<String> fieldNames =
+      {...left.fields.keys, ...right.fields.keys}.toList();
+
+  List<Space> spaces = <Space>[];
+
+  // If the left type is in a sealed hierarchy, expanding it to its subtypes
+  // might let us calculate the subtraction more precisely.
+  List<StaticType> subtypes = expandType(left.type, right.type);
+  for (StaticType subtype in subtypes) {
+    spaces.addAll(_subtractExtractAtType(subtype, left, right, fieldNames));
+  }
+
+  return new Space.union(spaces);
+}
+
+/// Subtract [right] from [left], but using [type] for left's type, which may
+/// be a more specific subtype of [left]'s own type is a sealed supertype.
+List<Space> _subtractExtractAtType(StaticType type, ExtractSpace left,
+    ExtractSpace right, List<String> fieldNames) {
+  // If the right type doesn't cover the left (even after expanding sealed
+  // types), then we can't do anything with the fields since they may not
+  // even come into play for all values. Subtract nothing from this subtype
+  // and keep all of the current fields.
+  if (!type.isSubtypeOf(right.type)) return [new Space(type, left.fields)];
+
+  // Infer any fields that appear in one space and not the other.
+  Map<String, Space> leftFields = <String, Space>{};
+  Map<String, Space> rightFields = <String, Space>{};
+  for (String name in fieldNames) {
+    // If the right space matches on a field that the left doesn't have, infer
+    // it from the static type of the field. That contains the same set of
+    // values as having no field at all.
+    leftFields[name] = left.fields[name] ?? new Space(type.fields[name]!);
+
+    // If the left matches on a field that the right doesn't have, infer top
+    // for the right field since the right will accept any of left's values for
+    // that field.
+    rightFields[name] = right.fields[name] ?? Space.top;
+  }
+
+  // If any pair of fields have no overlapping values, then no overall value
+  // that matches the left space will also match the right space. So the right
+  // space doesn't subtract anything and we keep the left space as-is.
+  for (String name in fieldNames) {
+    if (intersectEmpty(leftFields[name]!, rightFields[name]!)) {
+      return [new Space(type, left.fields)];
+    }
+  }
+
+  // If all the right's fields strictly cover all of the left's, then the
+  // right completely subtracts this type and nothing remains.
+  if (_isLeftSubspace(type, fieldNames, leftFields, rightFields)) {
+    return const [];
+  }
+
+  // The right side is a supertype but its fields don't totally cover, so
+  // handle each of them individually.
+
+  // Walk the fields and see which ones are modified by the right-hand fields.
+  Map<String, Space> fixed = <String, Space>{};
+  Map<String, Space> changedDifference = <String, Space>{};
+  for (String name in fieldNames) {
+    Space difference = subtract(leftFields[name]!, rightFields[name]!);
+    if (difference == Space.empty) {
+      // The right field accepts all the values that the left field accepts, so
+      // keep the left field as it is.
+      fixed[name] = leftFields[name]!;
+    } else if (difference.isTop) {
+      // If the resulting field matches everything, simply discard it since
+      // it's equivalent to omitting the field.
+    } else {
+      changedDifference[name] = difference;
+    }
+  }
+
+  // If no fields are affected by the subtraction, just return a single arm
+  // with all of the fields.
+  if (changedDifference.isEmpty) return [new Space(type, fixed)];
+
+  // For each field whose `left - right` is different, include an arm that
+  // includes that one difference.
+  List<String> changedFields = changedDifference.keys.toList();
+  List<Space> spaces = <Space>[];
+  for (int i = 0; i < changedFields.length; i++) {
+    Map<String, Space> fields = {...fixed};
+
+    for (int j = 0; j < changedFields.length; j++) {
+      String name = changedFields[j];
+      if (i == j) {
+        fields[name] = changedDifference[name]!;
+      } else {
+        fields[name] = leftFields[name]!;
+      }
+    }
+
+    spaces.add(new Space(type, fields));
+  }
+
+  return spaces;
+}
diff --git a/pkg/_fe_analyzer_shared/lib/src/macros/api/code.dart b/pkg/_fe_analyzer_shared/lib/src/macros/api/code.dart
index de81796..cd0889c 100644
--- a/pkg/_fe_analyzer_shared/lib/src/macros/api/code.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/macros/api/code.dart
@@ -57,16 +57,21 @@
   FunctionBodyCode.fromParts(List<Object> parts) : super.fromParts(parts);
 }
 
-/// A piece of code identifying a syntactically valid function parameter.
+/// A piece of code identifying a syntactically valid function or function type
+/// parameter.
 ///
 /// There is no distinction here made between named and positional parameters.
 ///
+/// There is also no distinction between function type parameters and normal
+/// function parameters, so the [name] is nullable (it is not required for
+/// positional function type parameters).
+///
 /// It is the job of the user to construct and combine these together in a way
 /// that creates valid parameter lists.
 class ParameterCode implements Code {
   final Code? defaultValue;
   final List<String> keywords;
-  final String name;
+  final String? name;
   final TypeAnnotationCode? type;
 
   @override
@@ -82,7 +87,7 @@
           type!,
           ' ',
         ],
-        name,
+        if (name != null) name!,
         if (defaultValue != null) ...[
           ' = ',
           defaultValue!,
@@ -92,7 +97,7 @@
   ParameterCode({
     this.defaultValue,
     this.keywords = const [],
-    required this.name,
+    this.name,
     this.type,
   });
 }
diff --git a/pkg/_fe_analyzer_shared/lib/src/macros/api/introspection.dart b/pkg/_fe_analyzer_shared/lib/src/macros/api/introspection.dart
index cc9ef15..037c788 100644
--- a/pkg/_fe_analyzer_shared/lib/src/macros/api/introspection.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/macros/api/introspection.dart
@@ -35,10 +35,10 @@
   TypeAnnotation get returnType;
 
   /// The positional parameters for this function.
-  Iterable<ParameterDeclaration> get positionalParameters;
+  Iterable<FunctionTypeParameter> get positionalParameters;
 
   /// The named parameters for this function.
-  Iterable<ParameterDeclaration> get namedParameters;
+  Iterable<FunctionTypeParameter> get namedParameters;
 
   /// The type parameters for this function.
   Iterable<TypeParameterDeclaration> get typeParameters;
@@ -100,10 +100,15 @@
   bool get isStatic;
 }
 
-/// A declaration that defines a new type in the program.
+/// Marker interface for a declaration that defines a new type in the program.
+///
+/// See [ParameterizedTypeDeclaration] and [TypeParameterDeclaration].
+abstract class TypeDeclaration implements Declaration {}
+
+/// A [TypeDeclaration] which may have type parameters.
 ///
 /// See subtypes [ClassDeclaration] and [TypeAliasDeclaration].
-abstract class TypeDeclaration implements Declaration {
+abstract class ParameterizedTypeDeclaration implements TypeDeclaration {
   /// The type parameters defined for this type declaration.
   Iterable<TypeParameterDeclaration> get typeParameters;
 }
@@ -112,7 +117,7 @@
 ///
 /// Information about fields, methods, and constructors must be retrieved from
 /// the `builder` objects.
-abstract class ClassDeclaration implements TypeDeclaration {
+abstract class ClassDeclaration implements ParameterizedTypeDeclaration {
   /// Whether this class has an `abstract` modifier.
   bool get isAbstract;
 
@@ -133,7 +138,7 @@
 }
 
 /// Type alias introspection information.
-abstract class TypeAliasDeclaration extends TypeDeclaration {
+abstract class TypeAliasDeclaration implements ParameterizedTypeDeclaration {
   /// The type annotation this is an alias for.
   TypeAnnotation get aliasedType;
 }
@@ -197,8 +202,9 @@
 abstract class FieldDeclaration
     implements VariableDeclaration, ClassMemberDeclaration {}
 
-/// Parameter introspection information.
-abstract class ParameterDeclaration implements Declaration {
+/// General parameter introspection information, see the subtypes
+/// [FunctionTypeParameter] and [ParameterDeclaration].
+abstract class Parameter {
   /// The type of this parameter.
   TypeAnnotation get type;
 
@@ -216,8 +222,18 @@
   ParameterCode get code;
 }
 
-/// Type parameter introspection information.
-abstract class TypeParameterDeclaration implements Declaration {
+/// Parameters of normal functions/methods, which always have an identifier.
+abstract class ParameterDeclaration implements Parameter, Declaration {}
+
+/// Function type parameters don't always have names, and it is never useful to
+/// get an [Identifier] for them, so they do not implement [Declaration] and
+/// instead have an optional name.
+abstract class FunctionTypeParameter implements Parameter {
+  String? get name;
+}
+
+/// Generic type parameter introspection information.
+abstract class TypeParameterDeclaration implements TypeDeclaration {
   /// The bound for this type parameter, if it has any.
   TypeAnnotation? get bound;
 
diff --git a/pkg/_fe_analyzer_shared/lib/src/macros/executor/executor_base.dart b/pkg/_fe_analyzer_shared/lib/src/macros/executor/executor_base.dart
index 2e3c5d2..69c0745 100644
--- a/pkg/_fe_analyzer_shared/lib/src/macros/executor/executor_base.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/macros/executor/executor_base.dart
@@ -172,8 +172,8 @@
                     responseType: MessageType.remoteInstance,
                     response: (await resolver.declarationOf(request.identifier)
                         // TODO: Consider refactoring to avoid the need for
-                        //  this.
-                        as TypeDeclarationImpl),
+                        //  this cast.
+                        as Serializable),
                     serializationZoneId: zoneId);
               } on ArgumentError catch (error) {
                 response = new SerializableResponse(
diff --git a/pkg/_fe_analyzer_shared/lib/src/macros/executor/introspection_impls.dart b/pkg/_fe_analyzer_shared/lib/src/macros/executor/introspection_impls.dart
index 29c443b..78ce58e 100644
--- a/pkg/_fe_analyzer_shared/lib/src/macros/executor/introspection_impls.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/macros/executor/introspection_impls.dart
@@ -94,21 +94,21 @@
           typeParam.code,
       ],
       positionalParameters: [
-        for (ParameterDeclaration positional in positionalParameters)
+        for (FunctionTypeParameter positional in positionalParameters)
           positional.code,
       ],
       namedParameters: [
-        for (ParameterDeclaration named in namedParameters) named.code,
+        for (FunctionTypeParameter named in namedParameters) named.code,
       ],
     );
     return isNullable ? underlyingType.asNullable : underlyingType;
   }
 
   @override
-  final List<ParameterDeclarationImpl> namedParameters;
+  final List<FunctionTypeParameterImpl> namedParameters;
 
   @override
-  final List<ParameterDeclarationImpl> positionalParameters;
+  final List<FunctionTypeParameterImpl> positionalParameters;
 
   @override
   final TypeAnnotationImpl returnType;
@@ -137,13 +137,13 @@
     returnType.serialize(serializer);
 
     serializer.startList();
-    for (ParameterDeclarationImpl param in positionalParameters) {
+    for (FunctionTypeParameterImpl param in positionalParameters) {
       param.serialize(serializer);
     }
     serializer.endList();
 
     serializer.startList();
-    for (ParameterDeclarationImpl param in namedParameters) {
+    for (FunctionTypeParameterImpl param in namedParameters) {
       param.serialize(serializer);
     }
     serializer.endList();
@@ -223,6 +223,50 @@
       ]);
 }
 
+class FunctionTypeParameterImpl extends RemoteInstance
+    implements FunctionTypeParameter {
+  @override
+  final bool isNamed;
+
+  @override
+  final bool isRequired;
+
+  @override
+  final String? name;
+
+  @override
+  final TypeAnnotationImpl type;
+
+  @override
+  RemoteInstanceKind get kind => RemoteInstanceKind.functionTypeParameter;
+
+  FunctionTypeParameterImpl({
+    required int id,
+    required this.isNamed,
+    required this.isRequired,
+    required this.name,
+    required this.type,
+  }) : super(id);
+
+  @override
+  void serialize(Serializer serializer) {
+    super.serialize(serializer);
+    // Client side we don't encode anything but the ID.
+    if (serializationMode.isClient) return;
+
+    serializer.addBool(isNamed);
+    serializer.addBool(isRequired);
+    serializer.addNullableString(name);
+    type.serialize(serializer);
+  }
+
+  @override
+  ParameterCode get code =>
+      new ParameterCode(name: name, type: type.code, keywords: [
+        if (isNamed && isRequired) 'required',
+      ]);
+}
+
 class TypeParameterDeclarationImpl extends DeclarationImpl
     implements TypeParameterDeclaration {
   @override
@@ -520,12 +564,12 @@
   }
 }
 
-abstract class TypeDeclarationImpl extends DeclarationImpl
-    implements TypeDeclaration {
+abstract class ParameterizedTypeDeclarationImpl extends DeclarationImpl
+    implements ParameterizedTypeDeclaration {
   @override
   final List<TypeParameterDeclarationImpl> typeParameters;
 
-  TypeDeclarationImpl({
+  ParameterizedTypeDeclarationImpl({
     required int id,
     required IdentifierImpl identifier,
     required this.typeParameters,
@@ -544,7 +588,7 @@
   }
 }
 
-class ClassDeclarationImpl extends TypeDeclarationImpl
+class ClassDeclarationImpl extends ParameterizedTypeDeclarationImpl
     implements ClassDeclaration {
   @override
   final List<TypeAnnotationImpl> interfaces;
@@ -601,7 +645,7 @@
   }
 }
 
-class TypeAliasDeclarationImpl extends TypeDeclarationImpl
+class TypeAliasDeclarationImpl extends ParameterizedTypeDeclarationImpl
     implements TypeAliasDeclaration {
   /// The type being aliased.
   final TypeAnnotationImpl aliasedType;
diff --git a/pkg/_fe_analyzer_shared/lib/src/macros/executor/remote_instance.dart b/pkg/_fe_analyzer_shared/lib/src/macros/executor/remote_instance.dart
index 4ec67e4..666ff65 100644
--- a/pkg/_fe_analyzer_shared/lib/src/macros/executor/remote_instance.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/macros/executor/remote_instance.dart
@@ -95,6 +95,7 @@
   fieldDeclaration,
   functionDeclaration,
   functionTypeAnnotation,
+  functionTypeParameter,
   identifier,
   identifierResolver,
   namedStaticType,
diff --git a/pkg/_fe_analyzer_shared/lib/src/macros/executor/serialization_extensions.dart b/pkg/_fe_analyzer_shared/lib/src/macros/executor/serialization_extensions.dart
index c51175a..9ac4f12 100644
--- a/pkg/_fe_analyzer_shared/lib/src/macros/executor/serialization_extensions.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/macros/executor/serialization_extensions.dart
@@ -40,6 +40,9 @@
       case RemoteInstanceKind.functionTypeAnnotation:
         moveNext();
         return _expectFunctionTypeAnnotation(id) as T;
+      case RemoteInstanceKind.functionTypeParameter:
+        moveNext();
+        return _expectFunctionTypeParameter(id) as T;
       case RemoteInstanceKind.identifier:
         moveNext();
         return _expectIdentifier(id) as T;
@@ -103,6 +106,15 @@
         typeParameters: (this..moveNext())._expectRemoteInstanceList(),
       );
 
+  FunctionTypeParameter _expectFunctionTypeParameter(int id) =>
+      new FunctionTypeParameterImpl(
+        id: id,
+        isNamed: expectBool(),
+        isRequired: (this..moveNext()).expectBool(),
+        name: (this..moveNext()).expectNullableString(),
+        type: RemoteInstance.deserialize(this),
+      );
+
   Identifier _expectIdentifier(int id) => new IdentifierImpl(
         id: id,
         name: expectString(),
@@ -294,7 +306,7 @@
         return new ParameterCode(
             defaultValue: (this..moveNext()).expectNullableCode(),
             keywords: _readStringList(),
-            name: (this..moveNext()).expectString(),
+            name: (this..moveNext()).expectNullableString(),
             type: (this..moveNext()).expectNullableCode()) as T;
       case CodeKind.typeParameter:
         return new TypeParameterCode(
@@ -384,7 +396,7 @@
         }
         serializer
           ..endList()
-          ..addString(self.name);
+          ..addNullableString(self.name);
         self.type.serializeNullable(serializer);
         return;
       case CodeKind.typeParameter:
diff --git a/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart b/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart
index 36c0cb7..a7e9b00 100644
--- a/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart
@@ -3847,6 +3847,29 @@
 
 // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
 const Template<Message Function(String name)>
+    templateExtensionInNullAwareReceiver =
+    const Template<Message Function(String name)>(
+        problemMessageTemplate: r"""The extension '#name' cannot be null.""",
+        correctionMessageTemplate: r"""Try replacing '?.' with '.'""",
+        withArguments: _withArgumentsExtensionInNullAwareReceiver);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Message Function(String name)> codeExtensionInNullAwareReceiver =
+    const Code<Message Function(String name)>("ExtensionInNullAwareReceiver",
+        severity: Severity.warning);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+Message _withArgumentsExtensionInNullAwareReceiver(String name) {
+  if (name.isEmpty) throw 'No name provided';
+  name = demangleMixinApplicationName(name);
+  return new Message(codeExtensionInNullAwareReceiver,
+      problemMessage: """The extension '${name}' cannot be null.""",
+      correctionMessage: """Try replacing '?.' with '.'""",
+      arguments: {'name': name});
+}
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Template<Message Function(String name)>
     templateExtensionMemberConflictsWithObjectMember =
     const Template<Message Function(String name)>(
         problemMessageTemplate:
@@ -4124,7 +4147,7 @@
     Read the SDK platform from <file>, which should be in Dill/Kernel IR format
     and contain the Dart SDK.
 
-  --target=dart2js|dart2js_server|dart_runner|dartdevc|flutter|flutter_runner|none|vm
+  --target=dart2js|dart2js_server|dart2wasm|dart_runner|dartdevc|flutter|flutter_runner|none|vm
     Specify the target configuration.
 
   --enable-asserts
@@ -6333,6 +6356,15 @@
     problemMessage: r"""Can't use string interpolation in a URI.""");
 
 // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codeInvalidAugmentSuper = messageInvalidAugmentSuper;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode messageInvalidAugmentSuper = const MessageCode(
+    "InvalidAugmentSuper",
+    problemMessage:
+        r"""'augment super' is only allowed in member augmentations.""");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
 const Code<Null> codeInvalidAwaitFor = messageInvalidAwaitFor;
 
 // DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/forwarding_listener.dart b/pkg/_fe_analyzer_shared/lib/src/parser/forwarding_listener.dart
index cf3476b..a10e793 100644
--- a/pkg/_fe_analyzer_shared/lib/src/parser/forwarding_listener.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/parser/forwarding_listener.dart
@@ -282,6 +282,17 @@
   }
 
   @override
+  void beginLibraryAugmentation(Token libraryKeyword, Token augmentKeyword) {
+    listener?.beginLibraryAugmentation(libraryKeyword, augmentKeyword);
+  }
+
+  @override
+  void endLibraryAugmentation(
+      Token libraryKeyword, Token augmentKeyword, Token semicolon) {
+    listener?.endLibraryAugmentation(libraryKeyword, augmentKeyword, semicolon);
+  }
+
+  @override
   void beginLibraryName(Token token) {
     listener?.beginLibraryName(token);
   }
@@ -1737,6 +1748,12 @@
   }
 
   @override
+  void handleAugmentSuperExpression(
+      Token augmentToken, Token superToken, IdentifierContext context) {
+    listener?.handleAugmentSuperExpression(augmentToken, superToken, context);
+  }
+
+  @override
   void handleSymbolVoid(Token token) {
     listener?.handleSymbolVoid(token);
   }
diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/listener.dart b/pkg/_fe_analyzer_shared/lib/src/parser/listener.dart
index d31bac8b..107f7da 100644
--- a/pkg/_fe_analyzer_shared/lib/src/parser/listener.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/parser/listener.dart
@@ -953,6 +953,16 @@
     logEvent("LabeledStatement");
   }
 
+  void beginLibraryAugmentation(Token libraryKeyword, Token augmentKeyword) {}
+
+  /// Handle the end of a library augmentation directive.  Substructures:
+  /// - metadata
+  /// - uri
+  void endLibraryAugmentation(
+      Token libraryKeyword, Token augmentKeyword, Token semicolon) {
+    logEvent("LibraryAugmentation");
+  }
+
   void beginLibraryName(Token token) {}
 
   /// Handle the end of a library directive.  Substructures:
@@ -1760,6 +1770,11 @@
     logEvent("SuperExpression");
   }
 
+  void handleAugmentSuperExpression(
+      Token augmentToken, Token superToken, IdentifierContext context) {
+    logEvent("AugmentSuperExpression");
+  }
+
   void beginSwitchCase(int labelCount, int expressionCount, Token firstToken) {}
 
   void endSwitchCase(
diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/modifier_context.dart b/pkg/_fe_analyzer_shared/lib/src/parser/modifier_context.dart
index 99e4582..3946e24 100644
--- a/pkg/_fe_analyzer_shared/lib/src/parser/modifier_context.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/parser/modifier_context.dart
@@ -227,6 +227,7 @@
     reportExtraneousModifier(externalToken);
     reportExtraneousModifier(requiredToken);
     reportExtraneousModifier(staticToken);
+    reportExtraneousModifier(augmentToken);
     return token;
   }
 
diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart b/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart
index 4359e27..0fd1cc0 100644
--- a/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart
@@ -617,7 +617,13 @@
         } else if (identical(value, 'library')) {
           context.parseTopLevelKeywordModifiers(start, keyword);
           directiveState?.checkLibrary(this, keyword);
-          return parseLibraryName(keyword);
+          final Token tokenAfterKeyword = keyword.next!;
+          if (tokenAfterKeyword.isIdentifier &&
+              tokenAfterKeyword.lexeme == 'augment') {
+            return parseLibraryAugmentation(keyword, tokenAfterKeyword);
+          } else {
+            return parseLibraryName(keyword);
+          }
         }
       }
     }
@@ -626,6 +632,23 @@
   }
 
   /// ```
+  /// libraryAugmentationDirective:
+  ///   'library' 'augment' uri ';'
+  /// ;
+  /// ```
+  Token parseLibraryAugmentation(Token libraryKeyword, Token augmentKeyword) {
+    assert(optional('library', libraryKeyword));
+    assert(optional('augment', augmentKeyword));
+    listener.beginUncategorizedTopLevelDeclaration(libraryKeyword);
+    listener.beginLibraryAugmentation(libraryKeyword, augmentKeyword);
+    Token start = augmentKeyword;
+    Token token = ensureLiteralString(start);
+    Token semicolon = ensureSemicolon(token);
+    listener.endLibraryAugmentation(libraryKeyword, augmentKeyword, semicolon);
+    return semicolon;
+  }
+
+  /// ```
   /// libraryDirective:
   ///   'library' qualified ';'
   /// ;
@@ -5803,6 +5826,9 @@
         return parseThisExpression(token, context);
       } else if (identical(value, "super")) {
         return parseSuperExpression(token, context);
+      } else if (identical(value, "augment") &&
+          optional('super', token.next!.next!)) {
+        return parseAugmentSuperExpression(token, context);
       } else if (identical(value, "new")) {
         return parseNewExpression(token);
       } else if (identical(value, "const")) {
@@ -5942,6 +5968,21 @@
     return token;
   }
 
+  Token parseAugmentSuperExpression(Token token, IdentifierContext context) {
+    Token augmentToken = token = token.next!;
+    assert(optional('augment', token));
+    Token superToken = token = token.next!;
+    assert(optional('super', token));
+    listener.handleAugmentSuperExpression(augmentToken, superToken, context);
+    Token next = token.next!;
+    if (optional('(', next)) {
+      listener.handleNoTypeArguments(next);
+      token = parseArguments(token);
+      listener.handleSend(augmentToken, token.next!);
+    }
+    return token;
+  }
+
   /// This method parses the portion of a list literal starting with the left
   /// square bracket.
   ///
@@ -6925,7 +6966,9 @@
     Token? varFinalOrConst;
 
     if (isModifier(next)) {
-      if (optional('var', next) ||
+      if (optional('augment', next) && optional('super', next.next!)) {
+        return parseExpressionStatement(start);
+      } else if (optional('var', next) ||
           optional('final', next) ||
           optional('const', next)) {
         varFinalOrConst = token = token.next!;
diff --git a/pkg/_fe_analyzer_shared/pubspec.yaml b/pkg/_fe_analyzer_shared/pubspec.yaml
index 3f87368..ad5468c 100644
--- a/pkg/_fe_analyzer_shared/pubspec.yaml
+++ b/pkg/_fe_analyzer_shared/pubspec.yaml
@@ -1,5 +1,5 @@
 name: _fe_analyzer_shared
-version: 39.0.0
+version: 40.0.0
 description: Logic that is shared between the front_end and analyzer packages.
 repository: https://github.com/dart-lang/sdk/tree/main/pkg/_fe_analyzer_shared
 
@@ -9,5 +9,9 @@
 dependencies:
   meta: ^1.0.2
 
+# We use 'any' version constraints here as we get our package versions from
+# the dart-lang/sdk repo's DEPS file. Note that this is a special case; the
+# best practice for packages is to specify their compatible version ranges.
+# See also https://dart.dev/tools/pub/dependencies.
 dev_dependencies:
-  test: ^1.3.4
+  test: any
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/expand_type_test.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/expand_type_test.dart
new file mode 100644
index 0000000..0b0adb7
--- /dev/null
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/expand_type_test.dart
@@ -0,0 +1,232 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:_fe_analyzer_shared/src/exhaustiveness/static_type.dart';
+import 'package:_fe_analyzer_shared/src/exhaustiveness/subtract.dart';
+import 'package:test/test.dart';
+
+void main() {
+  test('sealed', () {
+    //   (A)
+    //   /|\
+    //  B C(D)
+    //     / \
+    //    E   F
+    var a = StaticType('A', isSealed: true);
+    var b = StaticType('B', inherits: [a]);
+    var c = StaticType('C', inherits: [a]);
+    var d = StaticType('D', isSealed: true, inherits: [a]);
+    var e = StaticType('E', inherits: [d]);
+    var f = StaticType('F', inherits: [d]);
+
+    expectExpand(a, a, 'A');
+    expectExpand(a, b, 'B|C|D');
+    expectExpand(a, c, 'B|C|D');
+    expectExpand(a, d, 'B|C|D');
+    expectExpand(a, e, 'B|C|E|F');
+    expectExpand(a, f, 'B|C|E|F');
+
+    expectExpand(d, a, 'D');
+    expectExpand(d, b, 'D');
+    expectExpand(d, c, 'D');
+    expectExpand(d, d, 'D');
+    expectExpand(d, e, 'E|F');
+    expectExpand(d, f, 'E|F');
+  });
+
+  test('unsealed', () {
+    //    A
+    //   /|\
+    //  B C D
+    //     / \
+    //    E   F
+    var a = StaticType('A');
+    var b = StaticType('B', inherits: [a]);
+    var c = StaticType('C', inherits: [a]);
+    var d = StaticType('D', inherits: [a]);
+    var e = StaticType('E', inherits: [d]);
+    var f = StaticType('F', inherits: [d]);
+
+    expectExpand(a, a, 'A');
+    expectExpand(a, b, 'A');
+    expectExpand(a, c, 'A');
+    expectExpand(a, d, 'A');
+    expectExpand(a, e, 'A');
+    expectExpand(a, f, 'A');
+
+    expectExpand(d, a, 'D');
+    expectExpand(d, b, 'D');
+    expectExpand(d, c, 'D');
+    expectExpand(d, d, 'D');
+    expectExpand(d, e, 'D');
+    expectExpand(d, f, 'D');
+  });
+
+  test('unsealed in middle', () {
+    //    (A)
+    //    / \
+    //   B   C
+    //      / \
+    //     D  (E)
+    //        / \
+    //       F   G
+    var a = StaticType('A', isSealed: true);
+    var b = StaticType('B', inherits: [a]);
+    var c = StaticType('C', inherits: [a]);
+    var d = StaticType('D', inherits: [c]);
+    var e = StaticType('E', isSealed: true, inherits: [c]);
+    var f = StaticType('F', inherits: [e]);
+    var g = StaticType('G', inherits: [e]);
+
+    expectExpand(a, a, 'A');
+    expectExpand(a, b, 'B|C');
+    expectExpand(a, c, 'B|C');
+    expectExpand(a, d, 'B|C');
+    expectExpand(a, e, 'B|C');
+    expectExpand(a, f, 'B|C');
+
+    expectExpand(c, a, 'C');
+    expectExpand(c, b, 'C');
+    expectExpand(c, c, 'C');
+    expectExpand(c, d, 'C');
+    expectExpand(c, e, 'C');
+    expectExpand(c, f, 'C');
+
+    expectExpand(e, a, 'E');
+    expectExpand(e, b, 'E');
+    expectExpand(e, c, 'E');
+    expectExpand(e, e, 'E');
+    expectExpand(e, f, 'F|G');
+    expectExpand(e, g, 'F|G');
+  });
+
+  test('transitive sealed family', () {
+    //     (A)
+    //     / \
+    //   (B) (C)
+    //   / | | \
+    //  D  E F  G
+    //     \ /
+    //      H
+    var a = StaticType('A', isSealed: true);
+    var b = StaticType('B', isSealed: true, inherits: [a]);
+    var c = StaticType('C', isSealed: true, inherits: [a]);
+    var d = StaticType('D', inherits: [b]);
+    var e = StaticType('E', inherits: [b]);
+    var f = StaticType('F', inherits: [c]);
+    var g = StaticType('G', inherits: [c]);
+    var h = StaticType('H', inherits: [e, f]);
+
+    expectExpand(a, a, 'A');
+    expectExpand(a, b, 'B|C');
+    expectExpand(a, c, 'B|C');
+    expectExpand(a, d, 'D|E|C');
+    expectExpand(a, e, 'D|E|C');
+    expectExpand(a, f, 'B|F|G');
+    expectExpand(a, g, 'B|F|G');
+    expectExpand(a, h, 'D|E|F|G');
+
+    expectExpand(b, a, 'B');
+    expectExpand(b, b, 'B');
+    expectExpand(b, c, 'B');
+    expectExpand(b, d, 'D|E');
+    expectExpand(b, e, 'D|E');
+    expectExpand(b, f, 'B');
+    expectExpand(b, h, 'D|E');
+
+    expectExpand(d, a, 'D');
+    expectExpand(d, b, 'D');
+    expectExpand(d, c, 'D');
+    expectExpand(d, d, 'D');
+    expectExpand(d, e, 'D');
+    expectExpand(d, f, 'D');
+
+    expectExpand(e, a, 'E');
+    expectExpand(e, b, 'E');
+    expectExpand(e, c, 'E');
+    expectExpand(e, d, 'E');
+    expectExpand(e, e, 'E');
+    expectExpand(e, f, 'E');
+    expectExpand(e, h, 'E');
+
+    expectExpand(h, a, 'H');
+    expectExpand(h, b, 'H');
+    expectExpand(h, d, 'H');
+    expectExpand(h, e, 'H');
+    expectExpand(h, h, 'H');
+  });
+
+  test('sealed with multiple paths', () {
+    //     (A)
+    //     / \
+    //   (B)  C
+    //   / \ /
+    //  D   E
+    var a = StaticType('A', isSealed: true);
+    var b = StaticType('B', isSealed: true, inherits: [a]);
+    var c = StaticType('C', inherits: [a]);
+    var d = StaticType('D', inherits: [b]);
+    var e = StaticType('E', inherits: [b, c]);
+
+    expectExpand(a, a, 'A');
+    expectExpand(a, b, 'B|C');
+    expectExpand(a, c, 'B|C');
+    expectExpand(a, d, 'D|E|C');
+    expectExpand(a, e, 'D|E|C');
+
+    expectExpand(b, a, 'B');
+    expectExpand(b, b, 'B');
+    expectExpand(b, c, 'B');
+    expectExpand(b, d, 'D|E');
+    expectExpand(b, e, 'D|E');
+
+    expectExpand(c, a, 'C');
+    expectExpand(c, b, 'C');
+    expectExpand(c, c, 'C');
+    expectExpand(c, d, 'C');
+    expectExpand(c, e, 'C');
+
+    expectExpand(d, a, 'D');
+    expectExpand(d, b, 'D');
+    expectExpand(d, c, 'D');
+    expectExpand(d, d, 'D');
+    expectExpand(d, e, 'D');
+
+    expectExpand(e, a, 'E');
+    expectExpand(e, b, 'E');
+    expectExpand(e, c, 'E');
+    expectExpand(e, d, 'E');
+    expectExpand(e, e, 'E');
+  });
+
+  test('nullable', () {
+    //   (A)
+    //   / \
+    //  B   C
+    //     / \
+    //    D   E
+    var a = StaticType('A', isSealed: true);
+    var b = StaticType('B', inherits: [a]);
+    var c = StaticType('C', inherits: [a]);
+    var d = StaticType('D', inherits: [c]);
+
+    expectExpand(a.nullable, a, 'A|Null');
+    expectExpand(a, a.nullable, 'A');
+    expectExpand(a.nullable, a.nullable, 'A|Null');
+
+    // Sealed subtype.
+    expectExpand(a.nullable, b, 'B|C|Null');
+    expectExpand(a, b.nullable, 'B|C');
+    expectExpand(a.nullable, b.nullable, 'B|C|Null');
+
+    // Unsealed subtype.
+    expectExpand(c.nullable, d, 'C|Null');
+    expectExpand(c, d.nullable, 'C');
+    expectExpand(c.nullable, d.nullable, 'C|Null');
+  });
+}
+
+void expectExpand(StaticType left, StaticType right, String expected) {
+  expect(expandType(left, right).join('|'), expected);
+}
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/intersect_empty_test.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/intersect_empty_test.dart
new file mode 100644
index 0000000..d25df88
--- /dev/null
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/intersect_empty_test.dart
@@ -0,0 +1,77 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:_fe_analyzer_shared/src/exhaustiveness/intersect_empty.dart';
+import 'package:_fe_analyzer_shared/src/exhaustiveness/space.dart';
+import 'package:_fe_analyzer_shared/src/exhaustiveness/static_type.dart';
+import 'package:test/test.dart';
+
+import 'utils.dart';
+
+void main() {
+  //   (A)
+  //   / \
+  //  B   C
+  var a = StaticType('A', isSealed: true);
+  var b = StaticType('B', inherits: [a]);
+  var c = StaticType('C', inherits: [a]);
+
+  Space A({StaticType? x, StaticType? y, StaticType? z}) => ty(
+      a, {if (x != null) 'x': x, if (y != null) 'y': y, if (z != null) 'z': z});
+  Space B({StaticType? x, StaticType? y, StaticType? z}) => ty(
+      b, {if (x != null) 'x': x, if (y != null) 'y': y, if (z != null) 'z': z});
+  Space C({StaticType? x, StaticType? y, StaticType? z}) => ty(
+      c, {if (x != null) 'x': x, if (y != null) 'y': y, if (z != null) 'z': z});
+
+  test('records', () {
+    expectIntersectEmpty(rec(x: a, y: a), rec(x: a, y: a), isFalse);
+    expectIntersectEmpty(rec(x: a, y: a), rec(x: a), isFalse);
+    expectIntersectEmpty(rec(w: a, x: a), rec(y: a, z: a), isFalse);
+    expectIntersectEmpty(rec(w: a, x: a, y: a), rec(x: a, y: a, z: a), isFalse);
+  });
+
+  test('types', () {
+    // Note: More comprehensive tests under intersect_types_test.dart.
+    expectIntersectEmpty(a, a, isFalse);
+    expectIntersectEmpty(a, b, isFalse);
+    expectIntersectEmpty(a, c, isFalse);
+    expectIntersectEmpty(b, c, isTrue);
+  });
+
+  test('field types', () {
+    expectIntersectEmpty(rec(x: a, y: b), rec(x: b, y: a), isFalse);
+    expectIntersectEmpty(rec(x: b), rec(x: c), isTrue);
+  });
+
+  test('types and fields', () {
+    expectIntersectEmpty(A(x: a), A(x: a), isFalse);
+    expectIntersectEmpty(A(x: a), A(x: b), isFalse);
+    expectIntersectEmpty(A(x: b), A(x: c), isTrue);
+
+    expectIntersectEmpty(A(x: a), B(x: a), isFalse);
+    expectIntersectEmpty(A(x: a), B(x: b), isFalse);
+    expectIntersectEmpty(A(x: b), B(x: c), isTrue);
+
+    expectIntersectEmpty(B(x: a), A(x: a), isFalse);
+    expectIntersectEmpty(B(x: a), A(x: b), isFalse);
+    expectIntersectEmpty(B(x: b), A(x: c), isTrue);
+
+    expectIntersectEmpty(B(x: a), B(x: a), isFalse);
+    expectIntersectEmpty(B(x: a), B(x: b), isFalse);
+    expectIntersectEmpty(B(x: b), B(x: c), isTrue);
+
+    expectIntersectEmpty(B(x: a), C(x: a), isTrue);
+    expectIntersectEmpty(B(x: a), C(x: b), isTrue);
+    expectIntersectEmpty(B(x: b), C(x: c), isTrue);
+  });
+}
+
+void expectIntersectEmpty(Object left, Object right, Matcher expected) {
+  var leftSpace = parseSpace(left);
+  var rightSpace = parseSpace(right);
+
+  // Intersection is symmetric so try both directions.
+  expect(intersectEmpty(leftSpace, rightSpace), expected);
+  expect(intersectEmpty(rightSpace, leftSpace), expected);
+}
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/intersect_test.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/intersect_test.dart
new file mode 100644
index 0000000..f90fa5a
--- /dev/null
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/intersect_test.dart
@@ -0,0 +1,80 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:_fe_analyzer_shared/src/exhaustiveness/intersect.dart';
+import 'package:_fe_analyzer_shared/src/exhaustiveness/space.dart';
+import 'package:_fe_analyzer_shared/src/exhaustiveness/static_type.dart';
+import 'package:test/test.dart';
+
+import 'utils.dart';
+
+void main() {
+  //   (A)
+  //   / \
+  //  B   C
+  var a = StaticType('A', isSealed: true);
+  var b = StaticType('B', inherits: [a]);
+  var c = StaticType('C', inherits: [a]);
+
+  Space A({StaticType? x, StaticType? y, StaticType? z}) => ty(
+      a, {if (x != null) 'x': x, if (y != null) 'y': y, if (z != null) 'z': z});
+  Space B({StaticType? x, StaticType? y, StaticType? z}) => ty(
+      b, {if (x != null) 'x': x, if (y != null) 'y': y, if (z != null) 'z': z});
+  Space C({StaticType? x, StaticType? y, StaticType? z}) => ty(
+      c, {if (x != null) 'x': x, if (y != null) 'y': y, if (z != null) 'z': z});
+
+  test('records', () {
+    expectIntersect(rec(x: a, y: a), rec(x: a, y: a), rec(x: a, y: a));
+    expectIntersect(rec(x: a, y: a), rec(x: a), rec(x: a, y: a));
+    expectIntersect(
+        rec(w: a, x: a), rec(y: a, z: a), rec(w: a, x: a, y: a, z: a));
+    expectIntersect(rec(w: a, x: a, y: a), rec(x: a, y: a, z: a),
+        rec(w: a, x: a, y: a, z: a));
+  });
+
+  test('types', () {
+    // Note: More comprehensive tests under intersect_types_test.dart.
+    expectIntersect(a, a, a);
+    expectIntersect(a, b, b);
+    expectIntersect(a, c, c);
+    expectIntersect(b, c, '∅');
+  });
+
+  test('field types', () {
+    expectIntersect(rec(x: a, y: b), rec(x: b, y: a), rec(x: b, y: b));
+    expectIntersect(rec(x: b), rec(x: c), '∅');
+  });
+
+  test('types and fields', () {
+    expectIntersect(A(x: a), A(x: a), A(x: a));
+    expectIntersect(A(x: a), A(x: b), A(x: b));
+    expectIntersect(A(x: b), A(x: c), '∅');
+
+    expectIntersect(A(x: a), B(x: a), B(x: a));
+    expectIntersect(A(x: a), B(x: b), B(x: b));
+    expectIntersect(A(x: b), B(x: c), '∅');
+
+    expectIntersect(B(x: a), A(x: a), B(x: a));
+    expectIntersect(B(x: a), A(x: b), B(x: b));
+    expectIntersect(B(x: b), A(x: c), '∅');
+
+    expectIntersect(B(x: a), B(x: a), B(x: a));
+    expectIntersect(B(x: a), B(x: b), B(x: b));
+    expectIntersect(B(x: b), B(x: c), '∅');
+
+    expectIntersect(B(x: a), C(x: a), '∅');
+    expectIntersect(B(x: a), C(x: b), '∅');
+    expectIntersect(B(x: b), C(x: c), '∅');
+  });
+}
+
+void expectIntersect(Object left, Object right, Object expected) {
+  var leftSpace = parseSpace(left);
+  var rightSpace = parseSpace(right);
+  var expectedText = parseSpace(expected).toString();
+
+  // Intersection is symmetric so try both directions.
+  expect(intersect(leftSpace, rightSpace).toString(), expectedText);
+  expect(intersect(rightSpace, leftSpace).toString(), expectedText);
+}
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/intersect_types_test.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/intersect_types_test.dart
new file mode 100644
index 0000000..704e9fd
--- /dev/null
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/intersect_types_test.dart
@@ -0,0 +1,99 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:_fe_analyzer_shared/src/exhaustiveness/intersect.dart';
+import 'package:_fe_analyzer_shared/src/exhaustiveness/static_type.dart';
+import 'package:test/test.dart';
+
+void main() {
+  test('hierarchy', () {
+    //   (A)
+    //   /|\
+    //  B C(D)
+    //     / \
+    //    E   F
+    var a = StaticType('A', isSealed: true);
+    var b = StaticType('B', inherits: [a]);
+    var c = StaticType('C', inherits: [a]);
+    var d = StaticType('D', isSealed: true, inherits: [a]);
+    var e = StaticType('E', inherits: [d]);
+    var f = StaticType('F', inherits: [d]);
+
+    expectIntersect(a, a, a);
+    expectIntersect(a, b, b);
+    expectIntersect(a, c, c);
+    expectIntersect(a, d, d);
+    expectIntersect(a, e, e);
+    expectIntersect(a, f, f);
+
+    expectIntersect(b, b, b);
+    expectIntersect(b, c, null);
+    expectIntersect(b, d, null);
+    expectIntersect(b, e, null);
+    expectIntersect(b, f, null);
+
+    expectIntersect(c, c, c);
+    expectIntersect(c, d, null);
+    expectIntersect(c, e, null);
+    expectIntersect(c, f, null);
+
+    expectIntersect(d, d, d);
+    expectIntersect(d, e, e);
+    expectIntersect(d, f, f);
+
+    expectIntersect(e, e, e);
+    expectIntersect(e, f, null);
+  });
+
+  test('sealed with multiple paths', () {
+    //     (A)
+    //     / \
+    //   (B)  C
+    //   / \ /
+    //  D   E
+    var a = StaticType('A', isSealed: true);
+    var b = StaticType('B', isSealed: true, inherits: [a]);
+    var c = StaticType('C', inherits: [a]);
+    var d = StaticType('D', inherits: [b]);
+    var e = StaticType('E', inherits: [b, c]);
+
+    expectIntersect(a, a, a);
+    expectIntersect(a, b, b);
+    expectIntersect(a, c, c);
+    expectIntersect(a, d, d);
+    expectIntersect(a, e, e);
+    expectIntersect(b, b, b);
+    expectIntersect(b, c, null);
+    expectIntersect(b, d, d);
+    expectIntersect(b, e, e);
+    expectIntersect(c, c, c);
+    expectIntersect(c, d, null);
+    expectIntersect(c, e, e);
+    expectIntersect(d, d, d);
+    expectIntersect(d, e, null);
+    expectIntersect(e, e, e);
+  });
+
+  test('nullable', () {
+    // A
+    // |
+    // B
+    var a = StaticType('A');
+    var b = StaticType('B', inherits: [a]);
+
+    expectIntersect(a, a.nullable, a);
+    expectIntersect(a, StaticType.nullType, null);
+    expectIntersect(a.nullable, StaticType.nullType, StaticType.nullType);
+
+    expectIntersect(a, b.nullable, b);
+    expectIntersect(a.nullable, b, b);
+    expectIntersect(a.nullable, b.nullable, b.nullable);
+  });
+}
+
+void expectIntersect(StaticType left, StaticType right, StaticType? expected) {
+  // Intersection is symmetric so try both directions.
+  expect(intersectTypes(left, right), expected);
+  expect(intersectTypes(right, left), expected);
+}
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/is_exhaustive_field_test.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/is_exhaustive_field_test.dart
new file mode 100644
index 0000000..e127979
--- /dev/null
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/is_exhaustive_field_test.dart
@@ -0,0 +1,259 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:_fe_analyzer_shared/src/exhaustiveness/static_type.dart';
+import 'package:test/test.dart';
+
+import 'utils.dart';
+
+void main() {
+  group('sealed subtypes', () {
+    //   (A)
+    //   / \
+    //  B   C
+    var a = StaticType('A', isSealed: true);
+    var b = StaticType('B', inherits: [a]);
+    var c = StaticType('C', inherits: [a]);
+    var t = StaticType('T', fields: {'x': a, 'y': a});
+
+    expectExhaustiveOnlyAll(t, [
+      {'x': b, 'y': b},
+      {'x': b, 'y': c},
+      {'x': c, 'y': b},
+      {'x': c, 'y': c},
+    ]);
+  });
+
+  group('sealed subtypes medium', () {
+    //   (A)
+    //   /|\
+    //  B C D
+    var a = StaticType('A', isSealed: true);
+    var b = StaticType('B', inherits: [a]);
+    var c = StaticType('C', inherits: [a]);
+    var d = StaticType('D', inherits: [a]);
+    var t = StaticType('T', fields: {'y': a, 'z': a});
+
+    expectExhaustiveOnlyAll(t, [
+      {'y': b, 'z': b},
+      {'y': b, 'z': c},
+      {'y': b, 'z': d},
+      {'y': c, 'z': b},
+      {'y': c, 'z': c},
+      {'y': c, 'z': d},
+      {'y': d, 'z': b},
+      {'y': d, 'z': c},
+      {'y': d, 'z': d},
+    ]);
+  });
+
+  group('sealed subtypes large', () {
+    //   (A)
+    //   /|\
+    //  B C D
+    var a = StaticType('A', isSealed: true);
+    var b = StaticType('B', inherits: [a]);
+    var c = StaticType('C', inherits: [a]);
+    var d = StaticType('D', inherits: [a]);
+    var t = StaticType('T', fields: {'w': a, 'x': a, 'y': a, 'z': a});
+
+    expectExhaustiveOnlyAll(t, [
+      {'w': b, 'x': b, 'y': b, 'z': b},
+      {'w': b, 'x': b, 'y': b, 'z': c},
+      {'w': b, 'x': b, 'y': b, 'z': d},
+      {'w': b, 'x': b, 'y': c, 'z': b},
+      {'w': b, 'x': b, 'y': c, 'z': c},
+      {'w': b, 'x': b, 'y': c, 'z': d},
+      {'w': b, 'x': b, 'y': d, 'z': b},
+      {'w': b, 'x': b, 'y': d, 'z': c},
+      {'w': b, 'x': b, 'y': d, 'z': d},
+      {'w': b, 'x': c, 'y': b, 'z': b},
+      {'w': b, 'x': c, 'y': b, 'z': c},
+      {'w': b, 'x': c, 'y': b, 'z': d},
+      {'w': b, 'x': c, 'y': c, 'z': b},
+      {'w': b, 'x': c, 'y': c, 'z': c},
+      {'w': b, 'x': c, 'y': c, 'z': d},
+      {'w': b, 'x': c, 'y': d, 'z': b},
+      {'w': b, 'x': c, 'y': d, 'z': c},
+      {'w': b, 'x': c, 'y': d, 'z': d},
+      {'w': b, 'x': d, 'y': b, 'z': b},
+      {'w': b, 'x': d, 'y': b, 'z': c},
+      {'w': b, 'x': d, 'y': b, 'z': d},
+      {'w': b, 'x': d, 'y': c, 'z': b},
+      {'w': b, 'x': d, 'y': c, 'z': c},
+      {'w': b, 'x': d, 'y': c, 'z': d},
+      {'w': b, 'x': d, 'y': d, 'z': b},
+      {'w': b, 'x': d, 'y': d, 'z': c},
+      {'w': b, 'x': d, 'y': d, 'z': d},
+      {'w': c, 'x': b, 'y': b, 'z': b},
+      {'w': c, 'x': b, 'y': b, 'z': c},
+      {'w': c, 'x': b, 'y': b, 'z': d},
+      {'w': c, 'x': b, 'y': c, 'z': b},
+      {'w': c, 'x': b, 'y': c, 'z': c},
+      {'w': c, 'x': b, 'y': c, 'z': d},
+      {'w': c, 'x': b, 'y': d, 'z': b},
+      {'w': c, 'x': b, 'y': d, 'z': c},
+      {'w': c, 'x': b, 'y': d, 'z': d},
+      {'w': c, 'x': c, 'y': b, 'z': b},
+      {'w': c, 'x': c, 'y': b, 'z': c},
+      {'w': c, 'x': c, 'y': b, 'z': d},
+      {'w': c, 'x': c, 'y': c, 'z': b},
+      {'w': c, 'x': c, 'y': c, 'z': c},
+      {'w': c, 'x': c, 'y': c, 'z': d},
+      {'w': c, 'x': c, 'y': d, 'z': b},
+      {'w': c, 'x': c, 'y': d, 'z': c},
+      {'w': c, 'x': c, 'y': d, 'z': d},
+      {'w': c, 'x': d, 'y': b, 'z': b},
+      {'w': c, 'x': d, 'y': b, 'z': c},
+      {'w': c, 'x': d, 'y': b, 'z': d},
+      {'w': c, 'x': d, 'y': c, 'z': b},
+      {'w': c, 'x': d, 'y': c, 'z': c},
+      {'w': c, 'x': d, 'y': c, 'z': d},
+      {'w': c, 'x': d, 'y': d, 'z': b},
+      {'w': c, 'x': d, 'y': d, 'z': c},
+      {'w': c, 'x': d, 'y': d, 'z': d},
+      {'w': d, 'x': b, 'y': b, 'z': b},
+      {'w': d, 'x': b, 'y': b, 'z': c},
+      {'w': d, 'x': b, 'y': b, 'z': d},
+      {'w': d, 'x': b, 'y': c, 'z': b},
+      {'w': d, 'x': b, 'y': c, 'z': c},
+      {'w': d, 'x': b, 'y': c, 'z': d},
+      {'w': d, 'x': b, 'y': d, 'z': b},
+      {'w': d, 'x': b, 'y': d, 'z': c},
+      {'w': d, 'x': b, 'y': d, 'z': d},
+      {'w': d, 'x': c, 'y': b, 'z': b},
+      {'w': d, 'x': c, 'y': b, 'z': c},
+      {'w': d, 'x': c, 'y': b, 'z': d},
+      {'w': d, 'x': c, 'y': c, 'z': b},
+      {'w': d, 'x': c, 'y': c, 'z': c},
+      {'w': d, 'x': c, 'y': c, 'z': d},
+      {'w': d, 'x': c, 'y': d, 'z': b},
+      {'w': d, 'x': c, 'y': d, 'z': c},
+      {'w': d, 'x': c, 'y': d, 'z': d},
+      {'w': d, 'x': d, 'y': b, 'z': b},
+      {'w': d, 'x': d, 'y': b, 'z': c},
+      {'w': d, 'x': d, 'y': b, 'z': d},
+      {'w': d, 'x': d, 'y': c, 'z': b},
+      {'w': d, 'x': d, 'y': c, 'z': c},
+      {'w': d, 'x': d, 'y': c, 'z': d},
+      {'w': d, 'x': d, 'y': d, 'z': b},
+      {'w': d, 'x': d, 'y': d, 'z': c},
+      {'w': d, 'x': d, 'y': d, 'z': d},
+    ]);
+  });
+
+  group('sealed transitive subtypes', () {
+    //     (A)
+    //     / \
+    //   (B) (C)
+    //   / \   \
+    //  D   E   F
+    var a = StaticType('A', isSealed: true);
+    var b = StaticType('B', isSealed: true, inherits: [a]);
+    var c = StaticType('C', isSealed: true, inherits: [a]);
+    var d = StaticType('D', inherits: [b]);
+    var e = StaticType('E', inherits: [b]);
+    var f = StaticType('F', inherits: [c]);
+
+    var t = StaticType('T', fields: {'x': a, 'y': a});
+    expectExhaustiveOnlyAll(t, [
+      {'x': a, 'y': a},
+    ]);
+
+    expectExhaustiveOnlyAll(t, [
+      {'x': b, 'y': b},
+      {'x': b, 'y': c},
+      {'x': c, 'y': b},
+      {'x': c, 'y': c},
+    ]);
+
+    expectExhaustiveOnlyAll(t, [
+      {'x': b, 'y': d},
+      {'x': b, 'y': e},
+      {'x': b, 'y': f},
+      {'x': c, 'y': d},
+      {'x': c, 'y': e},
+      {'x': c, 'y': f},
+    ]);
+  });
+
+  group('unsealed subtypes', () {
+    //    A
+    //   / \
+    //  B   C
+    var a = StaticType('A');
+    var b = StaticType('B', inherits: [a]);
+    var c = StaticType('C', inherits: [a]);
+
+    // Not exhaustive even when known subtypes covered.
+    var t = StaticType('T', fields: {'x': a, 'y': a});
+    expectNeverExhaustive(t, [
+      {'x': b, 'y': b},
+      {'x': b, 'y': c},
+      {'x': c, 'y': b},
+      {'x': c, 'y': c},
+    ]);
+
+    // Exhaustive if field static type is a covered subtype.
+    var u = StaticType('T', fields: {'x': b, 'y': c});
+    expectExhaustiveOnlyAll(u, [
+      {'x': b, 'y': c},
+    ]);
+  });
+
+  group('different fields', () {
+    //   (A)
+    //   / \
+    //  B   C
+    var a = StaticType('A', isSealed: true);
+    var b = StaticType('B', inherits: [a]);
+    var c = StaticType('C', inherits: [a]);
+    var t = StaticType('T', fields: {'x': a, 'y': a, 'z': a});
+
+    expectNeverExhaustive(t, [
+      {'x': b},
+      {'y': b},
+      {'z': b},
+    ]);
+
+    expectExhaustiveOnlyAll(t, [
+      {'x': b, 'y': a},
+      {'x': c, 'z': a},
+    ]);
+
+    expectExhaustiveOnlyAll(t, [
+      {'x': b, 'y': b},
+      {'x': b, 'y': c},
+      {'x': c, 'y': b},
+      {'x': c, 'y': c},
+    ]);
+  });
+
+  group('field types', () {
+    //   (A)
+    //   / \
+    //  B   C
+    var a = StaticType('A', isSealed: true);
+    var b = StaticType('B', inherits: [a]);
+    var c = StaticType('C', inherits: [a]);
+    var t = StaticType('T', fields: {'x': a, 'y': b, 'z': c});
+
+    expectExhaustiveOnlyAll(t, [
+      {'x': a, 'y': b, 'z': c},
+    ]);
+
+    expectExhaustiveOnlyAll(t, [
+      {'x': b},
+      {'x': c},
+    ]);
+
+    expectExhaustiveOnlyAll(t, [
+      {'y': b},
+    ]);
+
+    expectExhaustiveOnlyAll(t, [
+      {'z': c},
+    ]);
+  });
+}
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/is_exhaustive_nested_test.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/is_exhaustive_nested_test.dart
new file mode 100644
index 0000000..d236651
--- /dev/null
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/is_exhaustive_nested_test.dart
@@ -0,0 +1,57 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:_fe_analyzer_shared/src/exhaustiveness/static_type.dart';
+import 'package:test/test.dart';
+
+import 'utils.dart';
+
+void main() {
+  group('nested records', () {
+    //   (A)
+    //   / \
+    //  B   C
+    var a = StaticType('A', isSealed: true);
+    var b = StaticType('B', inherits: [a]);
+    var c = StaticType('C', inherits: [a]);
+    var t = StaticType('T', fields: {'x': a, 'y': b});
+    var u = StaticType('U', fields: {'w': t, 'z': t});
+
+    expectExhaustiveOnlyAll(u, [
+      rec(w: rec(x: a), z: t),
+    ]);
+
+    expectExhaustiveOnlyAll(u, [
+      rec(w: rec(x: a, y: a), z: rec(x: a, y: a)),
+    ]);
+
+    expectExhaustiveOnlyAll(u, [
+      rec(w: rec(x: a, y: b), z: rec(x: a, y: b)),
+    ]);
+
+    expectExhaustiveOnlyAll(u, [
+      rec(w: rec(x: b), z: t),
+      rec(w: rec(x: c), z: t),
+    ]);
+
+    expectExhaustiveOnlyAll(u, [
+      rec(w: rec(x: b, y: b), z: rec(x: b, y: b)),
+      rec(w: rec(x: b, y: b), z: rec(x: c, y: b)),
+      rec(w: rec(x: c, y: b), z: rec(x: b, y: b)),
+      rec(w: rec(x: c, y: b), z: rec(x: c, y: b)),
+    ]);
+  });
+
+  group('nested with different fields of same name', () {
+    // A B C D
+    var a = StaticType('A');
+    var b = StaticType('B', fields: {'x': a});
+    var c = StaticType('C', fields: {'x': b});
+    var d = StaticType('D', fields: {'x': c});
+
+    expectExhaustiveOnlyAll(d, [
+      rec(x: rec(x: rec(x: a))),
+    ]);
+  });
+}
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/is_exhaustive_type_test.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/is_exhaustive_type_test.dart
new file mode 100644
index 0000000..77c37ed
--- /dev/null
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/is_exhaustive_type_test.dart
@@ -0,0 +1,195 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:_fe_analyzer_shared/src/exhaustiveness/space.dart';
+import 'package:_fe_analyzer_shared/src/exhaustiveness/static_type.dart';
+import 'package:test/test.dart';
+
+import 'utils.dart';
+
+/// Test `subtract()` on combinations of types.
+void main() {
+  // Note: In the class diagrams, "(_)" means "sealed". A bare name is unsealed.
+  group('sealed family', () {
+    //     (A)
+    //     / \
+    //   (B) (C)
+    //   / \   \
+    //  D   E   F
+    var a = StaticType('A', isSealed: true);
+    var b = StaticType('B', isSealed: true, inherits: [a]);
+    var c = StaticType('C', isSealed: true, inherits: [a]);
+    var d = StaticType('D', inherits: [b]);
+    var e = StaticType('E', inherits: [b]);
+    var f = StaticType('F', inherits: [c]);
+
+    var checkExhaustive = _makeTestFunction([a, b, c, d, e, f]);
+    checkExhaustive([a], 'ABCDEF');
+    checkExhaustive([b], 'BDE');
+    checkExhaustive([c], 'CF');
+    checkExhaustive([d], 'D');
+    checkExhaustive([f], 'CF');
+
+    checkExhaustive([a, b], 'ABCDEF');
+    checkExhaustive([a, c], 'ABCDEF');
+    checkExhaustive([a, d], 'ABCDEF');
+    checkExhaustive([a, f], 'ABCDEF');
+
+    checkExhaustive([b, c], 'ABCDEF');
+    checkExhaustive([b, d], 'BDE');
+    checkExhaustive([b, f], 'ABCDEF');
+
+    checkExhaustive([c, d], 'CDF');
+    checkExhaustive([c, e], 'CEF');
+    checkExhaustive([c, f], 'CF');
+
+    checkExhaustive([d, e], 'BDE'); // Covers B because both cases covered.
+    checkExhaustive([d, f], 'CDF');
+    checkExhaustive([e, f], 'CEF');
+
+    checkExhaustive([d, e, f], 'ABCDEF'); // All cases covered.
+  });
+
+  group('sealed with many subtypes', () {
+    //     (A)
+    //    //|\\
+    //   / /|\ \
+    //  B C D E F
+    var a = StaticType('A', isSealed: true);
+    var b = StaticType('B', inherits: [a]);
+    var c = StaticType('C', inherits: [a]);
+    var d = StaticType('D', inherits: [a]);
+    var e = StaticType('E', inherits: [a]);
+    var f = StaticType('F', inherits: [a]);
+
+    var checkExhaustive = _makeTestFunction([a, b, c, d, e, f]);
+    checkExhaustive([a], 'ABCDEF');
+    checkExhaustive([b], 'B');
+    checkExhaustive([c, e], 'CE');
+    checkExhaustive([b, d, f], 'BDF');
+    checkExhaustive([b, c, e, f], 'BCEF');
+    checkExhaustive([b, c, d, e, f], 'ABCDEF'); // Covers A.
+  });
+
+  group('sealed with multiple paths', () {
+    //     (A)
+    //     / \
+    //   (B)  C
+    //   / \ /
+    //  D   E
+    var a = StaticType('A', isSealed: true);
+    var b = StaticType('B', isSealed: true, inherits: [a]);
+    var c = StaticType('C', inherits: [a]);
+    var d = StaticType('D', inherits: [b]);
+    var e = StaticType('E', inherits: [b, c]);
+
+    var checkExhaustive = _makeTestFunction([a, b, c, d, e]);
+    checkExhaustive([a], 'ABCDE');
+    checkExhaustive([b], 'BDE');
+    checkExhaustive([c], 'CE');
+    checkExhaustive([d], 'D');
+    checkExhaustive([e], 'E');
+
+    checkExhaustive([b, c], 'ABCDE');
+    checkExhaustive([b, d], 'BDE');
+    checkExhaustive([b, e], 'BDE');
+    checkExhaustive([c, d], 'CDE');
+    checkExhaustive([d, e], 'BDE');
+  });
+
+  group('sealed with unsealed supertype', () {
+    //    A
+    //    |
+    //   (B)
+    //   / \
+    //  C   D
+    var a = StaticType('A');
+    var b = StaticType('B', isSealed: true, inherits: [a]);
+    var c = StaticType('C', inherits: [b]);
+    var d = StaticType('D', inherits: [b]);
+
+    var checkExhaustive = _makeTestFunction([a, b, c, d]);
+    checkExhaustive([a], 'ABCD');
+    checkExhaustive([b], 'BCD');
+    checkExhaustive([c], 'C');
+    checkExhaustive([d], 'D');
+    checkExhaustive([c, d], 'BCD');
+  });
+
+  group('sealed with single subclass', () {
+    // (A)
+    //  |
+    // (B)
+    //  |
+    //  C
+    var a = StaticType('A', isSealed: true);
+    var b = StaticType('B', isSealed: true, inherits: [a]);
+    var c = StaticType('C', inherits: [b]);
+
+    var checkExhaustive = _makeTestFunction([a, b, c]);
+    checkExhaustive([a], 'ABC');
+    checkExhaustive([b], 'ABC'); // Every A must be a B, so A is covered.
+    checkExhaustive([c], 'ABC'); // Every C must be a B, which must be an A.
+    checkExhaustive([a, b], 'ABC');
+    checkExhaustive([a, c], 'ABC');
+    checkExhaustive([b, c], 'ABC');
+    checkExhaustive([a, b, c], 'ABC');
+  });
+
+  group('unsealed', () {
+    //      A
+    //     / \
+    //    B   C
+    //   / \ / \
+    //  D   E   F
+    var a = StaticType('A');
+    var b = StaticType('B', inherits: [a]);
+    var c = StaticType('C', inherits: [a]);
+    var d = StaticType('D', inherits: [b]);
+    var e = StaticType('E', inherits: [b, c]);
+    var f = StaticType('F', inherits: [c]);
+
+    var checkExhaustive = _makeTestFunction([a, b, c, d, e, f]);
+    checkExhaustive([a], 'ABCDEF');
+    checkExhaustive([b], 'BDE');
+    checkExhaustive([d], 'D');
+    checkExhaustive([a, b], 'ABCDEF'); // Same as A.
+    checkExhaustive([a, d], 'ABCDEF'); // Same as A.
+    checkExhaustive([d, e], 'DE'); // Doesn't cover B because unsealed.
+    checkExhaustive([d, f], 'DF');
+    checkExhaustive([e, f], 'EF'); // Doesn't cover C because unsealed.
+    checkExhaustive([b, f], 'BDEF');
+    checkExhaustive([c, d], 'CDEF');
+    checkExhaustive([d, e, f], 'DEF');
+  });
+}
+
+/// Returns a function that takes a list of `types` and a string containing a
+/// list of type letters that map to the types in [allTypes].
+///
+/// The function checks that the list of types exhaustively covers every type
+/// whose name appears in the string. So:
+///
+///     checkExhaustive([d, e], 'bde');
+///
+/// Means that the union of D|E should be exhaustive over B, D, and E and not
+/// exhaustive over the other types in [allTypes].
+Function(List<StaticType>, String) _makeTestFunction(
+    List<StaticType> allTypes) {
+  assert(allTypes.length <= 6, 'Only supports up to six types.');
+  var letters = 'ABCDEF';
+
+  return (types, covered) {
+    var spaces = types.map((type) => Space(type)).toList();
+
+    for (var i = 0; i < allTypes.length; i++) {
+      var value = Space(allTypes[i]);
+      if (covered.contains(letters[i])) {
+        expectExhaustive(value, spaces);
+      } else {
+        expectNotExhaustive(value, spaces);
+      }
+    }
+  };
+}
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/report_errors_test.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/report_errors_test.dart
new file mode 100644
index 0000000..62da513
--- /dev/null
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/report_errors_test.dart
@@ -0,0 +1,129 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:_fe_analyzer_shared/src/exhaustiveness/exhaustive.dart';
+import 'package:_fe_analyzer_shared/src/exhaustiveness/static_type.dart';
+import 'package:test/test.dart';
+
+import 'utils.dart';
+
+void main() {
+  // Here, "(_)" means "sealed". A bare name is unsealed.
+  //
+  //     (A)
+  //     / \
+  //   (B) (C)
+  //   / \   \
+  //  D   E   F
+  //         / \
+  //        G   H
+  var a = StaticType('A', isSealed: true);
+  var b = StaticType('B', isSealed: true, inherits: [a]);
+  var c = StaticType('C', isSealed: true, inherits: [a]);
+  var d = StaticType('D', inherits: [b]);
+  var e = StaticType('E', inherits: [b]);
+  var f = StaticType('F', inherits: [c]);
+  var g = StaticType('G', inherits: [f]);
+  var h = StaticType('H', inherits: [f]);
+
+  test('exhaustiveness', () {
+    // Case matching top type covers all subtypes.
+    expectReportErrors(a, [a]);
+    expectReportErrors(b, [a]);
+    expectReportErrors(d, [a]);
+
+    // Case matching subtype doesn't cover supertype.
+    expectReportErrors(a, [b], 'A is not exhaustively matched by B.');
+    expectReportErrors(b, [b]);
+    expectReportErrors(d, [b]);
+    expectReportErrors(e, [b]);
+
+    // Matching subtypes of sealed type is exhaustive.
+    expectReportErrors(a, [b, c]);
+    expectReportErrors(a, [d, e, f]);
+    expectReportErrors(a, [b, f]);
+    expectReportErrors(a, [c, d], 'A is not exhaustively matched by C|D.');
+    expectReportErrors(f, [g, h], 'F is not exhaustively matched by G|H.');
+  });
+
+  test('unreachable case', () {
+    // Same type.
+    expectReportErrors(b, [b, b], 'Case #2 B is covered by B.');
+
+    // Previous case is supertype.
+    expectReportErrors(b, [a, b], 'Case #2 B is covered by A.');
+
+    // Previous subtype cases cover sealed supertype.
+    expectReportErrors(a, [b, c, a], 'Case #3 A is covered by B|C.');
+    expectReportErrors(a, [d, e, f, a], 'Case #4 A is covered by D|E|F.');
+    expectReportErrors(a, [b, f, a], 'Case #3 A is covered by B|F.');
+    expectReportErrors(a, [c, d, a]);
+
+    // Previous subtype cases do not cover unsealed supertype.
+    expectReportErrors(f, [g, h, f]);
+  });
+
+  test('covered record destructuring', () {
+    var r = StaticType('R', fields: {'x': a, 'y': a, 'z': a});
+
+    // Wider field is not covered.
+    expectReportErrors(r, [
+      {'x': b},
+      {'x': a}
+    ]);
+
+    // Narrower field is covered.
+    expectReportErrors(
+        r,
+        [
+          {'x': a},
+          {'x': b}
+        ],
+        'Case #2 (x: B) is covered by (x: A).');
+  });
+
+  test('nullable sealed', () {
+    //     (A)
+    //     / \
+    //    B  (C)
+    //       / \
+    //      D   E
+    var a = StaticType('A', isSealed: true);
+    var b = StaticType('B', inherits: [a]);
+    var c = StaticType('C', isSealed: true, inherits: [a]);
+    var d = StaticType('D', inherits: [c]);
+    var e = StaticType('E', inherits: [c]);
+
+    // Must cover null.
+    expectReportErrors(
+        a.nullable, [b, d, e], 'A? is not exhaustively matched by B|D|E.');
+
+    // Can cover null with any nullable subtype.
+    expectReportErrors(a.nullable, [b.nullable, c]);
+    expectReportErrors(a.nullable, [b, c.nullable]);
+    expectReportErrors(a.nullable, [b, d.nullable, e]);
+    expectReportErrors(a.nullable, [b, d, e.nullable]);
+
+    // Can cover null with a null space.
+    expectReportErrors(a.nullable, [b, c, StaticType.nullType]);
+    expectReportErrors(a.nullable, [b, d, e, StaticType.nullType]);
+
+    // Nullable covers the non-null.
+    expectReportErrors(
+        a.nullable, [a.nullable, a], 'Case #2 A is covered by A?.');
+    expectReportErrors(
+        b.nullable, [a.nullable, b], 'Case #2 B is covered by A?.');
+
+    // Nullable covers null.
+    expectReportErrors(a.nullable, [a.nullable, StaticType.nullType],
+        'Case #2 Null is covered by A?.');
+    expectReportErrors(b.nullable, [a.nullable, StaticType.nullType],
+        'Case #2 Null is covered by A?.');
+  });
+}
+
+void expectReportErrors(StaticType valueType, List<Object> cases,
+    [String errors = '']) {
+  expect(reportErrors(valueType, parseSpaces(cases)), errors);
+}
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/static_type_test.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/static_type_test.dart
new file mode 100644
index 0000000..54df2c6
--- /dev/null
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/static_type_test.dart
@@ -0,0 +1,172 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:_fe_analyzer_shared/src/exhaustiveness/static_type.dart';
+import 'package:test/test.dart';
+
+void main() {
+  group('isSubtypeOf()', () {
+    var a = StaticType('A');
+    var b = StaticType('B', inherits: [a]);
+    var b2 = StaticType('B2', inherits: [a]);
+    var c = StaticType('C', inherits: [b]);
+    var d = StaticType('D', inherits: [c]);
+
+    test('subtype includes self', () {
+      expect(a.isSubtypeOf(a), isTrue);
+      expect(b.isSubtypeOf(b), isTrue);
+      expect(c.isSubtypeOf(c), isTrue);
+      expect(d.isSubtypeOf(d), isTrue);
+    });
+
+    test('immediate', () {
+      expect(a.isSubtypeOf(b), isFalse);
+      expect(b.isSubtypeOf(a), isTrue);
+
+      expect(b.isSubtypeOf(c), isFalse);
+      expect(c.isSubtypeOf(b), isTrue);
+
+      expect(c.isSubtypeOf(d), isFalse);
+      expect(d.isSubtypeOf(c), isTrue);
+    });
+
+    test('transitive', () {
+      expect(a.isSubtypeOf(c), isFalse);
+      expect(c.isSubtypeOf(a), isTrue);
+
+      expect(b.isSubtypeOf(d), isFalse);
+      expect(d.isSubtypeOf(b), isTrue);
+
+      expect(a.isSubtypeOf(d), isFalse);
+      expect(d.isSubtypeOf(a), isTrue);
+    });
+
+    test('unrelated', () {
+      expect(b.isSubtypeOf(b2), isFalse);
+      expect(b2.isSubtypeOf(b), isFalse);
+
+      expect(c.isSubtypeOf(b2), isFalse);
+      expect(b2.isSubtypeOf(c), isFalse);
+
+      expect(d.isSubtypeOf(b2), isFalse);
+      expect(b2.isSubtypeOf(d), isFalse);
+    });
+
+    test('multiple supertypes', () {
+      //      I1   I2   I3
+      //        \ /  \ /
+      //        I12  I23
+      //           \/
+      //          I123
+      var i1 = StaticType('I1');
+      var i2 = StaticType('I2');
+      var i3 = StaticType('I3');
+      var i12 = StaticType('I12', inherits: [i1, i2]);
+      var i23 = StaticType('I12', inherits: [i2, i3]);
+      var i123 = StaticType('I12', inherits: [i12, i23]);
+
+      expect(i1.isSubtypeOf(i2), isFalse);
+      expect(i2.isSubtypeOf(i1), isFalse);
+      expect(i2.isSubtypeOf(i3), isFalse);
+      expect(i3.isSubtypeOf(i2), isFalse);
+      expect(i1.isSubtypeOf(i3), isFalse);
+      expect(i3.isSubtypeOf(i1), isFalse);
+
+      expect(i1.isSubtypeOf(i12), isFalse);
+      expect(i12.isSubtypeOf(i1), isTrue);
+      expect(i2.isSubtypeOf(i12), isFalse);
+      expect(i12.isSubtypeOf(i2), isTrue);
+      expect(i3.isSubtypeOf(i12), isFalse);
+      expect(i12.isSubtypeOf(i3), isFalse);
+
+      expect(i1.isSubtypeOf(i23), isFalse);
+      expect(i23.isSubtypeOf(i1), isFalse);
+      expect(i2.isSubtypeOf(i23), isFalse);
+      expect(i23.isSubtypeOf(i2), isTrue);
+      expect(i3.isSubtypeOf(i23), isFalse);
+      expect(i23.isSubtypeOf(i3), isTrue);
+
+      expect(i1.isSubtypeOf(i123), isFalse);
+      expect(i123.isSubtypeOf(i1), isTrue);
+      expect(i2.isSubtypeOf(i123), isFalse);
+      expect(i123.isSubtypeOf(i2), isTrue);
+      expect(i3.isSubtypeOf(i123), isFalse);
+      expect(i123.isSubtypeOf(i3), isTrue);
+      expect(i12.isSubtypeOf(i123), isFalse);
+      expect(i123.isSubtypeOf(i12), isTrue);
+      expect(i23.isSubtypeOf(i123), isFalse);
+      expect(i123.isSubtypeOf(i23), isTrue);
+    });
+
+    test('nullable', () {
+      var a = StaticType('A');
+      var b = StaticType('B', inherits: [a]);
+
+      expect(StaticType.nullType.isSubtypeOf(a), isFalse);
+      expect(StaticType.nullType.isSubtypeOf(b), isFalse);
+      expect(StaticType.nullType.isSubtypeOf(a.nullable), isTrue);
+      expect(StaticType.nullType.isSubtypeOf(b.nullable), isTrue);
+
+      expect(a.isSubtypeOf(StaticType.nullType), isFalse);
+      expect(b.isSubtypeOf(StaticType.nullType), isFalse);
+      expect(a.nullable.isSubtypeOf(StaticType.nullType), isFalse);
+      expect(b.nullable.isSubtypeOf(StaticType.nullType), isFalse);
+
+      expect(a.isSubtypeOf(a.nullable), isTrue);
+      expect(a.nullable.isSubtypeOf(a), isFalse);
+      expect(a.nullable.isSubtypeOf(a.nullable), isTrue);
+
+      expect(a.isSubtypeOf(b.nullable), isFalse);
+      expect(a.nullable.isSubtypeOf(b), isFalse);
+      expect(a.nullable.isSubtypeOf(b.nullable), isFalse);
+
+      expect(b.isSubtypeOf(a.nullable), isTrue);
+      expect(b.nullable.isSubtypeOf(a), isFalse);
+      expect(b.nullable.isSubtypeOf(a.nullable), isTrue);
+    });
+  });
+
+  test('fields', () {
+    var a = StaticType('A');
+    var b = StaticType('B');
+    var c = StaticType('C', fields: {'x': a, 'y': b});
+    var d = StaticType('D', fields: {'w': a});
+    var e = StaticType('E', inherits: [c, d], fields: {'z': b});
+
+    expect(a.fields, isEmpty);
+    expect(b.fields, isEmpty);
+
+    expect(c.fields, hasLength(2));
+    expect(c.fields['x'], a);
+    expect(c.fields['y'], b);
+
+    // Fields are inherited.
+    expect(e.fields, hasLength(4));
+    expect(e.fields['x'], a);
+    expect(e.fields['y'], b);
+    expect(e.fields['w'], a);
+    expect(e.fields['z'], b);
+
+    // Overridden field types win.
+    var f = StaticType('F', fields: {'x': a});
+    var g = StaticType('G', inherits: [f], fields: {'x': b});
+    expect(g.fields, hasLength(1));
+    expect(g.fields['x'], b);
+  });
+
+  test('subtypes', () {
+    var a = StaticType('A', isSealed: true);
+    var b = StaticType('B', inherits: [a]);
+    var c = StaticType('C', inherits: [a]);
+    var d = StaticType('D', inherits: [c]);
+
+    // Gets subtypes for sealed type.
+    var aSubtypes = a.subtypes.toList();
+    expect(aSubtypes, unorderedEquals([b, c]));
+
+    // And unsealed.
+    var cSubtypes = c.subtypes.toList();
+    expect(cSubtypes, unorderedEquals([d]));
+  });
+}
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/subtract_test.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/subtract_test.dart
new file mode 100644
index 0000000..5a09217
--- /dev/null
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/subtract_test.dart
@@ -0,0 +1,253 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:_fe_analyzer_shared/src/exhaustiveness/space.dart';
+import 'package:_fe_analyzer_shared/src/exhaustiveness/static_type.dart';
+import 'package:_fe_analyzer_shared/src/exhaustiveness/subtract.dart';
+import 'package:test/test.dart';
+
+import 'utils.dart';
+
+void main() {
+  group('empty', () {
+    var a = StaticType('A');
+    var b = StaticType('B', inherits: [a], fields: {'x': a, 'y': a});
+    var c = StaticType('C', inherits: [a]);
+
+    expectSubtract('∅', '∅', '∅');
+
+    // Subtracting from empty stays empty.
+    expectSubtract('∅', a, '∅');
+    expectSubtract('∅', [b, c], '∅');
+    expectSubtract('∅', {'x': a}, '∅');
+    expectSubtract('∅', ty(b, {'x': a}), '∅');
+
+    // Subtracting empty leaves unchanged.
+    expectSubtract(a, '∅', 'A');
+    expectSubtract([b, c], '∅', 'B|C');
+    expectSubtract({'x': a}, '∅', '(x: A)');
+    expectSubtract(ty(b, {'x': a}), '∅', 'B(x: A)');
+  });
+
+  group('union with sealed types', () {
+    //   (A)
+    //   /|\
+    //  B C(D)
+    //     / \
+    //    E   F
+    var a = StaticType('A', isSealed: true);
+    var b = StaticType('B', inherits: [a]);
+    var c = StaticType('C', inherits: [a]);
+    var d = StaticType('D', isSealed: true, inherits: [a]);
+    var e = StaticType('E', inherits: [d]);
+    var f = StaticType('F', inherits: [d]);
+
+    expectSubtract(a, b, 'C|D');
+    expectSubtract(a, c, 'B|D');
+    expectSubtract(a, d, 'B|C');
+    expectSubtract(a, e, 'B|C|F');
+    expectSubtract(a, f, 'B|C|E');
+    expectSubtract(a, [b, c], 'D');
+    expectSubtract(a, [b, d], 'C');
+    expectSubtract(a, [b, e], 'C|F');
+
+    expectSubtract([b, c], b, 'C');
+    expectSubtract([b, c], c, 'B');
+    expectSubtract([b, c, d], b, 'C|D');
+    expectSubtract([b, c, d], c, 'B|D');
+    expectSubtract([b, c, d], d, 'B|C');
+
+    expectSubtract([b, c], [b, c], '∅');
+    expectSubtract([b, c], [b, d], 'C');
+    expectSubtract([b, d], [b, c], 'D');
+    expectSubtract([b, c, d], [b, c], 'D');
+
+    expectSubtract([b, d], e, 'B|F');
+    expectSubtract([b, e], d, 'B');
+  });
+
+  group('unsealed subtype', () {
+    //   A   B
+    //  / \ /
+    // C   D
+    //  \ /
+    //   E
+    var a = StaticType('A');
+    var b = StaticType('B');
+    var c = StaticType('C', inherits: [a]);
+    var d = StaticType('D', inherits: [a, b]);
+    var e = StaticType('E', inherits: [c, d]);
+
+    expectSubtract(a, a, '∅');
+    expectSubtract(a, b, 'A');
+    expectSubtract(a, c, 'A');
+    expectSubtract(a, d, 'A');
+    expectSubtract(a, e, 'A');
+
+    expectSubtract(b, a, 'B');
+    expectSubtract(b, b, '∅');
+    expectSubtract(b, c, 'B');
+    expectSubtract(b, d, 'B');
+    expectSubtract(b, e, 'B');
+
+    expectSubtract(c, a, '∅');
+    expectSubtract(c, b, 'C');
+    expectSubtract(c, c, '∅');
+    expectSubtract(c, d, 'C');
+    expectSubtract(c, e, 'C');
+
+    expectSubtract(d, a, '∅');
+    expectSubtract(d, b, '∅');
+    expectSubtract(d, c, 'D');
+    expectSubtract(d, d, '∅');
+    expectSubtract(d, e, 'D');
+
+    expectSubtract(e, a, '∅');
+    expectSubtract(e, b, '∅');
+    expectSubtract(e, c, '∅');
+    expectSubtract(e, d, '∅');
+    expectSubtract(e, e, '∅');
+  });
+
+  group('unsealed subtype and field', () {
+    //  X  A
+    //  |  |
+    //  Y  B
+    var x = StaticType('X');
+    var y = StaticType('Y', inherits: [x]);
+    var a = StaticType('A', fields: {'x': StaticType.top});
+    var b = StaticType('B', inherits: [a]);
+
+    Space A({required StaticType x}) => ty(a, {'x': x});
+    Space B({required StaticType x}) => ty(b, {'x': x});
+
+    expectSubtract(A(x: x), A(x: x), '∅');
+    expectSubtract(A(x: x), B(x: x), 'A(x: X)');
+    expectSubtract(B(x: x), A(x: x), '∅');
+    expectSubtract(B(x: x), B(x: x), '∅');
+
+    expectSubtract(A(x: x), A(x: y), 'A(x: X)');
+    expectSubtract(A(x: x), B(x: y), 'A(x: X)');
+    expectSubtract(B(x: x), A(x: y), 'B(x: X)');
+    expectSubtract(B(x: x), B(x: y), 'B(x: X)');
+
+    expectSubtract(A(x: y), A(x: x), '∅');
+    expectSubtract(A(x: y), B(x: x), 'A(x: Y)');
+    expectSubtract(B(x: y), A(x: x), '∅');
+    expectSubtract(B(x: y), B(x: x), '∅');
+
+    expectSubtract(A(x: y), A(x: y), '∅');
+    expectSubtract(A(x: y), B(x: y), 'A(x: Y)');
+    expectSubtract(B(x: y), A(x: y), '∅');
+    expectSubtract(B(x: y), B(x: y), '∅');
+
+    expectSubtract(A(x: x), a, '∅');
+    expectSubtract(A(x: x), b, 'A(x: X)');
+    expectSubtract(B(x: x), a, '∅');
+    expectSubtract(B(x: x), b, '∅');
+    expectSubtract(a, A(x: x), 'A');
+    expectSubtract(b, A(x: x), 'B');
+    expectSubtract(a, B(x: x), 'A');
+    expectSubtract(b, B(x: x), 'B');
+  });
+
+  group('sealed subtype and field', () {
+    //   (X)    (A)
+    //   /|\    /|\
+    //  W Y Z  B C D
+    var x = StaticType('X', isSealed: true);
+    StaticType('W', inherits: [x]);
+    var y = StaticType('Y', inherits: [x]);
+    StaticType('Z', inherits: [x]);
+    var a = StaticType('A', isSealed: true, fields: {'x': StaticType.top});
+    var b = StaticType('B', inherits: [a]);
+    StaticType('C', inherits: [a]);
+    StaticType('D', inherits: [a]);
+
+    Space A({required StaticType x}) => ty(a, {'x': x});
+    Space B({required StaticType x}) => ty(b, {'x': x});
+
+    expectSubtract(A(x: x), A(x: x), '∅');
+    expectSubtract(A(x: x), B(x: x), 'C(x: X)|D(x: X)');
+    expectSubtract(B(x: x), A(x: x), '∅');
+    expectSubtract(B(x: x), B(x: x), '∅');
+
+    expectSubtract(A(x: x), A(x: y), 'A(x: W|Z)');
+    expectSubtract(A(x: x), B(x: y), 'B(x: W|Z)|C(x: X)|D(x: X)');
+    expectSubtract(B(x: x), A(x: y), 'B(x: W|Z)');
+    expectSubtract(B(x: x), B(x: y), 'B(x: W|Z)');
+
+    expectSubtract(A(x: y), A(x: x), '∅');
+    expectSubtract(A(x: y), B(x: x), 'C(x: Y)|D(x: Y)');
+    expectSubtract(B(x: y), A(x: x), '∅');
+    expectSubtract(B(x: y), B(x: x), '∅');
+
+    expectSubtract(A(x: y), A(x: y), '∅');
+    expectSubtract(A(x: y), B(x: y), 'C(x: Y)|D(x: Y)');
+    expectSubtract(B(x: y), A(x: y), '∅');
+    expectSubtract(B(x: y), B(x: y), '∅');
+
+    expectSubtract(A(x: x), a, '∅');
+    expectSubtract(A(x: x), b, 'C(x: X)|D(x: X)');
+    expectSubtract(B(x: x), a, '∅');
+    expectSubtract(B(x: x), b, '∅');
+
+    // Note that these don't specialize x to "W|Z" because it's declared type
+    // is top, which isn't sealed.
+    expectSubtract(a, A(x: x), 'A');
+    expectSubtract(b, A(x: x), 'B');
+    expectSubtract(a, B(x: x), 'B|C|D');
+    expectSubtract(b, B(x: x), 'B');
+  });
+
+  group('sealed subtype and field', () {
+    //   (X)    (A)
+    //   /|\    /|\
+    //  W Y Z  B C D
+    var x = StaticType('X', isSealed: true);
+    var w = StaticType('W', inherits: [x]);
+    var y = StaticType('Y', inherits: [x]);
+    var z = StaticType('Z', inherits: [x]);
+    var a = StaticType('A', isSealed: true, fields: {'x': x, 'y': x, 'z': x});
+    var b = StaticType('B', inherits: [a]);
+    var c = StaticType('C', inherits: [a]);
+    StaticType('D', inherits: [a]);
+
+    Space A({StaticType? x, StaticType? y, StaticType? z}) => ty(a,
+        {if (x != null) 'x': x, if (y != null) 'y': y, if (z != null) 'z': z});
+    Space B({StaticType? x, StaticType? y, StaticType? z}) => ty(b,
+        {if (x != null) 'x': x, if (y != null) 'y': y, if (z != null) 'z': z});
+
+    // Fields only on left.
+    expectSubtract(A(x: x, y: y), a, '∅');
+    expectSubtract(A(x: x, y: y), b, 'C(x: X, y: Y)|D(x: X, y: Y)');
+    expectSubtract(B(x: x, y: y), a, '∅');
+    expectSubtract(B(x: x, y: y), c, 'B(x: X, y: Y)');
+
+    expectSubtract(A(x: w, y: z), a, '∅');
+    expectSubtract(A(x: w, y: z), b, 'C(x: W, y: Z)|D(x: W, y: Z)');
+    expectSubtract(B(x: w, y: z), a, '∅');
+    expectSubtract(B(x: w, y: z), c, 'B(x: W, y: Z)');
+
+    // Fields only on right.
+    expectSubtract(a, A(x: x, y: y), 'A(x: X, y: W|Z)');
+    expectSubtract(b, A(x: x, y: y), 'B(x: X, y: W|Z)');
+    expectSubtract(a, B(x: x, y: y), 'B(x: X, y: W|Z)|C|D');
+    expectSubtract(c, B(x: x, y: y), 'C');
+
+    expectSubtract(a, A(x: w, y: z), 'A(x: Y|Z, y: X)|A(x: X, y: W|Y)');
+    expectSubtract(b, A(x: w, y: z), 'B(x: Y|Z, y: X)|B(x: X, y: W|Y)');
+    expectSubtract(a, B(x: w, y: z), 'B(x: Y|Z, y: X)|B(x: X, y: W|Y)|C|D');
+    expectSubtract(c, B(x: w, y: z), 'C');
+  });
+}
+
+void expectSubtract(Object left, Object right, String expected) {
+  var leftSpace = parseSpace(left);
+  var rightSpace = parseSpace(right);
+  test('$leftSpace - $rightSpace', () {
+    var result = subtract(leftSpace, rightSpace);
+    expect(result.toString(), expected);
+  });
+}
diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/utils.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/utils.dart
new file mode 100644
index 0000000..10cc5be
--- /dev/null
+++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/utils.dart
@@ -0,0 +1,102 @@
+// Copyright (c) 2022, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:_fe_analyzer_shared/src/exhaustiveness/exhaustive.dart';
+import 'package:_fe_analyzer_shared/src/exhaustiveness/space.dart';
+import 'package:_fe_analyzer_shared/src/exhaustiveness/static_type.dart';
+import 'package:test/test.dart';
+
+/// Test that [spaces] is exhaustive over [value].
+void expectExhaustive(Space value, List<Space> spaces) {
+  _expectExhaustive(value, spaces, true);
+}
+
+/// Test that [cases] are exhaustive over [type] if and only if all cases are
+/// included and that all subsets of the cases are not exhaustive.
+void expectExhaustiveOnlyAll(StaticType type, List<Object> cases) {
+  _testCases(type, cases, true);
+}
+
+/// Test that [cases] are not exhaustive over [type]. Also test that omitting
+/// each case is still not exhaustive.
+void expectNeverExhaustive(StaticType type, List<Object> cases) {
+  _testCases(type, cases, false);
+}
+
+/// Test that [spaces] is not exhaustive over [value].
+void expectNotExhaustive(Space value, List<Space> spaces) {
+  _expectExhaustive(value, spaces, false);
+}
+
+Map<String, Space> fieldsToSpace(Map<String, Object> fields) =>
+    fields.map((key, value) => MapEntry(key, parseSpace(value)));
+
+Space parseSpace(Object object) {
+  if (object is Space) return object;
+  if (object == '∅') return Space.empty;
+  if (object is StaticType) return Space(object);
+  if (object is List<Object>) {
+    return Space.union(object.map(parseSpace).toList());
+  }
+  if (object is Map<String, Object>) {
+    return Space.record(fieldsToSpace(object));
+  }
+
+  throw ArgumentError('Invalid space $object');
+}
+
+/// Parse a list of spaces using [parseSpace].
+List<Space> parseSpaces(List<Object> objects) =>
+    objects.map(parseSpace).toList();
+
+/// Make a record space with the given fields.
+Space rec({Object? w, Object? x, Object? y, Object? z}) => Space.record({
+      if (w != null) 'w': parseSpace(w),
+      if (x != null) 'x': parseSpace(x),
+      if (y != null) 'y': parseSpace(y),
+      if (z != null) 'z': parseSpace(z)
+    });
+
+/// Make a [Space] with [type] and [fields].
+Space ty(StaticType type, Map<String, Object> fields) =>
+    Space(type, fieldsToSpace(fields));
+
+void _checkExhaustive(Space value, List<Space> spaces, bool expectation) {
+  var actual = isExhaustive(value, spaces);
+  if (expectation != actual) {
+    if (expectation) {
+      fail('Expected $spaces to cover $value but did not.');
+    } else {
+      fail('Expected $spaces to not cover $value but did.');
+    }
+  }
+}
+
+void _expectExhaustive(Space value, List<Space> spaces, bool expectation) {
+  test(
+      '$value - ${spaces.join(' - ')} ${expectation ? 'is' : 'is not'} '
+      'exhaustive', () {
+    _checkExhaustive(value, spaces, expectation);
+  });
+}
+
+/// Test that [cases] are not exhaustive over [type].
+void _testCases(StaticType type, List<Object> cases, bool expectation) {
+  var valueSpace = Space(type);
+  var spaces = parseSpaces(cases);
+
+  test('$type with all cases', () {
+    _checkExhaustive(valueSpace, spaces, expectation);
+  });
+
+  // With any single case removed, should also not be exhaustive.
+  for (var i = 0; i < spaces.length; i++) {
+    var filtered = spaces.toList();
+    filtered.removeAt(i);
+
+    test('$type without case ${spaces[i]}', () {
+      _checkExhaustive(valueSpace, filtered, false);
+    });
+  }
+}
diff --git a/pkg/_fe_analyzer_shared/test/macros/executor/serialization_test.dart b/pkg/_fe_analyzer_shared/test/macros/executor/serialization_test.dart
index eb74a8e..b667364 100644
--- a/pkg/_fe_analyzer_shared/test/macros/executor/serialization_test.dart
+++ b/pkg/_fe_analyzer_shared/test/macros/executor/serialization_test.dart
@@ -166,6 +166,12 @@
             identifier:
                 IdentifierImpl(id: RemoteInstance.uniqueId, name: 'foo'),
             type: fooType);
+        final fooNamedFunctionTypeParam = FunctionTypeParameterImpl(
+            id: RemoteInstance.uniqueId,
+            isNamed: true,
+            isRequired: true,
+            name: 'foo',
+            type: fooType);
 
         final barPositionalParam = ParameterDeclarationImpl(
             id: RemoteInstance.uniqueId,
@@ -174,6 +180,19 @@
             identifier:
                 IdentifierImpl(id: RemoteInstance.uniqueId, name: 'bar'),
             type: barType);
+        final barPositionalFunctionTypeParam = FunctionTypeParameterImpl(
+            id: RemoteInstance.uniqueId,
+            isNamed: true,
+            isRequired: true,
+            name: 'bar',
+            type: fooType);
+
+        final unnamedFunctionTypeParam = FunctionTypeParameterImpl(
+            id: RemoteInstance.uniqueId,
+            isNamed: true,
+            isRequired: true,
+            name: null,
+            type: fooType);
 
         final zapTypeParam = TypeParameterDeclarationImpl(
             id: RemoteInstance.uniqueId,
@@ -187,8 +206,11 @@
           var functionType = FunctionTypeAnnotationImpl(
             id: RemoteInstance.uniqueId,
             isNullable: true,
-            namedParameters: [fooNamedParam],
-            positionalParameters: [barPositionalParam],
+            namedParameters: [
+              fooNamedFunctionTypeParam,
+              unnamedFunctionTypeParam
+            ],
+            positionalParameters: [barPositionalFunctionTypeParam],
             returnType: fooType,
             typeParameters: [zapTypeParam],
           );
diff --git a/pkg/_js_interop_checks/lib/js_interop_checks.dart b/pkg/_js_interop_checks/lib/js_interop_checks.dart
index 351c410..34a6b09 100644
--- a/pkg/_js_interop_checks/lib/js_interop_checks.dart
+++ b/pkg/_js_interop_checks/lib/js_interop_checks.dart
@@ -41,6 +41,7 @@
   /// Libraries that use `external` to exclude from checks on external.
   static final Iterable<String> _pathsWithAllowedDartExternalUsage = <String>[
     '_foreign_helper', // for foreign helpers
+    '_late_helper', // for dart2js late variable utilities
     '_interceptors', // for ddc JS string
     '_native_typed_data',
     '_runtime', // for ddc types at runtime
diff --git a/pkg/_js_interop_checks/lib/src/transformations/static_interop_class_eraser.dart b/pkg/_js_interop_checks/lib/src/transformations/static_interop_class_eraser.dart
index 324a97d..e4ede99 100644
--- a/pkg/_js_interop_checks/lib/src/transformations/static_interop_class_eraser.dart
+++ b/pkg/_js_interop_checks/lib/src/transformations/static_interop_class_eraser.dart
@@ -120,8 +120,7 @@
               signatureType.declaredNullability,
               namedParameters: signatureType.namedParameters,
               typeParameters: signatureType.typeParameters,
-              requiredParameterCount: signatureType.requiredParameterCount,
-              typedefType: signatureType.typedefType);
+              requiredParameterCount: signatureType.requiredParameterCount);
         }
         return newProcedure;
       }
diff --git a/pkg/_js_interop_checks/pubspec.yaml b/pkg/_js_interop_checks/pubspec.yaml
index 53c668a..9be1352 100644
--- a/pkg/_js_interop_checks/pubspec.yaml
+++ b/pkg/_js_interop_checks/pubspec.yaml
@@ -5,11 +5,7 @@
 environment:
   sdk: '>=2.12.0 <3.0.0'
 
+# Use 'any' constraints here; we get our versions from the DEPS file.
 dependencies:
   _fe_analyzer_shared: any
-  kernel:
-    path: ../kernel
-
-dependency_overrides:
-  _fe_analyzer_shared:
-    path: ../_fe_analyzer_shared
+  kernel: any
diff --git a/pkg/analysis_server/analysis_options.yaml b/pkg/analysis_server/analysis_options.yaml
index 1b77fd0..4cc8715 100644
--- a/pkg/analysis_server/analysis_options.yaml
+++ b/pkg/analysis_server/analysis_options.yaml
@@ -12,18 +12,14 @@
     # Lints from the recommended set that conflict w/ analyzer style or will
     # require some work to reach compliance.
     # See: https://github.com/dart-lang/sdk/issues/48785
-    avoid_renaming_method_parameters: ignore
     camel_case_types: ignore
     constant_identifier_names: ignore
     file_names: ignore
     hash_and_equals: ignore
     implementation_imports: ignore
-    library_private_types_in_public_api: ignore
     non_constant_identifier_names: ignore
     overridden_fields: ignore
     prefer_function_declarations_over_variables: ignore
-    # todo: add ignore to `protocol_generated.dart`
-    prefer_interpolation_to_compose_strings: ignore
     prefer_void_to_null: ignore
     provide_deprecation_message: ignore
 
diff --git a/pkg/analysis_server/benchmark/benchmarks.dart b/pkg/analysis_server/benchmark/benchmarks.dart
index cf25eb4..9dea223 100644
--- a/pkg/analysis_server/benchmark/benchmarks.dart
+++ b/pkg/analysis_server/benchmark/benchmarks.dart
@@ -118,7 +118,7 @@
 
   @override
   BenchMarkResult combine(BenchMarkResult other) {
-    BenchMarkResult _combine(BenchMarkResult? a, BenchMarkResult? b) {
+    BenchMarkResult combine(BenchMarkResult? a, BenchMarkResult? b) {
       if (a == null) return b!;
       if (b == null) return a;
       return a.combine(b);
@@ -133,7 +133,7 @@
         .toList();
 
     for (var key in keys) {
-      combined.add(key, _combine(results[key], o.results[key]));
+      combined.add(key, combine(results[key], o.results[key]));
     }
 
     return combined;
diff --git a/pkg/analysis_server/benchmark/integration/input_converter.dart b/pkg/analysis_server/benchmark/integration/input_converter.dart
index aec8d14..fd45405 100644
--- a/pkg/analysis_server/benchmark/integration/input_converter.dart
+++ b/pkg/analysis_server/benchmark/integration/input_converter.dart
@@ -284,7 +284,7 @@
   }
 
   @override
-  _InputSink startChunkedConversion(outSink) {
+  Sink<String> startChunkedConversion(outSink) {
     return _InputSink(this, outSink);
   }
 
diff --git a/pkg/analysis_server/benchmark/integration/operation.dart b/pkg/analysis_server/benchmark/integration/operation.dart
index 8a652aa..882c15f 100644
--- a/pkg/analysis_server/benchmark/integration/operation.dart
+++ b/pkg/analysis_server/benchmark/integration/operation.dart
@@ -19,8 +19,7 @@
   late Stopwatch stopwatch;
   bool firstNotification = true;
 
-  CompletionRequestOperation(
-      super.converter, super.json);
+  CompletionRequestOperation(super.converter, super.json);
 
   @override
   Future<void>? perform(Driver driver) {
diff --git a/pkg/analysis_server/benchmark/perf/benchmarks_impl.dart b/pkg/analysis_server/benchmark/perf/benchmarks_impl.dart
index 501fb8d..94dd7c0 100644
--- a/pkg/analysis_server/benchmark/perf/benchmarks_impl.dart
+++ b/pkg/analysis_server/benchmark/perf/benchmarks_impl.dart
@@ -75,7 +75,7 @@
     var completionCount = 0;
     var stopwatch = Stopwatch()..start();
 
-    Future _complete(int offset) async {
+    Future complete(int offset) async {
       await test.complete(filePath, offset, isWarmUp: false);
       completionCount++;
     }
@@ -86,11 +86,11 @@
       var index =
           contents.indexOf(RegExp(r'\..*;$', multiLine: true), startIndex);
 
-      await _complete(index - 10);
-      await _complete(index - 1);
-      await _complete(index);
-      await _complete(index + 1);
-      await _complete(index + 10);
+      await complete(index - 10);
+      await complete(index - 1);
+      await complete(index);
+      await complete(index + 1);
+      await complete(index + 10);
 
       if (i + 1 < kGroupCount) {
         // mutate
diff --git a/pkg/analysis_server/benchmark/perf/memory_tests.dart b/pkg/analysis_server/benchmark/perf/memory_tests.dart
index 7836814..c751542 100644
--- a/pkg/analysis_server/benchmark/perf/memory_tests.dart
+++ b/pkg/analysis_server/benchmark/perf/memory_tests.dart
@@ -6,7 +6,7 @@
 import 'dart:convert' show jsonDecode, jsonEncode;
 import 'dart:io';
 
-import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
+import 'package:analysis_server/lsp_protocol/protocol.dart' as lsp;
 import 'package:analysis_server/src/lsp/client_capabilities.dart';
 import 'package:analysis_server/src/protocol_server.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
@@ -209,7 +209,7 @@
 class LspAnalysisServerMemoryUsageTest
     extends AbstractLspAnalysisServerIntegrationTest
     with ServerMemoryUsageMixin {
-  Map<String, List<Diagnostic>> currentAnalysisErrors = {};
+  Map<String, List<lsp.Diagnostic>> currentAnalysisErrors = {};
 
   @override
   void expect(Object? actual, Matcher matcher, {String? reason}) =>
@@ -227,7 +227,7 @@
     ]);
     await super.setUp();
 
-    errorNotificationsFromServer.listen((NotificationMessage error) {
+    errorNotificationsFromServer.listen((lsp.NotificationMessage error) {
       // A server error should never happen during an integration test.
       fail('${error.toJson()}');
     });
diff --git a/pkg/analysis_server/doc/api.html b/pkg/analysis_server/doc/api.html
index d610cb4..8571ef7 100644
--- a/pkg/analysis_server/doc/api.html
+++ b/pkg/analysis_server/doc/api.html
@@ -109,7 +109,7 @@
 <body>
 <h1>Analysis Server API Specification</h1>
 <h1 style="color:#999999">Version
-  1.33.0
+  1.33.1
 </h1>
 <p>
   This document contains a specification of the API provided by the
@@ -236,6 +236,11 @@
   ignoring the item or treating it with some default/fallback handling.
 </p>
 <h3>Changelog</h3>
+<h4>1.33.1</h4>
+<ul>
+  <li><tt>SourceChange</tt> now has an optional <tt>selectionLength</tt> that may be
+  provided when <tt>selection</tt> is.</li>
+</ul>
 <h4>1.33.0</h4>
 <ul>
   <li>Requests <tt>getSuggestions2</tt> and <tt>getSuggestionDetails2</tt>
@@ -5875,6 +5880,12 @@
           The position that should be selected after the edits have been
           applied.
         </p>
+      </dd><dt class="field"><b>selectionLength: int<span style="color:#999999"> (optional)</span></b></dt><dd>
+        
+        <p>
+          The length of the selection (starting at Position) that should be selected after
+          the edits have been applied.
+        </p>
       </dd><dt class="field"><b>id: String<span style="color:#999999"> (optional)</span></b></dt><dd>
         
         <p>
diff --git a/pkg/analysis_server/lib/lsp_protocol/protocol.dart b/pkg/analysis_server/lib/lsp_protocol/protocol.dart
new file mode 100644
index 0000000..7243549
--- /dev/null
+++ b/pkg/analysis_server/lib/lsp_protocol/protocol.dart
@@ -0,0 +1,8 @@
+// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+export 'package:analysis_server/lsp_protocol/protocol_custom_generated.dart'
+    hide jsonEncoder;
+export 'package:analysis_server/lsp_protocol/protocol_generated.dart';
+export 'package:analysis_server/lsp_protocol/protocol_special.dart';
diff --git a/pkg/analysis_server/lib/lsp_protocol/protocol_custom_generated.dart b/pkg/analysis_server/lib/lsp_protocol/protocol_custom_generated.dart
index d3218a8..de4aa97 100644
--- a/pkg/analysis_server/lib/lsp_protocol/protocol_custom_generated.dart
+++ b/pkg/analysis_server/lib/lsp_protocol/protocol_custom_generated.dart
@@ -6,11 +6,6 @@
 // To regenerate the file, use the script
 // "pkg/analysis_server/tool/lsp_spec/generate_all.dart".
 
-// ignore_for_file: annotate_overrides
-// ignore_for_file: no_leading_underscores_for_local_identifiers
-// ignore_for_file: prefer_is_not_operator
-// ignore_for_file: unnecessary_parenthesis
-
 import 'dart:core' hide deprecated;
 import 'dart:core' as core show deprecated;
 import 'dart:convert' show JsonEncoder;
@@ -23,21 +18,28 @@
 
 class AnalyzerStatusParams implements ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      AnalyzerStatusParams.canParse, AnalyzerStatusParams.fromJson);
+    AnalyzerStatusParams.canParse,
+    AnalyzerStatusParams.fromJson,
+  );
 
-  AnalyzerStatusParams({required this.isAnalyzing});
+  AnalyzerStatusParams({
+    required this.isAnalyzing,
+  });
   static AnalyzerStatusParams fromJson(Map<String, Object?> json) {
     final isAnalyzingJson = json['isAnalyzing'];
     final isAnalyzing = isAnalyzingJson as bool;
-    return AnalyzerStatusParams(isAnalyzing: isAnalyzing);
+    return AnalyzerStatusParams(
+      isAnalyzing: isAnalyzing,
+    );
   }
 
   final bool isAnalyzing;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['isAnalyzing'] = isAnalyzing;
-    return __result;
+    var result = <String, Object?>{};
+    result['isAnalyzing'] = isAnalyzing;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -53,7 +55,7 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(isAnalyzing is bool)) {
+        if (isAnalyzing is! bool) {
           reporter.reportError('must be of type bool');
           return false;
         }
@@ -84,48 +86,39 @@
 }
 
 class ClosingLabel implements ToJsonable {
-  static const jsonHandler =
-      LspJsonHandler(ClosingLabel.canParse, ClosingLabel.fromJson);
+  static const jsonHandler = LspJsonHandler(
+    ClosingLabel.canParse,
+    ClosingLabel.fromJson,
+  );
 
-  ClosingLabel({required this.range, required this.label});
+  ClosingLabel({
+    required this.label,
+    required this.range,
+  });
   static ClosingLabel fromJson(Map<String, Object?> json) {
-    final rangeJson = json['range'];
-    final range = Range.fromJson(rangeJson as Map<String, Object?>);
     final labelJson = json['label'];
     final label = labelJson as String;
-    return ClosingLabel(range: range, label: label);
+    final rangeJson = json['range'];
+    final range = Range.fromJson(rangeJson as Map<String, Object?>);
+    return ClosingLabel(
+      label: label,
+      range: range,
+    );
   }
 
   final String label;
   final Range range;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['range'] = range.toJson();
-    __result['label'] = label;
-    return __result;
+    var result = <String, Object?>{};
+    result['label'] = label;
+    result['range'] = range.toJson();
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
-      reporter.push('range');
-      try {
-        if (!obj.containsKey('range')) {
-          reporter.reportError('must not be undefined');
-          return false;
-        }
-        final range = obj['range'];
-        if (range == null) {
-          reporter.reportError('must not be null');
-          return false;
-        }
-        if (!(Range.canParse(range, reporter))) {
-          reporter.reportError('must be of type Range');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       reporter.push('label');
       try {
         if (!obj.containsKey('label')) {
@@ -137,13 +130,31 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(label is String)) {
+        if (label is! String) {
           reporter.reportError('must be of type String');
           return false;
         }
       } finally {
         reporter.pop();
       }
+      reporter.push('range');
+      try {
+        if (!obj.containsKey('range')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final range = obj['range'];
+        if (range == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (!Range.canParse(range, reporter)) {
+          reporter.reportError('must be of type Range');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
       return true;
     } else {
       reporter.reportError('must be of type ClosingLabel');
@@ -154,13 +165,16 @@
   @override
   bool operator ==(Object other) {
     if (other is ClosingLabel && other.runtimeType == ClosingLabel) {
-      return range == other.range && label == other.label && true;
+      return label == other.label && range == other.range && true;
     }
     return false;
   }
 
   @override
-  int get hashCode => Object.hash(range, label);
+  int get hashCode => Object.hash(
+        label,
+        range,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
@@ -168,8 +182,9 @@
 
 class CompletionItemResolutionInfo implements ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      CompletionItemResolutionInfo.canParse,
-      CompletionItemResolutionInfo.fromJson);
+    CompletionItemResolutionInfo.canParse,
+    CompletionItemResolutionInfo.fromJson,
+  );
 
   static CompletionItemResolutionInfo fromJson(Map<String, Object?> json) {
     if (DartSuggestionSetCompletionItemResolutionInfo.canParse(
@@ -183,10 +198,8 @@
     return CompletionItemResolutionInfo();
   }
 
-  Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    return __result;
-  }
+  @override
+  Map<String, Object?> toJson() => {};
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
@@ -215,21 +228,28 @@
 
 class DartDiagnosticServer implements ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      DartDiagnosticServer.canParse, DartDiagnosticServer.fromJson);
+    DartDiagnosticServer.canParse,
+    DartDiagnosticServer.fromJson,
+  );
 
-  DartDiagnosticServer({required this.port});
+  DartDiagnosticServer({
+    required this.port,
+  });
   static DartDiagnosticServer fromJson(Map<String, Object?> json) {
     final portJson = json['port'];
     final port = portJson as int;
-    return DartDiagnosticServer(port: port);
+    return DartDiagnosticServer(
+      port: port,
+    );
   }
 
   final int port;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['port'] = port;
-    return __result;
+    var result = <String, Object?>{};
+    result['port'] = port;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -245,7 +265,7 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(port is int)) {
+        if (port is! int) {
           reporter.reportError('must be of type int');
           return false;
         }
@@ -278,41 +298,44 @@
 class DartSuggestionSetCompletionItemResolutionInfo
     implements CompletionItemResolutionInfo, ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      DartSuggestionSetCompletionItemResolutionInfo.canParse,
-      DartSuggestionSetCompletionItemResolutionInfo.fromJson);
+    DartSuggestionSetCompletionItemResolutionInfo.canParse,
+    DartSuggestionSetCompletionItemResolutionInfo.fromJson,
+  );
 
-  DartSuggestionSetCompletionItemResolutionInfo(
-      {required this.file,
-      required this.offset,
-      required this.libId,
-      required this.displayUri,
-      required this.rOffset,
-      required this.iLength,
-      required this.rLength});
+  DartSuggestionSetCompletionItemResolutionInfo({
+    required this.displayUri,
+    required this.file,
+    required this.iLength,
+    required this.libId,
+    required this.offset,
+    required this.rLength,
+    required this.rOffset,
+  });
   static DartSuggestionSetCompletionItemResolutionInfo fromJson(
       Map<String, Object?> json) {
-    final fileJson = json['file'];
-    final file = fileJson as String;
-    final offsetJson = json['offset'];
-    final offset = offsetJson as int;
-    final libIdJson = json['libId'];
-    final libId = libIdJson as int;
     final displayUriJson = json['displayUri'];
     final displayUri = displayUriJson as String;
-    final rOffsetJson = json['rOffset'];
-    final rOffset = rOffsetJson as int;
+    final fileJson = json['file'];
+    final file = fileJson as String;
     final iLengthJson = json['iLength'];
     final iLength = iLengthJson as int;
+    final libIdJson = json['libId'];
+    final libId = libIdJson as int;
+    final offsetJson = json['offset'];
+    final offset = offsetJson as int;
     final rLengthJson = json['rLength'];
     final rLength = rLengthJson as int;
+    final rOffsetJson = json['rOffset'];
+    final rOffset = rOffsetJson as int;
     return DartSuggestionSetCompletionItemResolutionInfo(
-        file: file,
-        offset: offset,
-        libId: libId,
-        displayUri: displayUri,
-        rOffset: rOffset,
-        iLength: iLength,
-        rLength: rLength);
+      displayUri: displayUri,
+      file: file,
+      iLength: iLength,
+      libId: libId,
+      offset: offset,
+      rLength: rLength,
+      rOffset: rOffset,
+    );
   }
 
   final String displayUri;
@@ -323,20 +346,39 @@
   final int rLength;
   final int rOffset;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['file'] = file;
-    __result['offset'] = offset;
-    __result['libId'] = libId;
-    __result['displayUri'] = displayUri;
-    __result['rOffset'] = rOffset;
-    __result['iLength'] = iLength;
-    __result['rLength'] = rLength;
-    return __result;
+    var result = <String, Object?>{};
+    result['displayUri'] = displayUri;
+    result['file'] = file;
+    result['iLength'] = iLength;
+    result['libId'] = libId;
+    result['offset'] = offset;
+    result['rLength'] = rLength;
+    result['rOffset'] = rOffset;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
+      reporter.push('displayUri');
+      try {
+        if (!obj.containsKey('displayUri')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final displayUri = obj['displayUri'];
+        if (displayUri == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (displayUri is! String) {
+          reporter.reportError('must be of type String');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
       reporter.push('file');
       try {
         if (!obj.containsKey('file')) {
@@ -348,25 +390,25 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(file is String)) {
+        if (file is! String) {
           reporter.reportError('must be of type String');
           return false;
         }
       } finally {
         reporter.pop();
       }
-      reporter.push('offset');
+      reporter.push('iLength');
       try {
-        if (!obj.containsKey('offset')) {
+        if (!obj.containsKey('iLength')) {
           reporter.reportError('must not be undefined');
           return false;
         }
-        final offset = obj['offset'];
-        if (offset == null) {
+        final iLength = obj['iLength'];
+        if (iLength == null) {
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(offset is int)) {
+        if (iLength is! int) {
           reporter.reportError('must be of type int');
           return false;
         }
@@ -384,61 +426,25 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(libId is int)) {
+        if (libId is! int) {
           reporter.reportError('must be of type int');
           return false;
         }
       } finally {
         reporter.pop();
       }
-      reporter.push('displayUri');
+      reporter.push('offset');
       try {
-        if (!obj.containsKey('displayUri')) {
+        if (!obj.containsKey('offset')) {
           reporter.reportError('must not be undefined');
           return false;
         }
-        final displayUri = obj['displayUri'];
-        if (displayUri == null) {
+        final offset = obj['offset'];
+        if (offset == null) {
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(displayUri is String)) {
-          reporter.reportError('must be of type String');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('rOffset');
-      try {
-        if (!obj.containsKey('rOffset')) {
-          reporter.reportError('must not be undefined');
-          return false;
-        }
-        final rOffset = obj['rOffset'];
-        if (rOffset == null) {
-          reporter.reportError('must not be null');
-          return false;
-        }
-        if (!(rOffset is int)) {
-          reporter.reportError('must be of type int');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('iLength');
-      try {
-        if (!obj.containsKey('iLength')) {
-          reporter.reportError('must not be undefined');
-          return false;
-        }
-        final iLength = obj['iLength'];
-        if (iLength == null) {
-          reporter.reportError('must not be null');
-          return false;
-        }
-        if (!(iLength is int)) {
+        if (offset is! int) {
           reporter.reportError('must be of type int');
           return false;
         }
@@ -456,7 +462,25 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(rLength is int)) {
+        if (rLength is! int) {
+          reporter.reportError('must be of type int');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('rOffset');
+      try {
+        if (!obj.containsKey('rOffset')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final rOffset = obj['rOffset'];
+        if (rOffset == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (rOffset is! int) {
           reporter.reportError('must be of type int');
           return false;
         }
@@ -475,58 +499,70 @@
   bool operator ==(Object other) {
     if (other is DartSuggestionSetCompletionItemResolutionInfo &&
         other.runtimeType == DartSuggestionSetCompletionItemResolutionInfo) {
-      return file == other.file &&
-          offset == other.offset &&
-          libId == other.libId &&
-          displayUri == other.displayUri &&
-          rOffset == other.rOffset &&
+      return displayUri == other.displayUri &&
+          file == other.file &&
           iLength == other.iLength &&
+          libId == other.libId &&
+          offset == other.offset &&
           rLength == other.rLength &&
+          rOffset == other.rOffset &&
           true;
     }
     return false;
   }
 
   @override
-  int get hashCode =>
-      Object.hash(file, offset, libId, displayUri, rOffset, iLength, rLength);
+  int get hashCode => Object.hash(
+        displayUri,
+        file,
+        iLength,
+        libId,
+        offset,
+        rLength,
+        rOffset,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
 }
 
 class Element implements ToJsonable {
-  static const jsonHandler = LspJsonHandler(Element.canParse, Element.fromJson);
+  static const jsonHandler = LspJsonHandler(
+    Element.canParse,
+    Element.fromJson,
+  );
 
-  Element(
-      {this.range,
-      required this.name,
-      required this.kind,
-      this.parameters,
-      this.typeParameters,
-      this.returnType});
+  Element({
+    required this.kind,
+    required this.name,
+    this.parameters,
+    this.range,
+    this.returnType,
+    this.typeParameters,
+  });
   static Element fromJson(Map<String, Object?> json) {
+    final kindJson = json['kind'];
+    final kind = kindJson as String;
+    final nameJson = json['name'];
+    final name = nameJson as String;
+    final parametersJson = json['parameters'];
+    final parameters = parametersJson as String?;
     final rangeJson = json['range'];
     final range = rangeJson != null
         ? Range.fromJson(rangeJson as Map<String, Object?>)
         : null;
-    final nameJson = json['name'];
-    final name = nameJson as String;
-    final kindJson = json['kind'];
-    final kind = kindJson as String;
-    final parametersJson = json['parameters'];
-    final parameters = parametersJson as String?;
-    final typeParametersJson = json['typeParameters'];
-    final typeParameters = typeParametersJson as String?;
     final returnTypeJson = json['returnType'];
     final returnType = returnTypeJson as String?;
+    final typeParametersJson = json['typeParameters'];
+    final typeParameters = typeParametersJson as String?;
     return Element(
-        range: range,
-        name: name,
-        kind: kind,
-        parameters: parameters,
-        typeParameters: typeParameters,
-        returnType: returnType);
+      kind: kind,
+      name: name,
+      parameters: parameters,
+      range: range,
+      returnType: returnType,
+      typeParameters: typeParameters,
+    );
   }
 
   final String kind;
@@ -536,32 +572,41 @@
   final String? returnType;
   final String? typeParameters;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    if (range != null) {
-      __result['range'] = range?.toJson();
-    }
-    __result['name'] = name;
-    __result['kind'] = kind;
+    var result = <String, Object?>{};
+    result['kind'] = kind;
+    result['name'] = name;
     if (parameters != null) {
-      __result['parameters'] = parameters;
+      result['parameters'] = parameters;
     }
-    if (typeParameters != null) {
-      __result['typeParameters'] = typeParameters;
+    if (range != null) {
+      result['range'] = range?.toJson();
     }
     if (returnType != null) {
-      __result['returnType'] = returnType;
+      result['returnType'] = returnType;
     }
-    return __result;
+    if (typeParameters != null) {
+      result['typeParameters'] = typeParameters;
+    }
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
-      reporter.push('range');
+      reporter.push('kind');
       try {
-        final range = obj['range'];
-        if (range != null && !(Range.canParse(range, reporter))) {
-          reporter.reportError('must be of type Range');
+        if (!obj.containsKey('kind')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final kind = obj['kind'];
+        if (kind == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (kind is! String) {
+          reporter.reportError('must be of type String');
           return false;
         }
       } finally {
@@ -578,25 +623,7 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(name is String)) {
-          reporter.reportError('must be of type String');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('kind');
-      try {
-        if (!obj.containsKey('kind')) {
-          reporter.reportError('must not be undefined');
-          return false;
-        }
-        final kind = obj['kind'];
-        if (kind == null) {
-          reporter.reportError('must not be null');
-          return false;
-        }
-        if (!(kind is String)) {
+        if (name is! String) {
           reporter.reportError('must be of type String');
           return false;
         }
@@ -606,7 +633,27 @@
       reporter.push('parameters');
       try {
         final parameters = obj['parameters'];
-        if (parameters != null && !(parameters is String)) {
+        if (parameters != null && parameters is! String) {
+          reporter.reportError('must be of type String');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('range');
+      try {
+        final range = obj['range'];
+        if (range != null && !Range.canParse(range, reporter)) {
+          reporter.reportError('must be of type Range');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('returnType');
+      try {
+        final returnType = obj['returnType'];
+        if (returnType != null && returnType is! String) {
           reporter.reportError('must be of type String');
           return false;
         }
@@ -616,17 +663,7 @@
       reporter.push('typeParameters');
       try {
         final typeParameters = obj['typeParameters'];
-        if (typeParameters != null && !(typeParameters is String)) {
-          reporter.reportError('must be of type String');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('returnType');
-      try {
-        final returnType = obj['returnType'];
-        if (returnType != null && !(returnType is String)) {
+        if (typeParameters != null && typeParameters is! String) {
           reporter.reportError('must be of type String');
           return false;
         }
@@ -643,75 +680,85 @@
   @override
   bool operator ==(Object other) {
     if (other is Element && other.runtimeType == Element) {
-      return range == other.range &&
+      return kind == other.kind &&
           name == other.name &&
-          kind == other.kind &&
           parameters == other.parameters &&
-          typeParameters == other.typeParameters &&
+          range == other.range &&
           returnType == other.returnType &&
+          typeParameters == other.typeParameters &&
           true;
     }
     return false;
   }
 
   @override
-  int get hashCode =>
-      Object.hash(range, name, kind, parameters, typeParameters, returnType);
+  int get hashCode => Object.hash(
+        kind,
+        name,
+        parameters,
+        range,
+        returnType,
+        typeParameters,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
 }
 
 class FlutterOutline implements ToJsonable {
-  static const jsonHandler =
-      LspJsonHandler(FlutterOutline.canParse, FlutterOutline.fromJson);
+  static const jsonHandler = LspJsonHandler(
+    FlutterOutline.canParse,
+    FlutterOutline.fromJson,
+  );
 
-  FlutterOutline(
-      {required this.kind,
-      this.label,
-      this.className,
-      this.variableName,
-      this.attributes,
-      this.dartElement,
-      required this.range,
-      required this.codeRange,
-      this.children});
+  FlutterOutline({
+    this.attributes,
+    this.children,
+    this.className,
+    required this.codeRange,
+    this.dartElement,
+    required this.kind,
+    this.label,
+    required this.range,
+    this.variableName,
+  });
   static FlutterOutline fromJson(Map<String, Object?> json) {
-    final kindJson = json['kind'];
-    final kind = kindJson as String;
-    final labelJson = json['label'];
-    final label = labelJson as String?;
-    final classNameJson = json['className'];
-    final className = classNameJson as String?;
-    final variableNameJson = json['variableName'];
-    final variableName = variableNameJson as String?;
     final attributesJson = json['attributes'];
     final attributes = (attributesJson as List<Object?>?)
         ?.map((item) =>
             FlutterOutlineAttribute.fromJson(item as Map<String, Object?>))
         .toList();
-    final dartElementJson = json['dartElement'];
-    final dartElement = dartElementJson != null
-        ? Element.fromJson(dartElementJson as Map<String, Object?>)
-        : null;
-    final rangeJson = json['range'];
-    final range = Range.fromJson(rangeJson as Map<String, Object?>);
-    final codeRangeJson = json['codeRange'];
-    final codeRange = Range.fromJson(codeRangeJson as Map<String, Object?>);
     final childrenJson = json['children'];
     final children = (childrenJson as List<Object?>?)
         ?.map((item) => FlutterOutline.fromJson(item as Map<String, Object?>))
         .toList();
+    final classNameJson = json['className'];
+    final className = classNameJson as String?;
+    final codeRangeJson = json['codeRange'];
+    final codeRange = Range.fromJson(codeRangeJson as Map<String, Object?>);
+    final dartElementJson = json['dartElement'];
+    final dartElement = dartElementJson != null
+        ? Element.fromJson(dartElementJson as Map<String, Object?>)
+        : null;
+    final kindJson = json['kind'];
+    final kind = kindJson as String;
+    final labelJson = json['label'];
+    final label = labelJson as String?;
+    final rangeJson = json['range'];
+    final range = Range.fromJson(rangeJson as Map<String, Object?>);
+    final variableNameJson = json['variableName'];
+    final variableName = variableNameJson as String?;
     return FlutterOutline(
-        kind: kind,
-        label: label,
-        className: className,
-        variableName: variableName,
-        attributes: attributes,
-        dartElement: dartElement,
-        range: range,
-        codeRange: codeRange,
-        children: children);
+      attributes: attributes,
+      children: children,
+      className: className,
+      codeRange: codeRange,
+      dartElement: dartElement,
+      kind: kind,
+      label: label,
+      range: range,
+      variableName: variableName,
+    );
   }
 
   final List<FlutterOutlineAttribute>? attributes;
@@ -724,58 +771,56 @@
   final Range range;
   final String? variableName;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['kind'] = kind;
-    if (label != null) {
-      __result['label'] = label;
+    var result = <String, Object?>{};
+    if (attributes != null) {
+      result['attributes'] = attributes?.map((item) => item.toJson()).toList();
+    }
+    if (children != null) {
+      result['children'] = children?.map((item) => item.toJson()).toList();
     }
     if (className != null) {
-      __result['className'] = className;
+      result['className'] = className;
     }
-    if (variableName != null) {
-      __result['variableName'] = variableName;
-    }
-    if (attributes != null) {
-      __result['attributes'] =
-          attributes?.map((item) => item.toJson()).toList();
-    }
+    result['codeRange'] = codeRange.toJson();
     if (dartElement != null) {
-      __result['dartElement'] = dartElement?.toJson();
+      result['dartElement'] = dartElement?.toJson();
     }
-    __result['range'] = range.toJson();
-    __result['codeRange'] = codeRange.toJson();
-    if (children != null) {
-      __result['children'] = children?.map((item) => item.toJson()).toList();
+    result['kind'] = kind;
+    if (label != null) {
+      result['label'] = label;
     }
-    return __result;
+    result['range'] = range.toJson();
+    if (variableName != null) {
+      result['variableName'] = variableName;
+    }
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
-      reporter.push('kind');
+      reporter.push('attributes');
       try {
-        if (!obj.containsKey('kind')) {
-          reporter.reportError('must not be undefined');
-          return false;
-        }
-        final kind = obj['kind'];
-        if (kind == null) {
-          reporter.reportError('must not be null');
-          return false;
-        }
-        if (!(kind is String)) {
-          reporter.reportError('must be of type String');
+        final attributes = obj['attributes'];
+        if (attributes != null &&
+            (attributes is! List<Object?> ||
+                attributes.any((item) =>
+                    !FlutterOutlineAttribute.canParse(item, reporter)))) {
+          reporter.reportError('must be of type List<FlutterOutlineAttribute>');
           return false;
         }
       } finally {
         reporter.pop();
       }
-      reporter.push('label');
+      reporter.push('children');
       try {
-        final label = obj['label'];
-        if (label != null && !(label is String)) {
-          reporter.reportError('must be of type String');
+        final children = obj['children'];
+        if (children != null &&
+            (children is! List<Object?> ||
+                children
+                    .any((item) => !FlutterOutline.canParse(item, reporter)))) {
+          reporter.reportError('must be of type List<FlutterOutline>');
           return false;
         }
       } finally {
@@ -784,64 +829,13 @@
       reporter.push('className');
       try {
         final className = obj['className'];
-        if (className != null && !(className is String)) {
+        if (className != null && className is! String) {
           reporter.reportError('must be of type String');
           return false;
         }
       } finally {
         reporter.pop();
       }
-      reporter.push('variableName');
-      try {
-        final variableName = obj['variableName'];
-        if (variableName != null && !(variableName is String)) {
-          reporter.reportError('must be of type String');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('attributes');
-      try {
-        final attributes = obj['attributes'];
-        if (attributes != null &&
-            !((attributes is List<Object?> &&
-                (attributes.every((item) =>
-                    FlutterOutlineAttribute.canParse(item, reporter)))))) {
-          reporter.reportError('must be of type List<FlutterOutlineAttribute>');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('dartElement');
-      try {
-        final dartElement = obj['dartElement'];
-        if (dartElement != null && !(Element.canParse(dartElement, reporter))) {
-          reporter.reportError('must be of type Element');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('range');
-      try {
-        if (!obj.containsKey('range')) {
-          reporter.reportError('must not be undefined');
-          return false;
-        }
-        final range = obj['range'];
-        if (range == null) {
-          reporter.reportError('must not be null');
-          return false;
-        }
-        if (!(Range.canParse(range, reporter))) {
-          reporter.reportError('must be of type Range');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       reporter.push('codeRange');
       try {
         if (!obj.containsKey('codeRange')) {
@@ -853,21 +847,74 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(Range.canParse(codeRange, reporter))) {
+        if (!Range.canParse(codeRange, reporter)) {
           reporter.reportError('must be of type Range');
           return false;
         }
       } finally {
         reporter.pop();
       }
-      reporter.push('children');
+      reporter.push('dartElement');
       try {
-        final children = obj['children'];
-        if (children != null &&
-            !((children is List<Object?> &&
-                (children.every(
-                    (item) => FlutterOutline.canParse(item, reporter)))))) {
-          reporter.reportError('must be of type List<FlutterOutline>');
+        final dartElement = obj['dartElement'];
+        if (dartElement != null && !Element.canParse(dartElement, reporter)) {
+          reporter.reportError('must be of type Element');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('kind');
+      try {
+        if (!obj.containsKey('kind')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final kind = obj['kind'];
+        if (kind == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (kind is! String) {
+          reporter.reportError('must be of type String');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('label');
+      try {
+        final label = obj['label'];
+        if (label != null && label is! String) {
+          reporter.reportError('must be of type String');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('range');
+      try {
+        if (!obj.containsKey('range')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final range = obj['range'];
+        if (range == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (!Range.canParse(range, reporter)) {
+          reporter.reportError('must be of type Range');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('variableName');
+      try {
+        final variableName = obj['variableName'];
+        if (variableName != null && variableName is! String) {
+          reporter.reportError('must be of type String');
           return false;
         }
       } finally {
@@ -883,20 +930,20 @@
   @override
   bool operator ==(Object other) {
     if (other is FlutterOutline && other.runtimeType == FlutterOutline) {
-      return kind == other.kind &&
-          label == other.label &&
-          className == other.className &&
-          variableName == other.variableName &&
-          listEqual(
+      return listEqual(
               attributes,
               other.attributes,
               (FlutterOutlineAttribute a, FlutterOutlineAttribute b) =>
                   a == b) &&
-          dartElement == other.dartElement &&
-          range == other.range &&
-          codeRange == other.codeRange &&
           listEqual(children, other.children,
               (FlutterOutline a, FlutterOutline b) => a == b) &&
+          className == other.className &&
+          codeRange == other.codeRange &&
+          dartElement == other.dartElement &&
+          kind == other.kind &&
+          label == other.label &&
+          range == other.range &&
+          variableName == other.variableName &&
           true;
     }
     return false;
@@ -904,15 +951,16 @@
 
   @override
   int get hashCode => Object.hash(
-      kind,
-      label,
-      className,
-      variableName,
-      lspHashCode(attributes),
-      dartElement,
-      range,
-      codeRange,
-      lspHashCode(children));
+        lspHashCode(attributes),
+        lspHashCode(children),
+        className,
+        codeRange,
+        dartElement,
+        kind,
+        label,
+        range,
+        variableName,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
@@ -920,57 +968,48 @@
 
 class FlutterOutlineAttribute implements ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      FlutterOutlineAttribute.canParse, FlutterOutlineAttribute.fromJson);
+    FlutterOutlineAttribute.canParse,
+    FlutterOutlineAttribute.fromJson,
+  );
 
-  FlutterOutlineAttribute(
-      {required this.name, required this.label, this.valueRange});
+  FlutterOutlineAttribute({
+    required this.label,
+    required this.name,
+    this.valueRange,
+  });
   static FlutterOutlineAttribute fromJson(Map<String, Object?> json) {
-    final nameJson = json['name'];
-    final name = nameJson as String;
     final labelJson = json['label'];
     final label = labelJson as String;
+    final nameJson = json['name'];
+    final name = nameJson as String;
     final valueRangeJson = json['valueRange'];
     final valueRange = valueRangeJson != null
         ? Range.fromJson(valueRangeJson as Map<String, Object?>)
         : null;
     return FlutterOutlineAttribute(
-        name: name, label: label, valueRange: valueRange);
+      label: label,
+      name: name,
+      valueRange: valueRange,
+    );
   }
 
   final String label;
   final String name;
   final Range? valueRange;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['name'] = name;
-    __result['label'] = label;
+    var result = <String, Object?>{};
+    result['label'] = label;
+    result['name'] = name;
     if (valueRange != null) {
-      __result['valueRange'] = valueRange?.toJson();
+      result['valueRange'] = valueRange?.toJson();
     }
-    return __result;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
-      reporter.push('name');
-      try {
-        if (!obj.containsKey('name')) {
-          reporter.reportError('must not be undefined');
-          return false;
-        }
-        final name = obj['name'];
-        if (name == null) {
-          reporter.reportError('must not be null');
-          return false;
-        }
-        if (!(name is String)) {
-          reporter.reportError('must be of type String');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       reporter.push('label');
       try {
         if (!obj.containsKey('label')) {
@@ -982,7 +1021,25 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(label is String)) {
+        if (label is! String) {
+          reporter.reportError('must be of type String');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('name');
+      try {
+        if (!obj.containsKey('name')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final name = obj['name'];
+        if (name == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (name is! String) {
           reporter.reportError('must be of type String');
           return false;
         }
@@ -992,7 +1049,7 @@
       reporter.push('valueRange');
       try {
         final valueRange = obj['valueRange'];
-        if (valueRange != null && !(Range.canParse(valueRange, reporter))) {
+        if (valueRange != null && !Range.canParse(valueRange, reporter)) {
           reporter.reportError('must be of type Range');
           return false;
         }
@@ -1010,8 +1067,8 @@
   bool operator ==(Object other) {
     if (other is FlutterOutlineAttribute &&
         other.runtimeType == FlutterOutlineAttribute) {
-      return name == other.name &&
-          label == other.label &&
+      return label == other.label &&
+          name == other.name &&
           valueRange == other.valueRange &&
           true;
     }
@@ -1019,36 +1076,409 @@
   }
 
   @override
-  int get hashCode => Object.hash(name, label, valueRange);
+  int get hashCode => Object.hash(
+        label,
+        name,
+        valueRange,
+      );
+
+  @override
+  String toString() => jsonEncoder.convert(toJson());
+}
+
+class IncomingMessage implements Message, ToJsonable {
+  static const jsonHandler = LspJsonHandler(
+    IncomingMessage.canParse,
+    IncomingMessage.fromJson,
+  );
+
+  IncomingMessage({
+    this.clientRequestTime,
+    required this.jsonrpc,
+    required this.method,
+    this.params,
+  });
+  static IncomingMessage fromJson(Map<String, Object?> json) {
+    if (RequestMessage.canParse(json, nullLspJsonReporter)) {
+      return RequestMessage.fromJson(json);
+    }
+    if (NotificationMessage.canParse(json, nullLspJsonReporter)) {
+      return NotificationMessage.fromJson(json);
+    }
+    final clientRequestTimeJson = json['clientRequestTime'];
+    final clientRequestTime = clientRequestTimeJson as int?;
+    final jsonrpcJson = json['jsonrpc'];
+    final jsonrpc = jsonrpcJson as String;
+    final methodJson = json['method'];
+    final method = Method.fromJson(methodJson as String);
+    final paramsJson = json['params'];
+    final params = paramsJson;
+    return IncomingMessage(
+      clientRequestTime: clientRequestTime,
+      jsonrpc: jsonrpc,
+      method: method,
+      params: params,
+    );
+  }
+
+  @override
+  final int? clientRequestTime;
+  @override
+  final String jsonrpc;
+  final Method method;
+  final Object? params;
+
+  @override
+  Map<String, Object?> toJson() {
+    var result = <String, Object?>{};
+    if (clientRequestTime != null) {
+      result['clientRequestTime'] = clientRequestTime;
+    }
+    result['jsonrpc'] = jsonrpc;
+    result['method'] = method.toJson();
+    if (params != null) {
+      result['params'] = params;
+    }
+    return result;
+  }
+
+  static bool canParse(Object? obj, LspJsonReporter reporter) {
+    if (obj is Map<String, Object?>) {
+      reporter.push('clientRequestTime');
+      try {
+        final clientRequestTime = obj['clientRequestTime'];
+        if (clientRequestTime != null && clientRequestTime is! int) {
+          reporter.reportError('must be of type int');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('jsonrpc');
+      try {
+        if (!obj.containsKey('jsonrpc')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final jsonrpc = obj['jsonrpc'];
+        if (jsonrpc == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (jsonrpc is! String) {
+          reporter.reportError('must be of type String');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('method');
+      try {
+        if (!obj.containsKey('method')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final method = obj['method'];
+        if (method == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (!Method.canParse(method, reporter)) {
+          reporter.reportError('must be of type Method');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      return true;
+    } else {
+      reporter.reportError('must be of type IncomingMessage');
+      return false;
+    }
+  }
+
+  @override
+  bool operator ==(Object other) {
+    if (other is IncomingMessage && other.runtimeType == IncomingMessage) {
+      return clientRequestTime == other.clientRequestTime &&
+          jsonrpc == other.jsonrpc &&
+          method == other.method &&
+          params == other.params &&
+          true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode => Object.hash(
+        clientRequestTime,
+        jsonrpc,
+        method,
+        params,
+      );
+
+  @override
+  String toString() => jsonEncoder.convert(toJson());
+}
+
+class Message implements ToJsonable {
+  static const jsonHandler = LspJsonHandler(
+    Message.canParse,
+    Message.fromJson,
+  );
+
+  Message({
+    this.clientRequestTime,
+    required this.jsonrpc,
+  });
+  static Message fromJson(Map<String, Object?> json) {
+    if (IncomingMessage.canParse(json, nullLspJsonReporter)) {
+      return IncomingMessage.fromJson(json);
+    }
+    if (ResponseMessage.canParse(json, nullLspJsonReporter)) {
+      return ResponseMessage.fromJson(json);
+    }
+    final clientRequestTimeJson = json['clientRequestTime'];
+    final clientRequestTime = clientRequestTimeJson as int?;
+    final jsonrpcJson = json['jsonrpc'];
+    final jsonrpc = jsonrpcJson as String;
+    return Message(
+      clientRequestTime: clientRequestTime,
+      jsonrpc: jsonrpc,
+    );
+  }
+
+  final int? clientRequestTime;
+  final String jsonrpc;
+
+  @override
+  Map<String, Object?> toJson() {
+    var result = <String, Object?>{};
+    if (clientRequestTime != null) {
+      result['clientRequestTime'] = clientRequestTime;
+    }
+    result['jsonrpc'] = jsonrpc;
+    return result;
+  }
+
+  static bool canParse(Object? obj, LspJsonReporter reporter) {
+    if (obj is Map<String, Object?>) {
+      reporter.push('clientRequestTime');
+      try {
+        final clientRequestTime = obj['clientRequestTime'];
+        if (clientRequestTime != null && clientRequestTime is! int) {
+          reporter.reportError('must be of type int');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('jsonrpc');
+      try {
+        if (!obj.containsKey('jsonrpc')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final jsonrpc = obj['jsonrpc'];
+        if (jsonrpc == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (jsonrpc is! String) {
+          reporter.reportError('must be of type String');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      return true;
+    } else {
+      reporter.reportError('must be of type Message');
+      return false;
+    }
+  }
+
+  @override
+  bool operator ==(Object other) {
+    if (other is Message && other.runtimeType == Message) {
+      return clientRequestTime == other.clientRequestTime &&
+          jsonrpc == other.jsonrpc &&
+          true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode => Object.hash(
+        clientRequestTime,
+        jsonrpc,
+      );
+
+  @override
+  String toString() => jsonEncoder.convert(toJson());
+}
+
+class NotificationMessage implements IncomingMessage, ToJsonable {
+  static const jsonHandler = LspJsonHandler(
+    NotificationMessage.canParse,
+    NotificationMessage.fromJson,
+  );
+
+  NotificationMessage({
+    this.clientRequestTime,
+    required this.jsonrpc,
+    required this.method,
+    this.params,
+  });
+  static NotificationMessage fromJson(Map<String, Object?> json) {
+    final clientRequestTimeJson = json['clientRequestTime'];
+    final clientRequestTime = clientRequestTimeJson as int?;
+    final jsonrpcJson = json['jsonrpc'];
+    final jsonrpc = jsonrpcJson as String;
+    final methodJson = json['method'];
+    final method = Method.fromJson(methodJson as String);
+    final paramsJson = json['params'];
+    final params = paramsJson;
+    return NotificationMessage(
+      clientRequestTime: clientRequestTime,
+      jsonrpc: jsonrpc,
+      method: method,
+      params: params,
+    );
+  }
+
+  @override
+  final int? clientRequestTime;
+  @override
+  final String jsonrpc;
+  @override
+  final Method method;
+  @override
+  final Object? params;
+
+  @override
+  Map<String, Object?> toJson() {
+    var result = <String, Object?>{};
+    if (clientRequestTime != null) {
+      result['clientRequestTime'] = clientRequestTime;
+    }
+    result['jsonrpc'] = jsonrpc;
+    result['method'] = method.toJson();
+    if (params != null) {
+      result['params'] = params;
+    }
+    return result;
+  }
+
+  static bool canParse(Object? obj, LspJsonReporter reporter) {
+    if (obj is Map<String, Object?>) {
+      reporter.push('clientRequestTime');
+      try {
+        final clientRequestTime = obj['clientRequestTime'];
+        if (clientRequestTime != null && clientRequestTime is! int) {
+          reporter.reportError('must be of type int');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('jsonrpc');
+      try {
+        if (!obj.containsKey('jsonrpc')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final jsonrpc = obj['jsonrpc'];
+        if (jsonrpc == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (jsonrpc is! String) {
+          reporter.reportError('must be of type String');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('method');
+      try {
+        if (!obj.containsKey('method')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final method = obj['method'];
+        if (method == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (!Method.canParse(method, reporter)) {
+          reporter.reportError('must be of type Method');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      return true;
+    } else {
+      reporter.reportError('must be of type NotificationMessage');
+      return false;
+    }
+  }
+
+  @override
+  bool operator ==(Object other) {
+    if (other is NotificationMessage &&
+        other.runtimeType == NotificationMessage) {
+      return clientRequestTime == other.clientRequestTime &&
+          jsonrpc == other.jsonrpc &&
+          method == other.method &&
+          params == other.params &&
+          true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode => Object.hash(
+        clientRequestTime,
+        jsonrpc,
+        method,
+        params,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
 }
 
 class Outline implements ToJsonable {
-  static const jsonHandler = LspJsonHandler(Outline.canParse, Outline.fromJson);
+  static const jsonHandler = LspJsonHandler(
+    Outline.canParse,
+    Outline.fromJson,
+  );
 
-  Outline(
-      {required this.element,
-      required this.range,
-      required this.codeRange,
-      this.children});
+  Outline({
+    this.children,
+    required this.codeRange,
+    required this.element,
+    required this.range,
+  });
   static Outline fromJson(Map<String, Object?> json) {
-    final elementJson = json['element'];
-    final element = Element.fromJson(elementJson as Map<String, Object?>);
-    final rangeJson = json['range'];
-    final range = Range.fromJson(rangeJson as Map<String, Object?>);
-    final codeRangeJson = json['codeRange'];
-    final codeRange = Range.fromJson(codeRangeJson as Map<String, Object?>);
     final childrenJson = json['children'];
     final children = (childrenJson as List<Object?>?)
         ?.map((item) => Outline.fromJson(item as Map<String, Object?>))
         .toList();
+    final codeRangeJson = json['codeRange'];
+    final codeRange = Range.fromJson(codeRangeJson as Map<String, Object?>);
+    final elementJson = json['element'];
+    final element = Element.fromJson(elementJson as Map<String, Object?>);
+    final rangeJson = json['range'];
+    final range = Range.fromJson(rangeJson as Map<String, Object?>);
     return Outline(
-        element: element,
-        range: range,
-        codeRange: codeRange,
-        children: children);
+      children: children,
+      codeRange: codeRange,
+      element: element,
+      range: range,
+    );
   }
 
   final List<Outline>? children;
@@ -1056,19 +1486,50 @@
   final Element element;
   final Range range;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['element'] = element.toJson();
-    __result['range'] = range.toJson();
-    __result['codeRange'] = codeRange.toJson();
+    var result = <String, Object?>{};
     if (children != null) {
-      __result['children'] = children?.map((item) => item.toJson()).toList();
+      result['children'] = children?.map((item) => item.toJson()).toList();
     }
-    return __result;
+    result['codeRange'] = codeRange.toJson();
+    result['element'] = element.toJson();
+    result['range'] = range.toJson();
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
+      reporter.push('children');
+      try {
+        final children = obj['children'];
+        if (children != null &&
+            (children is! List<Object?> ||
+                children.any((item) => !Outline.canParse(item, reporter)))) {
+          reporter.reportError('must be of type List<Outline>');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('codeRange');
+      try {
+        if (!obj.containsKey('codeRange')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final codeRange = obj['codeRange'];
+        if (codeRange == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (!Range.canParse(codeRange, reporter)) {
+          reporter.reportError('must be of type Range');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
       reporter.push('element');
       try {
         if (!obj.containsKey('element')) {
@@ -1080,7 +1541,7 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(Element.canParse(element, reporter))) {
+        if (!Element.canParse(element, reporter)) {
           reporter.reportError('must be of type Element');
           return false;
         }
@@ -1098,44 +1559,13 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(Range.canParse(range, reporter))) {
+        if (!Range.canParse(range, reporter)) {
           reporter.reportError('must be of type Range');
           return false;
         }
       } finally {
         reporter.pop();
       }
-      reporter.push('codeRange');
-      try {
-        if (!obj.containsKey('codeRange')) {
-          reporter.reportError('must not be undefined');
-          return false;
-        }
-        final codeRange = obj['codeRange'];
-        if (codeRange == null) {
-          reporter.reportError('must not be null');
-          return false;
-        }
-        if (!(Range.canParse(codeRange, reporter))) {
-          reporter.reportError('must be of type Range');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('children');
-      try {
-        final children = obj['children'];
-        if (children != null &&
-            !((children is List<Object?> &&
-                (children
-                    .every((item) => Outline.canParse(item, reporter)))))) {
-          reporter.reportError('must be of type List<Outline>');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       return true;
     } else {
       reporter.reportError('must be of type Outline');
@@ -1146,19 +1576,23 @@
   @override
   bool operator ==(Object other) {
     if (other is Outline && other.runtimeType == Outline) {
-      return element == other.element &&
-          range == other.range &&
-          codeRange == other.codeRange &&
-          listEqual(
+      return listEqual(
               children, other.children, (Outline a, Outline b) => a == b) &&
+          codeRange == other.codeRange &&
+          element == other.element &&
+          range == other.range &&
           true;
     }
     return false;
   }
 
   @override
-  int get hashCode =>
-      Object.hash(element, range, codeRange, lspHashCode(children));
+  int get hashCode => Object.hash(
+        lspHashCode(children),
+        codeRange,
+        element,
+        range,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
@@ -1167,23 +1601,29 @@
 class PubPackageCompletionItemResolutionInfo
     implements CompletionItemResolutionInfo, ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      PubPackageCompletionItemResolutionInfo.canParse,
-      PubPackageCompletionItemResolutionInfo.fromJson);
+    PubPackageCompletionItemResolutionInfo.canParse,
+    PubPackageCompletionItemResolutionInfo.fromJson,
+  );
 
-  PubPackageCompletionItemResolutionInfo({required this.packageName});
+  PubPackageCompletionItemResolutionInfo({
+    required this.packageName,
+  });
   static PubPackageCompletionItemResolutionInfo fromJson(
       Map<String, Object?> json) {
     final packageNameJson = json['packageName'];
     final packageName = packageNameJson as String;
-    return PubPackageCompletionItemResolutionInfo(packageName: packageName);
+    return PubPackageCompletionItemResolutionInfo(
+      packageName: packageName,
+    );
   }
 
   final String packageName;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['packageName'] = packageName;
-    return __result;
+    var result = <String, Object?>{};
+    result['packageName'] = packageName;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -1199,7 +1639,7 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(packageName is String)) {
+        if (packageName is! String) {
           reporter.reportError('must be of type String');
           return false;
         }
@@ -1232,49 +1672,40 @@
 
 class PublishClosingLabelsParams implements ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      PublishClosingLabelsParams.canParse, PublishClosingLabelsParams.fromJson);
+    PublishClosingLabelsParams.canParse,
+    PublishClosingLabelsParams.fromJson,
+  );
 
-  PublishClosingLabelsParams({required this.uri, required this.labels});
+  PublishClosingLabelsParams({
+    required this.labels,
+    required this.uri,
+  });
   static PublishClosingLabelsParams fromJson(Map<String, Object?> json) {
-    final uriJson = json['uri'];
-    final uri = uriJson as String;
     final labelsJson = json['labels'];
     final labels = (labelsJson as List<Object?>)
         .map((item) => ClosingLabel.fromJson(item as Map<String, Object?>))
         .toList();
-    return PublishClosingLabelsParams(uri: uri, labels: labels);
+    final uriJson = json['uri'];
+    final uri = uriJson as String;
+    return PublishClosingLabelsParams(
+      labels: labels,
+      uri: uri,
+    );
   }
 
   final List<ClosingLabel> labels;
   final String uri;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['uri'] = uri;
-    __result['labels'] = labels.map((item) => item.toJson()).toList();
-    return __result;
+    var result = <String, Object?>{};
+    result['labels'] = labels.map((item) => item.toJson()).toList();
+    result['uri'] = uri;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
-      reporter.push('uri');
-      try {
-        if (!obj.containsKey('uri')) {
-          reporter.reportError('must not be undefined');
-          return false;
-        }
-        final uri = obj['uri'];
-        if (uri == null) {
-          reporter.reportError('must not be null');
-          return false;
-        }
-        if (!(uri is String)) {
-          reporter.reportError('must be of type String');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       reporter.push('labels');
       try {
         if (!obj.containsKey('labels')) {
@@ -1286,14 +1717,32 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!((labels is List<Object?> &&
-            (labels.every((item) => ClosingLabel.canParse(item, reporter)))))) {
+        if (labels is! List<Object?> ||
+            labels.any((item) => !ClosingLabel.canParse(item, reporter))) {
           reporter.reportError('must be of type List<ClosingLabel>');
           return false;
         }
       } finally {
         reporter.pop();
       }
+      reporter.push('uri');
+      try {
+        if (!obj.containsKey('uri')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final uri = obj['uri'];
+        if (uri == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (uri is! String) {
+          reporter.reportError('must be of type String');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
       return true;
     } else {
       reporter.reportError('must be of type PublishClosingLabelsParams');
@@ -1305,16 +1754,19 @@
   bool operator ==(Object other) {
     if (other is PublishClosingLabelsParams &&
         other.runtimeType == PublishClosingLabelsParams) {
-      return uri == other.uri &&
-          listEqual(labels, other.labels,
+      return listEqual(labels, other.labels,
               (ClosingLabel a, ClosingLabel b) => a == b) &&
+          uri == other.uri &&
           true;
     }
     return false;
   }
 
   @override
-  int get hashCode => Object.hash(uri, lspHashCode(labels));
+  int get hashCode => Object.hash(
+        lspHashCode(labels),
+        uri,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
@@ -1322,49 +1774,39 @@
 
 class PublishFlutterOutlineParams implements ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      PublishFlutterOutlineParams.canParse,
-      PublishFlutterOutlineParams.fromJson);
+    PublishFlutterOutlineParams.canParse,
+    PublishFlutterOutlineParams.fromJson,
+  );
 
-  PublishFlutterOutlineParams({required this.uri, required this.outline});
+  PublishFlutterOutlineParams({
+    required this.outline,
+    required this.uri,
+  });
   static PublishFlutterOutlineParams fromJson(Map<String, Object?> json) {
-    final uriJson = json['uri'];
-    final uri = uriJson as String;
     final outlineJson = json['outline'];
     final outline =
         FlutterOutline.fromJson(outlineJson as Map<String, Object?>);
-    return PublishFlutterOutlineParams(uri: uri, outline: outline);
+    final uriJson = json['uri'];
+    final uri = uriJson as String;
+    return PublishFlutterOutlineParams(
+      outline: outline,
+      uri: uri,
+    );
   }
 
   final FlutterOutline outline;
   final String uri;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['uri'] = uri;
-    __result['outline'] = outline.toJson();
-    return __result;
+    var result = <String, Object?>{};
+    result['outline'] = outline.toJson();
+    result['uri'] = uri;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
-      reporter.push('uri');
-      try {
-        if (!obj.containsKey('uri')) {
-          reporter.reportError('must not be undefined');
-          return false;
-        }
-        final uri = obj['uri'];
-        if (uri == null) {
-          reporter.reportError('must not be null');
-          return false;
-        }
-        if (!(uri is String)) {
-          reporter.reportError('must be of type String');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       reporter.push('outline');
       try {
         if (!obj.containsKey('outline')) {
@@ -1376,13 +1818,31 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(FlutterOutline.canParse(outline, reporter))) {
+        if (!FlutterOutline.canParse(outline, reporter)) {
           reporter.reportError('must be of type FlutterOutline');
           return false;
         }
       } finally {
         reporter.pop();
       }
+      reporter.push('uri');
+      try {
+        if (!obj.containsKey('uri')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final uri = obj['uri'];
+        if (uri == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (uri is! String) {
+          reporter.reportError('must be of type String');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
       return true;
     } else {
       reporter.reportError('must be of type PublishFlutterOutlineParams');
@@ -1394,13 +1854,16 @@
   bool operator ==(Object other) {
     if (other is PublishFlutterOutlineParams &&
         other.runtimeType == PublishFlutterOutlineParams) {
-      return uri == other.uri && outline == other.outline && true;
+      return outline == other.outline && uri == other.uri && true;
     }
     return false;
   }
 
   @override
-  int get hashCode => Object.hash(uri, outline);
+  int get hashCode => Object.hash(
+        outline,
+        uri,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
@@ -1408,47 +1871,38 @@
 
 class PublishOutlineParams implements ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      PublishOutlineParams.canParse, PublishOutlineParams.fromJson);
+    PublishOutlineParams.canParse,
+    PublishOutlineParams.fromJson,
+  );
 
-  PublishOutlineParams({required this.uri, required this.outline});
+  PublishOutlineParams({
+    required this.outline,
+    required this.uri,
+  });
   static PublishOutlineParams fromJson(Map<String, Object?> json) {
-    final uriJson = json['uri'];
-    final uri = uriJson as String;
     final outlineJson = json['outline'];
     final outline = Outline.fromJson(outlineJson as Map<String, Object?>);
-    return PublishOutlineParams(uri: uri, outline: outline);
+    final uriJson = json['uri'];
+    final uri = uriJson as String;
+    return PublishOutlineParams(
+      outline: outline,
+      uri: uri,
+    );
   }
 
   final Outline outline;
   final String uri;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['uri'] = uri;
-    __result['outline'] = outline.toJson();
-    return __result;
+    var result = <String, Object?>{};
+    result['outline'] = outline.toJson();
+    result['uri'] = uri;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
-      reporter.push('uri');
-      try {
-        if (!obj.containsKey('uri')) {
-          reporter.reportError('must not be undefined');
-          return false;
-        }
-        final uri = obj['uri'];
-        if (uri == null) {
-          reporter.reportError('must not be null');
-          return false;
-        }
-        if (!(uri is String)) {
-          reporter.reportError('must be of type String');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       reporter.push('outline');
       try {
         if (!obj.containsKey('outline')) {
@@ -1460,13 +1914,31 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(Outline.canParse(outline, reporter))) {
+        if (!Outline.canParse(outline, reporter)) {
           reporter.reportError('must be of type Outline');
           return false;
         }
       } finally {
         reporter.pop();
       }
+      reporter.push('uri');
+      try {
+        if (!obj.containsKey('uri')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final uri = obj['uri'];
+        if (uri == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (uri is! String) {
+          reporter.reportError('must be of type String');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
       return true;
     } else {
       reporter.reportError('must be of type PublishOutlineParams');
@@ -1478,53 +1950,500 @@
   bool operator ==(Object other) {
     if (other is PublishOutlineParams &&
         other.runtimeType == PublishOutlineParams) {
-      return uri == other.uri && outline == other.outline && true;
+      return outline == other.outline && uri == other.uri && true;
     }
     return false;
   }
 
   @override
-  int get hashCode => Object.hash(uri, outline);
+  int get hashCode => Object.hash(
+        outline,
+        uri,
+      );
+
+  @override
+  String toString() => jsonEncoder.convert(toJson());
+}
+
+class RequestMessage implements IncomingMessage, ToJsonable {
+  static const jsonHandler = LspJsonHandler(
+    RequestMessage.canParse,
+    RequestMessage.fromJson,
+  );
+
+  RequestMessage({
+    this.clientRequestTime,
+    required this.id,
+    required this.jsonrpc,
+    required this.method,
+    this.params,
+  });
+  static RequestMessage fromJson(Map<String, Object?> json) {
+    final clientRequestTimeJson = json['clientRequestTime'];
+    final clientRequestTime = clientRequestTimeJson as int?;
+    final idJson = json['id'];
+    final id = idJson is int
+        ? Either2<int, String>.t1(idJson)
+        : (idJson is String
+            ? Either2<int, String>.t2(idJson)
+            : (throw '''$idJson was not one of (int, String)'''));
+    final jsonrpcJson = json['jsonrpc'];
+    final jsonrpc = jsonrpcJson as String;
+    final methodJson = json['method'];
+    final method = Method.fromJson(methodJson as String);
+    final paramsJson = json['params'];
+    final params = paramsJson;
+    return RequestMessage(
+      clientRequestTime: clientRequestTime,
+      id: id,
+      jsonrpc: jsonrpc,
+      method: method,
+      params: params,
+    );
+  }
+
+  @override
+  final int? clientRequestTime;
+  final Either2<int, String> id;
+  @override
+  final String jsonrpc;
+  @override
+  final Method method;
+  @override
+  final Object? params;
+
+  @override
+  Map<String, Object?> toJson() {
+    var result = <String, Object?>{};
+    if (clientRequestTime != null) {
+      result['clientRequestTime'] = clientRequestTime;
+    }
+    result['id'] = id;
+    result['jsonrpc'] = jsonrpc;
+    result['method'] = method.toJson();
+    if (params != null) {
+      result['params'] = params;
+    }
+    return result;
+  }
+
+  static bool canParse(Object? obj, LspJsonReporter reporter) {
+    if (obj is Map<String, Object?>) {
+      reporter.push('clientRequestTime');
+      try {
+        final clientRequestTime = obj['clientRequestTime'];
+        if (clientRequestTime != null && clientRequestTime is! int) {
+          reporter.reportError('must be of type int');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('id');
+      try {
+        if (!obj.containsKey('id')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final id = obj['id'];
+        if (id == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (id is! int && id is! String) {
+          reporter.reportError('must be of type Either2<int, String>');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('jsonrpc');
+      try {
+        if (!obj.containsKey('jsonrpc')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final jsonrpc = obj['jsonrpc'];
+        if (jsonrpc == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (jsonrpc is! String) {
+          reporter.reportError('must be of type String');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('method');
+      try {
+        if (!obj.containsKey('method')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final method = obj['method'];
+        if (method == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (!Method.canParse(method, reporter)) {
+          reporter.reportError('must be of type Method');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      return true;
+    } else {
+      reporter.reportError('must be of type RequestMessage');
+      return false;
+    }
+  }
+
+  @override
+  bool operator ==(Object other) {
+    if (other is RequestMessage && other.runtimeType == RequestMessage) {
+      return clientRequestTime == other.clientRequestTime &&
+          id == other.id &&
+          jsonrpc == other.jsonrpc &&
+          method == other.method &&
+          params == other.params &&
+          true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode => Object.hash(
+        clientRequestTime,
+        id,
+        jsonrpc,
+        method,
+        params,
+      );
+
+  @override
+  String toString() => jsonEncoder.convert(toJson());
+}
+
+class ResponseError implements ToJsonable {
+  static const jsonHandler = LspJsonHandler(
+    ResponseError.canParse,
+    ResponseError.fromJson,
+  );
+
+  ResponseError({
+    required this.code,
+    this.data,
+    required this.message,
+  });
+  static ResponseError fromJson(Map<String, Object?> json) {
+    final codeJson = json['code'];
+    final code = ErrorCodes.fromJson(codeJson as int);
+    final dataJson = json['data'];
+    final data = dataJson as String?;
+    final messageJson = json['message'];
+    final message = messageJson as String;
+    return ResponseError(
+      code: code,
+      data: data,
+      message: message,
+    );
+  }
+
+  final ErrorCodes code;
+
+  /// A string that contains additional information about the error. Can be
+  /// omitted.
+  final String? data;
+  final String message;
+
+  @override
+  Map<String, Object?> toJson() {
+    var result = <String, Object?>{};
+    result['code'] = code.toJson();
+    if (data != null) {
+      result['data'] = data;
+    }
+    result['message'] = message;
+    return result;
+  }
+
+  static bool canParse(Object? obj, LspJsonReporter reporter) {
+    if (obj is Map<String, Object?>) {
+      reporter.push('code');
+      try {
+        if (!obj.containsKey('code')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final code = obj['code'];
+        if (code == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (!ErrorCodes.canParse(code, reporter)) {
+          reporter.reportError('must be of type ErrorCodes');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('data');
+      try {
+        final data = obj['data'];
+        if (data != null && data is! String) {
+          reporter.reportError('must be of type String');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('message');
+      try {
+        if (!obj.containsKey('message')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final message = obj['message'];
+        if (message == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (message is! String) {
+          reporter.reportError('must be of type String');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      return true;
+    } else {
+      reporter.reportError('must be of type ResponseError');
+      return false;
+    }
+  }
+
+  @override
+  bool operator ==(Object other) {
+    if (other is ResponseError && other.runtimeType == ResponseError) {
+      return code == other.code &&
+          data == other.data &&
+          message == other.message &&
+          true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode => Object.hash(
+        code,
+        data,
+        message,
+      );
+
+  @override
+  String toString() => jsonEncoder.convert(toJson());
+}
+
+class ResponseMessage implements Message, ToJsonable {
+  static const jsonHandler = LspJsonHandler(
+    ResponseMessage.canParse,
+    ResponseMessage.fromJson,
+  );
+
+  ResponseMessage({
+    this.clientRequestTime,
+    this.error,
+    this.id,
+    required this.jsonrpc,
+    this.result,
+  });
+  static ResponseMessage fromJson(Map<String, Object?> json) {
+    final clientRequestTimeJson = json['clientRequestTime'];
+    final clientRequestTime = clientRequestTimeJson as int?;
+    final errorJson = json['error'];
+    final error = errorJson != null
+        ? ResponseError.fromJson(errorJson as Map<String, Object?>)
+        : null;
+    final idJson = json['id'];
+    final id = idJson == null
+        ? null
+        : (idJson is int
+            ? Either2<int, String>.t1(idJson)
+            : (idJson is String
+                ? Either2<int, String>.t2(idJson)
+                : (throw '''$idJson was not one of (int, String)''')));
+    final jsonrpcJson = json['jsonrpc'];
+    final jsonrpc = jsonrpcJson as String;
+    final resultJson = json['result'];
+    final result = resultJson;
+    return ResponseMessage(
+      clientRequestTime: clientRequestTime,
+      error: error,
+      id: id,
+      jsonrpc: jsonrpc,
+      result: result,
+    );
+  }
+
+  @override
+  final int? clientRequestTime;
+  final ResponseError? error;
+  final Either2<int, String>? id;
+  @override
+  final String jsonrpc;
+  final Object? result;
+
+  @override
+  Map<String, Object?> toJson() {
+    var map = <String, Object?>{};
+    if (clientRequestTime != null) {
+      map['clientRequestTime'] = clientRequestTime;
+    }
+    map['id'] = id;
+    map['jsonrpc'] = jsonrpc;
+    if (error != null && result != null) {
+      throw 'result and error cannot both be set';
+    } else if (error != null) {
+      map['error'] = error;
+    } else {
+      map['result'] = result;
+    }
+    return map;
+  }
+
+  static bool canParse(Object? obj, LspJsonReporter reporter) {
+    if (obj is Map<String, Object?>) {
+      reporter.push('clientRequestTime');
+      try {
+        final clientRequestTime = obj['clientRequestTime'];
+        if (clientRequestTime != null && clientRequestTime is! int) {
+          reporter.reportError('must be of type int');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('error');
+      try {
+        final error = obj['error'];
+        if (error != null && !ResponseError.canParse(error, reporter)) {
+          reporter.reportError('must be of type ResponseError');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('id');
+      try {
+        if (!obj.containsKey('id')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final id = obj['id'];
+        if (id != null && id is! int && id is! String) {
+          reporter.reportError('must be of type Either2<int, String>');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('jsonrpc');
+      try {
+        if (!obj.containsKey('jsonrpc')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final jsonrpc = obj['jsonrpc'];
+        if (jsonrpc == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (jsonrpc is! String) {
+          reporter.reportError('must be of type String');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      return true;
+    } else {
+      reporter.reportError('must be of type ResponseMessage');
+      return false;
+    }
+  }
+
+  @override
+  bool operator ==(Object other) {
+    if (other is ResponseMessage && other.runtimeType == ResponseMessage) {
+      return clientRequestTime == other.clientRequestTime &&
+          error == other.error &&
+          id == other.id &&
+          jsonrpc == other.jsonrpc &&
+          result == other.result &&
+          true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode => Object.hash(
+        clientRequestTime,
+        error,
+        id,
+        jsonrpc,
+        result,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
 }
 
 class SnippetTextEdit implements TextEdit, ToJsonable {
-  static const jsonHandler =
-      LspJsonHandler(SnippetTextEdit.canParse, SnippetTextEdit.fromJson);
+  static const jsonHandler = LspJsonHandler(
+    SnippetTextEdit.canParse,
+    SnippetTextEdit.fromJson,
+  );
 
-  SnippetTextEdit(
-      {required this.insertTextFormat,
-      required this.range,
-      required this.newText});
+  SnippetTextEdit({
+    required this.insertTextFormat,
+    required this.newText,
+    required this.range,
+  });
   static SnippetTextEdit fromJson(Map<String, Object?> json) {
     final insertTextFormatJson = json['insertTextFormat'];
     final insertTextFormat =
         InsertTextFormat.fromJson(insertTextFormatJson as int);
-    final rangeJson = json['range'];
-    final range = Range.fromJson(rangeJson as Map<String, Object?>);
     final newTextJson = json['newText'];
     final newText = newTextJson as String;
+    final rangeJson = json['range'];
+    final range = Range.fromJson(rangeJson as Map<String, Object?>);
     return SnippetTextEdit(
-        insertTextFormat: insertTextFormat, range: range, newText: newText);
+      insertTextFormat: insertTextFormat,
+      newText: newText,
+      range: range,
+    );
   }
 
   final InsertTextFormat insertTextFormat;
 
   /// The string to be inserted. For delete operations use an empty string.
+  @override
   final String newText;
 
   /// The range of the text document to be manipulated. To insert text into a
   /// document create a range where start === end.
+  @override
   final Range range;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['insertTextFormat'] = insertTextFormat.toJson();
-    __result['range'] = range.toJson();
-    __result['newText'] = newText;
-    return __result;
+    var result = <String, Object?>{};
+    result['insertTextFormat'] = insertTextFormat.toJson();
+    result['newText'] = newText;
+    result['range'] = range.toJson();
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -1540,31 +2459,13 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(InsertTextFormat.canParse(insertTextFormat, reporter))) {
+        if (!InsertTextFormat.canParse(insertTextFormat, reporter)) {
           reporter.reportError('must be of type InsertTextFormat');
           return false;
         }
       } finally {
         reporter.pop();
       }
-      reporter.push('range');
-      try {
-        if (!obj.containsKey('range')) {
-          reporter.reportError('must not be undefined');
-          return false;
-        }
-        final range = obj['range'];
-        if (range == null) {
-          reporter.reportError('must not be null');
-          return false;
-        }
-        if (!(Range.canParse(range, reporter))) {
-          reporter.reportError('must be of type Range');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       reporter.push('newText');
       try {
         if (!obj.containsKey('newText')) {
@@ -1576,13 +2477,31 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(newText is String)) {
+        if (newText is! String) {
           reporter.reportError('must be of type String');
           return false;
         }
       } finally {
         reporter.pop();
       }
+      reporter.push('range');
+      try {
+        if (!obj.containsKey('range')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final range = obj['range'];
+        if (range == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (!Range.canParse(range, reporter)) {
+          reporter.reportError('must be of type Range');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
       return true;
     } else {
       reporter.reportError('must be of type SnippetTextEdit');
@@ -1594,15 +2513,19 @@
   bool operator ==(Object other) {
     if (other is SnippetTextEdit && other.runtimeType == SnippetTextEdit) {
       return insertTextFormat == other.insertTextFormat &&
-          range == other.range &&
           newText == other.newText &&
+          range == other.range &&
           true;
     }
     return false;
   }
 
   @override
-  int get hashCode => Object.hash(insertTextFormat, range, newText);
+  int get hashCode => Object.hash(
+        insertTextFormat,
+        newText,
+        range,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
@@ -1610,31 +2533,50 @@
 
 class ValidateRefactorResult implements ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      ValidateRefactorResult.canParse, ValidateRefactorResult.fromJson);
+    ValidateRefactorResult.canParse,
+    ValidateRefactorResult.fromJson,
+  );
 
-  ValidateRefactorResult({required this.valid, this.message});
+  ValidateRefactorResult({
+    this.message,
+    required this.valid,
+  });
   static ValidateRefactorResult fromJson(Map<String, Object?> json) {
-    final validJson = json['valid'];
-    final valid = validJson as bool;
     final messageJson = json['message'];
     final message = messageJson as String?;
-    return ValidateRefactorResult(valid: valid, message: message);
+    final validJson = json['valid'];
+    final valid = validJson as bool;
+    return ValidateRefactorResult(
+      message: message,
+      valid: valid,
+    );
   }
 
   final String? message;
   final bool valid;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['valid'] = valid;
+    var result = <String, Object?>{};
     if (message != null) {
-      __result['message'] = message;
+      result['message'] = message;
     }
-    return __result;
+    result['valid'] = valid;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
+      reporter.push('message');
+      try {
+        final message = obj['message'];
+        if (message != null && message is! String) {
+          reporter.reportError('must be of type String');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
       reporter.push('valid');
       try {
         if (!obj.containsKey('valid')) {
@@ -1646,23 +2588,13 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(valid is bool)) {
+        if (valid is! bool) {
           reporter.reportError('must be of type bool');
           return false;
         }
       } finally {
         reporter.pop();
       }
-      reporter.push('message');
-      try {
-        final message = obj['message'];
-        if (message != null && !(message is String)) {
-          reporter.reportError('must be of type String');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       return true;
     } else {
       reporter.reportError('must be of type ValidateRefactorResult');
@@ -1674,13 +2606,16 @@
   bool operator ==(Object other) {
     if (other is ValidateRefactorResult &&
         other.runtimeType == ValidateRefactorResult) {
-      return valid == other.valid && message == other.message && true;
+      return message == other.message && valid == other.valid && true;
     }
     return false;
   }
 
   @override
-  int get hashCode => Object.hash(valid, message);
+  int get hashCode => Object.hash(
+        message,
+        valid,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
diff --git a/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart b/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart
index dfb5f9c..9c7edcb 100644
--- a/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart
+++ b/pkg/analysis_server/lib/lsp_protocol/protocol_generated.dart
@@ -6,11 +6,6 @@
 // To regenerate the file, use the script
 // "pkg/analysis_server/tool/lsp_spec/generate_all.dart".
 
-// ignore_for_file: annotate_overrides
-// ignore_for_file: no_leading_underscores_for_local_identifiers
-// ignore_for_file: prefer_is_not_operator
-// ignore_for_file: unnecessary_parenthesis
-
 import 'dart:core' hide deprecated;
 import 'dart:core' as core show deprecated;
 import 'dart:convert' show JsonEncoder;
@@ -24,38 +19,49 @@
 /// A special text edit with an additional change annotation.
 ///  @since 3.16.0.
 class AnnotatedTextEdit implements TextEdit, ToJsonable {
-  static const jsonHandler =
-      LspJsonHandler(AnnotatedTextEdit.canParse, AnnotatedTextEdit.fromJson);
+  static const jsonHandler = LspJsonHandler(
+    AnnotatedTextEdit.canParse,
+    AnnotatedTextEdit.fromJson,
+  );
 
-  AnnotatedTextEdit(
-      {required this.annotationId, required this.range, required this.newText});
+  AnnotatedTextEdit({
+    required this.annotationId,
+    required this.newText,
+    required this.range,
+  });
   static AnnotatedTextEdit fromJson(Map<String, Object?> json) {
     final annotationIdJson = json['annotationId'];
     final annotationId = annotationIdJson as String;
-    final rangeJson = json['range'];
-    final range = Range.fromJson(rangeJson as Map<String, Object?>);
     final newTextJson = json['newText'];
     final newText = newTextJson as String;
+    final rangeJson = json['range'];
+    final range = Range.fromJson(rangeJson as Map<String, Object?>);
     return AnnotatedTextEdit(
-        annotationId: annotationId, range: range, newText: newText);
+      annotationId: annotationId,
+      newText: newText,
+      range: range,
+    );
   }
 
   /// The actual annotation identifier.
   final String annotationId;
 
   /// The string to be inserted. For delete operations use an empty string.
+  @override
   final String newText;
 
   /// The range of the text document to be manipulated. To insert text into a
   /// document create a range where start === end.
+  @override
   final Range range;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['annotationId'] = annotationId;
-    __result['range'] = range.toJson();
-    __result['newText'] = newText;
-    return __result;
+    var result = <String, Object?>{};
+    result['annotationId'] = annotationId;
+    result['newText'] = newText;
+    result['range'] = range.toJson();
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -71,7 +77,25 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(annotationId is String)) {
+        if (annotationId is! String) {
+          reporter.reportError('must be of type String');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('newText');
+      try {
+        if (!obj.containsKey('newText')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final newText = obj['newText'];
+        if (newText == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (newText is! String) {
           reporter.reportError('must be of type String');
           return false;
         }
@@ -89,31 +113,13 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(Range.canParse(range, reporter))) {
+        if (!Range.canParse(range, reporter)) {
           reporter.reportError('must be of type Range');
           return false;
         }
       } finally {
         reporter.pop();
       }
-      reporter.push('newText');
-      try {
-        if (!obj.containsKey('newText')) {
-          reporter.reportError('must not be undefined');
-          return false;
-        }
-        final newText = obj['newText'];
-        if (newText == null) {
-          reporter.reportError('must not be null');
-          return false;
-        }
-        if (!(newText is String)) {
-          reporter.reportError('must be of type String');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       return true;
     } else {
       reporter.reportError('must be of type AnnotatedTextEdit');
@@ -125,15 +131,19 @@
   bool operator ==(Object other) {
     if (other is AnnotatedTextEdit && other.runtimeType == AnnotatedTextEdit) {
       return annotationId == other.annotationId &&
-          range == other.range &&
           newText == other.newText &&
+          range == other.range &&
           true;
     }
     return false;
   }
 
   @override
-  int get hashCode => Object.hash(annotationId, range, newText);
+  int get hashCode => Object.hash(
+        annotationId,
+        newText,
+        range,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
@@ -141,15 +151,23 @@
 
 class ApplyWorkspaceEditParams implements ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      ApplyWorkspaceEditParams.canParse, ApplyWorkspaceEditParams.fromJson);
+    ApplyWorkspaceEditParams.canParse,
+    ApplyWorkspaceEditParams.fromJson,
+  );
 
-  ApplyWorkspaceEditParams({this.label, required this.edit});
+  ApplyWorkspaceEditParams({
+    required this.edit,
+    this.label,
+  });
   static ApplyWorkspaceEditParams fromJson(Map<String, Object?> json) {
-    final labelJson = json['label'];
-    final label = labelJson as String?;
     final editJson = json['edit'];
     final edit = WorkspaceEdit.fromJson(editJson as Map<String, Object?>);
-    return ApplyWorkspaceEditParams(label: label, edit: edit);
+    final labelJson = json['label'];
+    final label = labelJson as String?;
+    return ApplyWorkspaceEditParams(
+      edit: edit,
+      label: label,
+    );
   }
 
   /// The edits to apply.
@@ -159,27 +177,18 @@
   /// user interface for example on an undo stack to undo the workspace edit.
   final String? label;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
+    var result = <String, Object?>{};
+    result['edit'] = edit.toJson();
     if (label != null) {
-      __result['label'] = label;
+      result['label'] = label;
     }
-    __result['edit'] = edit.toJson();
-    return __result;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
-      reporter.push('label');
-      try {
-        final label = obj['label'];
-        if (label != null && !(label is String)) {
-          reporter.reportError('must be of type String');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       reporter.push('edit');
       try {
         if (!obj.containsKey('edit')) {
@@ -191,13 +200,23 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(WorkspaceEdit.canParse(edit, reporter))) {
+        if (!WorkspaceEdit.canParse(edit, reporter)) {
           reporter.reportError('must be of type WorkspaceEdit');
           return false;
         }
       } finally {
         reporter.pop();
       }
+      reporter.push('label');
+      try {
+        final label = obj['label'];
+        if (label != null && label is! String) {
+          reporter.reportError('must be of type String');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
       return true;
     } else {
       reporter.reportError('must be of type ApplyWorkspaceEditParams');
@@ -209,35 +228,44 @@
   bool operator ==(Object other) {
     if (other is ApplyWorkspaceEditParams &&
         other.runtimeType == ApplyWorkspaceEditParams) {
-      return label == other.label && edit == other.edit && true;
+      return edit == other.edit && label == other.label && true;
     }
     return false;
   }
 
   @override
-  int get hashCode => Object.hash(label, edit);
+  int get hashCode => Object.hash(
+        edit,
+        label,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
 }
 
-class ApplyWorkspaceEditResponse implements ToJsonable {
+class ApplyWorkspaceEditResult implements ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      ApplyWorkspaceEditResponse.canParse, ApplyWorkspaceEditResponse.fromJson);
+    ApplyWorkspaceEditResult.canParse,
+    ApplyWorkspaceEditResult.fromJson,
+  );
 
-  ApplyWorkspaceEditResponse(
-      {required this.applied, this.failureReason, this.failedChange});
-  static ApplyWorkspaceEditResponse fromJson(Map<String, Object?> json) {
+  ApplyWorkspaceEditResult({
+    required this.applied,
+    this.failedChange,
+    this.failureReason,
+  });
+  static ApplyWorkspaceEditResult fromJson(Map<String, Object?> json) {
     final appliedJson = json['applied'];
     final applied = appliedJson as bool;
-    final failureReasonJson = json['failureReason'];
-    final failureReason = failureReasonJson as String?;
     final failedChangeJson = json['failedChange'];
     final failedChange = failedChangeJson as int?;
-    return ApplyWorkspaceEditResponse(
-        applied: applied,
-        failureReason: failureReason,
-        failedChange: failedChange);
+    final failureReasonJson = json['failureReason'];
+    final failureReason = failureReasonJson as String?;
+    return ApplyWorkspaceEditResult(
+      applied: applied,
+      failedChange: failedChange,
+      failureReason: failureReason,
+    );
   }
 
   /// Indicates whether the edit was applied or not.
@@ -245,7 +273,7 @@
 
   /// Depending on the client's failure handling strategy `failedChange` might
   /// contain the index of the change that failed. This property is only
-  /// available if the client signals a `failureHandlingStrategy` in its client
+  /// available if the client signals a `failureHandling` strategy in its client
   /// capabilities.
   final int? failedChange;
 
@@ -254,16 +282,17 @@
   /// error for a request that triggered the edit.
   final String? failureReason;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['applied'] = applied;
-    if (failureReason != null) {
-      __result['failureReason'] = failureReason;
-    }
+    var result = <String, Object?>{};
+    result['applied'] = applied;
     if (failedChange != null) {
-      __result['failedChange'] = failedChange;
+      result['failedChange'] = failedChange;
     }
-    return __result;
+    if (failureReason != null) {
+      result['failureReason'] = failureReason;
+    }
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -279,54 +308,58 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(applied is bool)) {
+        if (applied is! bool) {
           reporter.reportError('must be of type bool');
           return false;
         }
       } finally {
         reporter.pop();
       }
-      reporter.push('failureReason');
-      try {
-        final failureReason = obj['failureReason'];
-        if (failureReason != null && !(failureReason is String)) {
-          reporter.reportError('must be of type String');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       reporter.push('failedChange');
       try {
         final failedChange = obj['failedChange'];
-        if (failedChange != null && !(failedChange is int)) {
+        if (failedChange != null && failedChange is! int) {
           reporter.reportError('must be of type int');
           return false;
         }
       } finally {
         reporter.pop();
       }
+      reporter.push('failureReason');
+      try {
+        final failureReason = obj['failureReason'];
+        if (failureReason != null && failureReason is! String) {
+          reporter.reportError('must be of type String');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
       return true;
     } else {
-      reporter.reportError('must be of type ApplyWorkspaceEditResponse');
+      reporter.reportError('must be of type ApplyWorkspaceEditResult');
       return false;
     }
   }
 
   @override
   bool operator ==(Object other) {
-    if (other is ApplyWorkspaceEditResponse &&
-        other.runtimeType == ApplyWorkspaceEditResponse) {
+    if (other is ApplyWorkspaceEditResult &&
+        other.runtimeType == ApplyWorkspaceEditResult) {
       return applied == other.applied &&
-          failureReason == other.failureReason &&
           failedChange == other.failedChange &&
+          failureReason == other.failureReason &&
           true;
     }
     return false;
   }
 
   @override
-  int get hashCode => Object.hash(applied, failureReason, failedChange);
+  int get hashCode => Object.hash(
+        applied,
+        failedChange,
+        failureReason,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
@@ -334,15 +367,19 @@
 
 class CallHierarchyClientCapabilities implements ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      CallHierarchyClientCapabilities.canParse,
-      CallHierarchyClientCapabilities.fromJson);
+    CallHierarchyClientCapabilities.canParse,
+    CallHierarchyClientCapabilities.fromJson,
+  );
 
-  CallHierarchyClientCapabilities({this.dynamicRegistration});
+  CallHierarchyClientCapabilities({
+    this.dynamicRegistration,
+  });
   static CallHierarchyClientCapabilities fromJson(Map<String, Object?> json) {
     final dynamicRegistrationJson = json['dynamicRegistration'];
     final dynamicRegistration = dynamicRegistrationJson as bool?;
     return CallHierarchyClientCapabilities(
-        dynamicRegistration: dynamicRegistration);
+      dynamicRegistration: dynamicRegistration,
+    );
   }
 
   /// Whether implementation supports dynamic registration. If this is set to
@@ -351,12 +388,13 @@
   /// capability as well.
   final bool? dynamicRegistration;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
+    var result = <String, Object?>{};
     if (dynamicRegistration != null) {
-      __result['dynamicRegistration'] = dynamicRegistration;
+      result['dynamicRegistration'] = dynamicRegistration;
     }
-    return __result;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -364,7 +402,7 @@
       reporter.push('dynamicRegistration');
       try {
         final dynamicRegistration = obj['dynamicRegistration'];
-        if (dynamicRegistration != null && !(dynamicRegistration is bool)) {
+        if (dynamicRegistration != null && dynamicRegistration is! bool) {
           reporter.reportError('must be of type bool');
           return false;
         }
@@ -396,9 +434,14 @@
 
 class CallHierarchyIncomingCall implements ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      CallHierarchyIncomingCall.canParse, CallHierarchyIncomingCall.fromJson);
+    CallHierarchyIncomingCall.canParse,
+    CallHierarchyIncomingCall.fromJson,
+  );
 
-  CallHierarchyIncomingCall({required this.from, required this.fromRanges});
+  CallHierarchyIncomingCall({
+    required this.from,
+    required this.fromRanges,
+  });
   static CallHierarchyIncomingCall fromJson(Map<String, Object?> json) {
     final fromJson = json['from'];
     final from = CallHierarchyItem.fromJson(fromJson as Map<String, Object?>);
@@ -406,7 +449,10 @@
     final fromRanges = (fromRangesJson as List<Object?>)
         .map((item) => Range.fromJson(item as Map<String, Object?>))
         .toList();
-    return CallHierarchyIncomingCall(from: from, fromRanges: fromRanges);
+    return CallHierarchyIncomingCall(
+      from: from,
+      fromRanges: fromRanges,
+    );
   }
 
   /// The item that makes the call.
@@ -416,11 +462,12 @@
   /// denoted by [`this.from`](#CallHierarchyIncomingCall.from).
   final List<Range> fromRanges;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['from'] = from.toJson();
-    __result['fromRanges'] = fromRanges.map((item) => item.toJson()).toList();
-    return __result;
+    var result = <String, Object?>{};
+    result['from'] = from.toJson();
+    result['fromRanges'] = fromRanges.map((item) => item.toJson()).toList();
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -436,7 +483,7 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(CallHierarchyItem.canParse(from, reporter))) {
+        if (!CallHierarchyItem.canParse(from, reporter)) {
           reporter.reportError('must be of type CallHierarchyItem');
           return false;
         }
@@ -454,8 +501,8 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!((fromRanges is List<Object?> &&
-            (fromRanges.every((item) => Range.canParse(item, reporter)))))) {
+        if (fromRanges is! List<Object?> ||
+            fromRanges.any((item) => !Range.canParse(item, reporter))) {
           reporter.reportError('must be of type List<Range>');
           return false;
         }
@@ -482,31 +529,30 @@
   }
 
   @override
-  int get hashCode => Object.hash(from, lspHashCode(fromRanges));
+  int get hashCode => Object.hash(
+        from,
+        lspHashCode(fromRanges),
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
 }
 
 class CallHierarchyIncomingCallsParams
-    implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
+    implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      CallHierarchyIncomingCallsParams.canParse,
-      CallHierarchyIncomingCallsParams.fromJson);
+    CallHierarchyIncomingCallsParams.canParse,
+    CallHierarchyIncomingCallsParams.fromJson,
+  );
 
-  CallHierarchyIncomingCallsParams(
-      {required this.item, this.workDoneToken, this.partialResultToken});
+  CallHierarchyIncomingCallsParams({
+    required this.item,
+    this.partialResultToken,
+    this.workDoneToken,
+  });
   static CallHierarchyIncomingCallsParams fromJson(Map<String, Object?> json) {
     final itemJson = json['item'];
     final item = CallHierarchyItem.fromJson(itemJson as Map<String, Object?>);
-    final workDoneTokenJson = json['workDoneToken'];
-    final workDoneToken = workDoneTokenJson == null
-        ? null
-        : (workDoneTokenJson is int
-            ? Either2<int, String>.t1(workDoneTokenJson)
-            : (workDoneTokenJson is String
-                ? Either2<int, String>.t2(workDoneTokenJson)
-                : (throw '''$workDoneTokenJson was not one of (int, String)''')));
     final partialResultTokenJson = json['partialResultToken'];
     final partialResultToken = partialResultTokenJson == null
         ? null
@@ -515,31 +561,43 @@
             : (partialResultTokenJson is String
                 ? Either2<int, String>.t2(partialResultTokenJson)
                 : (throw '''$partialResultTokenJson was not one of (int, String)''')));
+    final workDoneTokenJson = json['workDoneToken'];
+    final workDoneToken = workDoneTokenJson == null
+        ? null
+        : (workDoneTokenJson is int
+            ? Either2<int, String>.t1(workDoneTokenJson)
+            : (workDoneTokenJson is String
+                ? Either2<int, String>.t2(workDoneTokenJson)
+                : (throw '''$workDoneTokenJson was not one of (int, String)''')));
     return CallHierarchyIncomingCallsParams(
-        item: item,
-        workDoneToken: workDoneToken,
-        partialResultToken: partialResultToken);
+      item: item,
+      partialResultToken: partialResultToken,
+      workDoneToken: workDoneToken,
+    );
   }
 
   final CallHierarchyItem item;
 
   /// An optional token that a server can use to report partial results (e.g.
   /// streaming) to the client.
+  @override
   final Either2<int, String>? partialResultToken;
 
   /// An optional token that a server can use to report work done progress.
+  @override
   final Either2<int, String>? workDoneToken;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['item'] = item.toJson();
-    if (workDoneToken != null) {
-      __result['workDoneToken'] = workDoneToken;
-    }
+    var result = <String, Object?>{};
+    result['item'] = item.toJson();
     if (partialResultToken != null) {
-      __result['partialResultToken'] = partialResultToken;
+      result['partialResultToken'] = partialResultToken;
     }
-    return __result;
+    if (workDoneToken != null) {
+      result['workDoneToken'] = workDoneToken;
+    }
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -555,29 +613,31 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(CallHierarchyItem.canParse(item, reporter))) {
+        if (!CallHierarchyItem.canParse(item, reporter)) {
           reporter.reportError('must be of type CallHierarchyItem');
           return false;
         }
       } finally {
         reporter.pop();
       }
-      reporter.push('workDoneToken');
-      try {
-        final workDoneToken = obj['workDoneToken'];
-        if (workDoneToken != null &&
-            !((workDoneToken is int || workDoneToken is String))) {
-          reporter.reportError('must be of type Either2<int, String>');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       reporter.push('partialResultToken');
       try {
         final partialResultToken = obj['partialResultToken'];
         if (partialResultToken != null &&
-            !((partialResultToken is int || partialResultToken is String))) {
+            partialResultToken is! int &&
+            partialResultToken is! String) {
+          reporter.reportError('must be of type Either2<int, String>');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('workDoneToken');
+      try {
+        final workDoneToken = obj['workDoneToken'];
+        if (workDoneToken != null &&
+            workDoneToken is! int &&
+            workDoneToken is! String) {
           reporter.reportError('must be of type Either2<int, String>');
           return false;
         }
@@ -596,62 +656,70 @@
     if (other is CallHierarchyIncomingCallsParams &&
         other.runtimeType == CallHierarchyIncomingCallsParams) {
       return item == other.item &&
-          workDoneToken == other.workDoneToken &&
           partialResultToken == other.partialResultToken &&
+          workDoneToken == other.workDoneToken &&
           true;
     }
     return false;
   }
 
   @override
-  int get hashCode => Object.hash(item, workDoneToken, partialResultToken);
+  int get hashCode => Object.hash(
+        item,
+        partialResultToken,
+        workDoneToken,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
 }
 
 class CallHierarchyItem implements ToJsonable {
-  static const jsonHandler =
-      LspJsonHandler(CallHierarchyItem.canParse, CallHierarchyItem.fromJson);
+  static const jsonHandler = LspJsonHandler(
+    CallHierarchyItem.canParse,
+    CallHierarchyItem.fromJson,
+  );
 
-  CallHierarchyItem(
-      {required this.name,
-      required this.kind,
-      this.tags,
-      this.detail,
-      required this.uri,
-      required this.range,
-      required this.selectionRange,
-      this.data});
+  CallHierarchyItem({
+    this.data,
+    this.detail,
+    required this.kind,
+    required this.name,
+    required this.range,
+    required this.selectionRange,
+    this.tags,
+    required this.uri,
+  });
   static CallHierarchyItem fromJson(Map<String, Object?> json) {
-    final nameJson = json['name'];
-    final name = nameJson as String;
-    final kindJson = json['kind'];
-    final kind = SymbolKind.fromJson(kindJson as int);
-    final tagsJson = json['tags'];
-    final tags = (tagsJson as List<Object?>?)
-        ?.map((item) => SymbolTag.fromJson(item as int))
-        .toList();
+    final dataJson = json['data'];
+    final data = dataJson;
     final detailJson = json['detail'];
     final detail = detailJson as String?;
-    final uriJson = json['uri'];
-    final uri = uriJson as String;
+    final kindJson = json['kind'];
+    final kind = SymbolKind.fromJson(kindJson as int);
+    final nameJson = json['name'];
+    final name = nameJson as String;
     final rangeJson = json['range'];
     final range = Range.fromJson(rangeJson as Map<String, Object?>);
     final selectionRangeJson = json['selectionRange'];
     final selectionRange =
         Range.fromJson(selectionRangeJson as Map<String, Object?>);
-    final dataJson = json['data'];
-    final data = dataJson;
+    final tagsJson = json['tags'];
+    final tags = (tagsJson as List<Object?>?)
+        ?.map((item) => SymbolTag.fromJson(item as int))
+        .toList();
+    final uriJson = json['uri'];
+    final uri = uriJson as String;
     return CallHierarchyItem(
-        name: name,
-        kind: kind,
-        tags: tags,
-        detail: detail,
-        uri: uri,
-        range: range,
-        selectionRange: selectionRange,
-        data: data);
+      data: data,
+      detail: detail,
+      kind: kind,
+      name: name,
+      range: range,
+      selectionRange: selectionRange,
+      tags: tags,
+      uri: uri,
+    );
   }
 
   /// A data entry field that is preserved between a call hierarchy prepare and
@@ -682,39 +750,32 @@
   /// The resource identifier of this item.
   final String uri;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['name'] = name;
-    __result['kind'] = kind.toJson();
-    if (tags != null) {
-      __result['tags'] = tags?.map((item) => item.toJson()).toList();
+    var result = <String, Object?>{};
+    if (data != null) {
+      result['data'] = data;
     }
     if (detail != null) {
-      __result['detail'] = detail;
+      result['detail'] = detail;
     }
-    __result['uri'] = uri;
-    __result['range'] = range.toJson();
-    __result['selectionRange'] = selectionRange.toJson();
-    if (data != null) {
-      __result['data'] = data;
+    result['kind'] = kind.toJson();
+    result['name'] = name;
+    result['range'] = range.toJson();
+    result['selectionRange'] = selectionRange.toJson();
+    if (tags != null) {
+      result['tags'] = tags?.map((item) => item.toJson()).toList();
     }
-    return __result;
+    result['uri'] = uri;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
-      reporter.push('name');
+      reporter.push('detail');
       try {
-        if (!obj.containsKey('name')) {
-          reporter.reportError('must not be undefined');
-          return false;
-        }
-        final name = obj['name'];
-        if (name == null) {
-          reporter.reportError('must not be null');
-          return false;
-        }
-        if (!(name is String)) {
+        final detail = obj['detail'];
+        if (detail != null && detail is! String) {
           reporter.reportError('must be of type String');
           return false;
         }
@@ -732,47 +793,25 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(SymbolKind.canParse(kind, reporter))) {
+        if (!SymbolKind.canParse(kind, reporter)) {
           reporter.reportError('must be of type SymbolKind');
           return false;
         }
       } finally {
         reporter.pop();
       }
-      reporter.push('tags');
+      reporter.push('name');
       try {
-        final tags = obj['tags'];
-        if (tags != null &&
-            !((tags is List<Object?> &&
-                (tags.every((item) => SymbolTag.canParse(item, reporter)))))) {
-          reporter.reportError('must be of type List<SymbolTag>');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('detail');
-      try {
-        final detail = obj['detail'];
-        if (detail != null && !(detail is String)) {
-          reporter.reportError('must be of type String');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('uri');
-      try {
-        if (!obj.containsKey('uri')) {
+        if (!obj.containsKey('name')) {
           reporter.reportError('must not be undefined');
           return false;
         }
-        final uri = obj['uri'];
-        if (uri == null) {
+        final name = obj['name'];
+        if (name == null) {
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(uri is String)) {
+        if (name is! String) {
           reporter.reportError('must be of type String');
           return false;
         }
@@ -790,7 +829,7 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(Range.canParse(range, reporter))) {
+        if (!Range.canParse(range, reporter)) {
           reporter.reportError('must be of type Range');
           return false;
         }
@@ -808,13 +847,43 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(Range.canParse(selectionRange, reporter))) {
+        if (!Range.canParse(selectionRange, reporter)) {
           reporter.reportError('must be of type Range');
           return false;
         }
       } finally {
         reporter.pop();
       }
+      reporter.push('tags');
+      try {
+        final tags = obj['tags'];
+        if (tags != null &&
+            (tags is! List<Object?> ||
+                tags.any((item) => !SymbolTag.canParse(item, reporter)))) {
+          reporter.reportError('must be of type List<SymbolTag>');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('uri');
+      try {
+        if (!obj.containsKey('uri')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final uri = obj['uri'];
+        if (uri == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (uri is! String) {
+          reporter.reportError('must be of type String');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
       return true;
     } else {
       reporter.reportError('must be of type CallHierarchyItem');
@@ -825,14 +894,14 @@
   @override
   bool operator ==(Object other) {
     if (other is CallHierarchyItem && other.runtimeType == CallHierarchyItem) {
-      return name == other.name &&
-          kind == other.kind &&
-          listEqual(tags, other.tags, (SymbolTag a, SymbolTag b) => a == b) &&
+      return data == other.data &&
           detail == other.detail &&
-          uri == other.uri &&
+          kind == other.kind &&
+          name == other.name &&
           range == other.range &&
           selectionRange == other.selectionRange &&
-          data == other.data &&
+          listEqual(tags, other.tags, (SymbolTag a, SymbolTag b) => a == b) &&
+          uri == other.uri &&
           true;
     }
     return false;
@@ -840,7 +909,15 @@
 
   @override
   int get hashCode => Object.hash(
-      name, kind, lspHashCode(tags), detail, uri, range, selectionRange, data);
+        data,
+        detail,
+        kind,
+        name,
+        range,
+        selectionRange,
+        lspHashCode(tags),
+        uri,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
@@ -848,26 +925,34 @@
 
 class CallHierarchyOptions implements WorkDoneProgressOptions, ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      CallHierarchyOptions.canParse, CallHierarchyOptions.fromJson);
+    CallHierarchyOptions.canParse,
+    CallHierarchyOptions.fromJson,
+  );
 
-  CallHierarchyOptions({this.workDoneProgress});
+  CallHierarchyOptions({
+    this.workDoneProgress,
+  });
   static CallHierarchyOptions fromJson(Map<String, Object?> json) {
     if (CallHierarchyRegistrationOptions.canParse(json, nullLspJsonReporter)) {
       return CallHierarchyRegistrationOptions.fromJson(json);
     }
     final workDoneProgressJson = json['workDoneProgress'];
     final workDoneProgress = workDoneProgressJson as bool?;
-    return CallHierarchyOptions(workDoneProgress: workDoneProgress);
+    return CallHierarchyOptions(
+      workDoneProgress: workDoneProgress,
+    );
   }
 
+  @override
   final bool? workDoneProgress;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
+    var result = <String, Object?>{};
     if (workDoneProgress != null) {
-      __result['workDoneProgress'] = workDoneProgress;
+      result['workDoneProgress'] = workDoneProgress;
     }
-    return __result;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -875,7 +960,7 @@
       reporter.push('workDoneProgress');
       try {
         final workDoneProgress = obj['workDoneProgress'];
-        if (workDoneProgress != null && !(workDoneProgress is bool)) {
+        if (workDoneProgress != null && workDoneProgress is! bool) {
           reporter.reportError('must be of type bool');
           return false;
         }
@@ -907,17 +992,25 @@
 
 class CallHierarchyOutgoingCall implements ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      CallHierarchyOutgoingCall.canParse, CallHierarchyOutgoingCall.fromJson);
+    CallHierarchyOutgoingCall.canParse,
+    CallHierarchyOutgoingCall.fromJson,
+  );
 
-  CallHierarchyOutgoingCall({required this.to, required this.fromRanges});
+  CallHierarchyOutgoingCall({
+    required this.fromRanges,
+    required this.to,
+  });
   static CallHierarchyOutgoingCall fromJson(Map<String, Object?> json) {
-    final toJson = json['to'];
-    final to = CallHierarchyItem.fromJson(toJson as Map<String, Object?>);
     final fromRangesJson = json['fromRanges'];
     final fromRanges = (fromRangesJson as List<Object?>)
         .map((item) => Range.fromJson(item as Map<String, Object?>))
         .toList();
-    return CallHierarchyOutgoingCall(to: to, fromRanges: fromRanges);
+    final toJson = json['to'];
+    final to = CallHierarchyItem.fromJson(toJson as Map<String, Object?>);
+    return CallHierarchyOutgoingCall(
+      fromRanges: fromRanges,
+      to: to,
+    );
   }
 
   /// The range at which this item is called. This is the range relative to the
@@ -927,33 +1020,16 @@
   /// The item that is called.
   final CallHierarchyItem to;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['to'] = to.toJson();
-    __result['fromRanges'] = fromRanges.map((item) => item.toJson()).toList();
-    return __result;
+    var result = <String, Object?>{};
+    result['fromRanges'] = fromRanges.map((item) => item.toJson()).toList();
+    result['to'] = to.toJson();
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
-      reporter.push('to');
-      try {
-        if (!obj.containsKey('to')) {
-          reporter.reportError('must not be undefined');
-          return false;
-        }
-        final to = obj['to'];
-        if (to == null) {
-          reporter.reportError('must not be null');
-          return false;
-        }
-        if (!(CallHierarchyItem.canParse(to, reporter))) {
-          reporter.reportError('must be of type CallHierarchyItem');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       reporter.push('fromRanges');
       try {
         if (!obj.containsKey('fromRanges')) {
@@ -965,14 +1041,32 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!((fromRanges is List<Object?> &&
-            (fromRanges.every((item) => Range.canParse(item, reporter)))))) {
+        if (fromRanges is! List<Object?> ||
+            fromRanges.any((item) => !Range.canParse(item, reporter))) {
           reporter.reportError('must be of type List<Range>');
           return false;
         }
       } finally {
         reporter.pop();
       }
+      reporter.push('to');
+      try {
+        if (!obj.containsKey('to')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final to = obj['to'];
+        if (to == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (!CallHierarchyItem.canParse(to, reporter)) {
+          reporter.reportError('must be of type CallHierarchyItem');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
       return true;
     } else {
       reporter.reportError('must be of type CallHierarchyOutgoingCall');
@@ -984,40 +1078,39 @@
   bool operator ==(Object other) {
     if (other is CallHierarchyOutgoingCall &&
         other.runtimeType == CallHierarchyOutgoingCall) {
-      return to == other.to &&
-          listEqual(
+      return listEqual(
               fromRanges, other.fromRanges, (Range a, Range b) => a == b) &&
+          to == other.to &&
           true;
     }
     return false;
   }
 
   @override
-  int get hashCode => Object.hash(to, lspHashCode(fromRanges));
+  int get hashCode => Object.hash(
+        lspHashCode(fromRanges),
+        to,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
 }
 
 class CallHierarchyOutgoingCallsParams
-    implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
+    implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      CallHierarchyOutgoingCallsParams.canParse,
-      CallHierarchyOutgoingCallsParams.fromJson);
+    CallHierarchyOutgoingCallsParams.canParse,
+    CallHierarchyOutgoingCallsParams.fromJson,
+  );
 
-  CallHierarchyOutgoingCallsParams(
-      {required this.item, this.workDoneToken, this.partialResultToken});
+  CallHierarchyOutgoingCallsParams({
+    required this.item,
+    this.partialResultToken,
+    this.workDoneToken,
+  });
   static CallHierarchyOutgoingCallsParams fromJson(Map<String, Object?> json) {
     final itemJson = json['item'];
     final item = CallHierarchyItem.fromJson(itemJson as Map<String, Object?>);
-    final workDoneTokenJson = json['workDoneToken'];
-    final workDoneToken = workDoneTokenJson == null
-        ? null
-        : (workDoneTokenJson is int
-            ? Either2<int, String>.t1(workDoneTokenJson)
-            : (workDoneTokenJson is String
-                ? Either2<int, String>.t2(workDoneTokenJson)
-                : (throw '''$workDoneTokenJson was not one of (int, String)''')));
     final partialResultTokenJson = json['partialResultToken'];
     final partialResultToken = partialResultTokenJson == null
         ? null
@@ -1026,31 +1119,43 @@
             : (partialResultTokenJson is String
                 ? Either2<int, String>.t2(partialResultTokenJson)
                 : (throw '''$partialResultTokenJson was not one of (int, String)''')));
+    final workDoneTokenJson = json['workDoneToken'];
+    final workDoneToken = workDoneTokenJson == null
+        ? null
+        : (workDoneTokenJson is int
+            ? Either2<int, String>.t1(workDoneTokenJson)
+            : (workDoneTokenJson is String
+                ? Either2<int, String>.t2(workDoneTokenJson)
+                : (throw '''$workDoneTokenJson was not one of (int, String)''')));
     return CallHierarchyOutgoingCallsParams(
-        item: item,
-        workDoneToken: workDoneToken,
-        partialResultToken: partialResultToken);
+      item: item,
+      partialResultToken: partialResultToken,
+      workDoneToken: workDoneToken,
+    );
   }
 
   final CallHierarchyItem item;
 
   /// An optional token that a server can use to report partial results (e.g.
   /// streaming) to the client.
+  @override
   final Either2<int, String>? partialResultToken;
 
   /// An optional token that a server can use to report work done progress.
+  @override
   final Either2<int, String>? workDoneToken;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['item'] = item.toJson();
-    if (workDoneToken != null) {
-      __result['workDoneToken'] = workDoneToken;
-    }
+    var result = <String, Object?>{};
+    result['item'] = item.toJson();
     if (partialResultToken != null) {
-      __result['partialResultToken'] = partialResultToken;
+      result['partialResultToken'] = partialResultToken;
     }
-    return __result;
+    if (workDoneToken != null) {
+      result['workDoneToken'] = workDoneToken;
+    }
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -1066,29 +1171,31 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(CallHierarchyItem.canParse(item, reporter))) {
+        if (!CallHierarchyItem.canParse(item, reporter)) {
           reporter.reportError('must be of type CallHierarchyItem');
           return false;
         }
       } finally {
         reporter.pop();
       }
-      reporter.push('workDoneToken');
-      try {
-        final workDoneToken = obj['workDoneToken'];
-        if (workDoneToken != null &&
-            !((workDoneToken is int || workDoneToken is String))) {
-          reporter.reportError('must be of type Either2<int, String>');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       reporter.push('partialResultToken');
       try {
         final partialResultToken = obj['partialResultToken'];
         if (partialResultToken != null &&
-            !((partialResultToken is int || partialResultToken is String))) {
+            partialResultToken is! int &&
+            partialResultToken is! String) {
+          reporter.reportError('must be of type Either2<int, String>');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('workDoneToken');
+      try {
+        final workDoneToken = obj['workDoneToken'];
+        if (workDoneToken != null &&
+            workDoneToken is! int &&
+            workDoneToken is! String) {
           reporter.reportError('must be of type Either2<int, String>');
           return false;
         }
@@ -1107,15 +1214,19 @@
     if (other is CallHierarchyOutgoingCallsParams &&
         other.runtimeType == CallHierarchyOutgoingCallsParams) {
       return item == other.item &&
-          workDoneToken == other.workDoneToken &&
           partialResultToken == other.partialResultToken &&
+          workDoneToken == other.workDoneToken &&
           true;
     }
     return false;
   }
 
   @override
-  int get hashCode => Object.hash(item, workDoneToken, partialResultToken);
+  int get hashCode => Object.hash(
+        item,
+        partialResultToken,
+        workDoneToken,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
@@ -1124,16 +1235,21 @@
 class CallHierarchyPrepareParams
     implements TextDocumentPositionParams, WorkDoneProgressParams, ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      CallHierarchyPrepareParams.canParse, CallHierarchyPrepareParams.fromJson);
+    CallHierarchyPrepareParams.canParse,
+    CallHierarchyPrepareParams.fromJson,
+  );
 
-  CallHierarchyPrepareParams(
-      {required this.textDocument, required this.position, this.workDoneToken});
+  CallHierarchyPrepareParams({
+    required this.position,
+    required this.textDocument,
+    this.workDoneToken,
+  });
   static CallHierarchyPrepareParams fromJson(Map<String, Object?> json) {
+    final positionJson = json['position'];
+    final position = Position.fromJson(positionJson as Map<String, Object?>);
     final textDocumentJson = json['textDocument'];
     final textDocument = TextDocumentIdentifier.fromJson(
         textDocumentJson as Map<String, Object?>);
-    final positionJson = json['position'];
-    final position = Position.fromJson(positionJson as Map<String, Object?>);
     final workDoneTokenJson = json['workDoneToken'];
     final workDoneToken = workDoneTokenJson == null
         ? null
@@ -1143,50 +1259,37 @@
                 ? Either2<int, String>.t2(workDoneTokenJson)
                 : (throw '''$workDoneTokenJson was not one of (int, String)''')));
     return CallHierarchyPrepareParams(
-        textDocument: textDocument,
-        position: position,
-        workDoneToken: workDoneToken);
+      position: position,
+      textDocument: textDocument,
+      workDoneToken: workDoneToken,
+    );
   }
 
   /// The position inside the text document.
+  @override
   final Position position;
 
   /// The text document.
+  @override
   final TextDocumentIdentifier textDocument;
 
   /// An optional token that a server can use to report work done progress.
+  @override
   final Either2<int, String>? workDoneToken;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['textDocument'] = textDocument.toJson();
-    __result['position'] = position.toJson();
+    var result = <String, Object?>{};
+    result['position'] = position.toJson();
+    result['textDocument'] = textDocument.toJson();
     if (workDoneToken != null) {
-      __result['workDoneToken'] = workDoneToken;
+      result['workDoneToken'] = workDoneToken;
     }
-    return __result;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
-      reporter.push('textDocument');
-      try {
-        if (!obj.containsKey('textDocument')) {
-          reporter.reportError('must not be undefined');
-          return false;
-        }
-        final textDocument = obj['textDocument'];
-        if (textDocument == null) {
-          reporter.reportError('must not be null');
-          return false;
-        }
-        if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) {
-          reporter.reportError('must be of type TextDocumentIdentifier');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       reporter.push('position');
       try {
         if (!obj.containsKey('position')) {
@@ -1198,18 +1301,37 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(Position.canParse(position, reporter))) {
+        if (!Position.canParse(position, reporter)) {
           reporter.reportError('must be of type Position');
           return false;
         }
       } finally {
         reporter.pop();
       }
+      reporter.push('textDocument');
+      try {
+        if (!obj.containsKey('textDocument')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final textDocument = obj['textDocument'];
+        if (textDocument == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (!TextDocumentIdentifier.canParse(textDocument, reporter)) {
+          reporter.reportError('must be of type TextDocumentIdentifier');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
       reporter.push('workDoneToken');
       try {
         final workDoneToken = obj['workDoneToken'];
         if (workDoneToken != null &&
-            !((workDoneToken is int || workDoneToken is String))) {
+            workDoneToken is! int &&
+            workDoneToken is! String) {
           reporter.reportError('must be of type Either2<int, String>');
           return false;
         }
@@ -1227,8 +1349,8 @@
   bool operator ==(Object other) {
     if (other is CallHierarchyPrepareParams &&
         other.runtimeType == CallHierarchyPrepareParams) {
-      return textDocument == other.textDocument &&
-          position == other.position &&
+      return position == other.position &&
+          textDocument == other.textDocument &&
           workDoneToken == other.workDoneToken &&
           true;
     }
@@ -1236,7 +1358,11 @@
   }
 
   @override
-  int get hashCode => Object.hash(textDocument, position, workDoneToken);
+  int get hashCode => Object.hash(
+        position,
+        textDocument,
+        workDoneToken,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
@@ -1244,50 +1370,60 @@
 
 class CallHierarchyRegistrationOptions
     implements
-        TextDocumentRegistrationOptions,
         CallHierarchyOptions,
         StaticRegistrationOptions,
+        TextDocumentRegistrationOptions,
         ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      CallHierarchyRegistrationOptions.canParse,
-      CallHierarchyRegistrationOptions.fromJson);
+    CallHierarchyRegistrationOptions.canParse,
+    CallHierarchyRegistrationOptions.fromJson,
+  );
 
-  CallHierarchyRegistrationOptions(
-      {this.documentSelector, this.workDoneProgress, this.id});
+  CallHierarchyRegistrationOptions({
+    this.documentSelector,
+    this.id,
+    this.workDoneProgress,
+  });
   static CallHierarchyRegistrationOptions fromJson(Map<String, Object?> json) {
     final documentSelectorJson = json['documentSelector'];
     final documentSelector = (documentSelectorJson as List<Object?>?)
-        ?.map((item) => DocumentFilter.fromJson(item as Map<String, Object?>))
+        ?.map((item) =>
+            TextDocumentFilterWithScheme.fromJson(item as Map<String, Object?>))
         .toList();
-    final workDoneProgressJson = json['workDoneProgress'];
-    final workDoneProgress = workDoneProgressJson as bool?;
     final idJson = json['id'];
     final id = idJson as String?;
+    final workDoneProgressJson = json['workDoneProgress'];
+    final workDoneProgress = workDoneProgressJson as bool?;
     return CallHierarchyRegistrationOptions(
-        documentSelector: documentSelector,
-        workDoneProgress: workDoneProgress,
-        id: id);
+      documentSelector: documentSelector,
+      id: id,
+      workDoneProgress: workDoneProgress,
+    );
   }
 
   /// A document selector to identify the scope of the registration. If set to
   /// null the document selector provided on the client side will be used.
-  final List<DocumentFilter>? documentSelector;
+  @override
+  final List<TextDocumentFilterWithScheme>? documentSelector;
 
   /// The id used to register the request. The id can be used to deregister the
   /// request again. See also Registration#id.
+  @override
   final String? id;
+  @override
   final bool? workDoneProgress;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['documentSelector'] = documentSelector;
-    if (workDoneProgress != null) {
-      __result['workDoneProgress'] = workDoneProgress;
-    }
+    var result = <String, Object?>{};
+    result['documentSelector'] = documentSelector;
     if (id != null) {
-      __result['id'] = id;
+      result['id'] = id;
     }
-    return __result;
+    if (workDoneProgress != null) {
+      result['workDoneProgress'] = workDoneProgress;
+    }
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -1300,20 +1436,11 @@
         }
         final documentSelector = obj['documentSelector'];
         if (documentSelector != null &&
-            !((documentSelector is List<Object?> &&
-                (documentSelector.every(
-                    (item) => DocumentFilter.canParse(item, reporter)))))) {
-          reporter.reportError('must be of type List<DocumentFilter>');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('workDoneProgress');
-      try {
-        final workDoneProgress = obj['workDoneProgress'];
-        if (workDoneProgress != null && !(workDoneProgress is bool)) {
-          reporter.reportError('must be of type bool');
+            (documentSelector is! List<Object?> ||
+                documentSelector.any((item) =>
+                    !TextDocumentFilterWithScheme.canParse(item, reporter)))) {
+          reporter.reportError(
+              'must be of type List<TextDocumentFilterWithScheme>');
           return false;
         }
       } finally {
@@ -1322,13 +1449,23 @@
       reporter.push('id');
       try {
         final id = obj['id'];
-        if (id != null && !(id is String)) {
+        if (id != null && id is! String) {
           reporter.reportError('must be of type String');
           return false;
         }
       } finally {
         reporter.pop();
       }
+      reporter.push('workDoneProgress');
+      try {
+        final workDoneProgress = obj['workDoneProgress'];
+        if (workDoneProgress != null && workDoneProgress is! bool) {
+          reporter.reportError('must be of type bool');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
       return true;
     } else {
       reporter.reportError('must be of type CallHierarchyRegistrationOptions');
@@ -1340,28 +1477,39 @@
   bool operator ==(Object other) {
     if (other is CallHierarchyRegistrationOptions &&
         other.runtimeType == CallHierarchyRegistrationOptions) {
-      return listEqual(documentSelector, other.documentSelector,
-              (DocumentFilter a, DocumentFilter b) => a == b) &&
-          workDoneProgress == other.workDoneProgress &&
+      return listEqual(
+              documentSelector,
+              other.documentSelector,
+              (TextDocumentFilterWithScheme a,
+                      TextDocumentFilterWithScheme b) =>
+                  a == b) &&
           id == other.id &&
+          workDoneProgress == other.workDoneProgress &&
           true;
     }
     return false;
   }
 
   @override
-  int get hashCode =>
-      Object.hash(lspHashCode(documentSelector), workDoneProgress, id);
+  int get hashCode => Object.hash(
+        lspHashCode(documentSelector),
+        id,
+        workDoneProgress,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
 }
 
 class CancelParams implements ToJsonable {
-  static const jsonHandler =
-      LspJsonHandler(CancelParams.canParse, CancelParams.fromJson);
+  static const jsonHandler = LspJsonHandler(
+    CancelParams.canParse,
+    CancelParams.fromJson,
+  );
 
-  CancelParams({required this.id});
+  CancelParams({
+    required this.id,
+  });
   static CancelParams fromJson(Map<String, Object?> json) {
     final idJson = json['id'];
     final id = idJson is int
@@ -1369,16 +1517,19 @@
         : (idJson is String
             ? Either2<int, String>.t2(idJson)
             : (throw '''$idJson was not one of (int, String)'''));
-    return CancelParams(id: id);
+    return CancelParams(
+      id: id,
+    );
   }
 
   /// The request id to cancel.
   final Either2<int, String> id;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['id'] = id;
-    return __result;
+    var result = <String, Object?>{};
+    result['id'] = id;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -1394,7 +1545,7 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!((id is int || id is String))) {
+        if (id is! int && id is! String) {
           reporter.reportError('must be of type Either2<int, String>');
           return false;
         }
@@ -1426,22 +1577,28 @@
 /// Additional information that describes document changes.
 ///  @since 3.16.0
 class ChangeAnnotation implements ToJsonable {
-  static const jsonHandler =
-      LspJsonHandler(ChangeAnnotation.canParse, ChangeAnnotation.fromJson);
+  static const jsonHandler = LspJsonHandler(
+    ChangeAnnotation.canParse,
+    ChangeAnnotation.fromJson,
+  );
 
-  ChangeAnnotation(
-      {required this.label, this.needsConfirmation, this.description});
+  ChangeAnnotation({
+    this.description,
+    required this.label,
+    this.needsConfirmation,
+  });
   static ChangeAnnotation fromJson(Map<String, Object?> json) {
+    final descriptionJson = json['description'];
+    final description = descriptionJson as String?;
     final labelJson = json['label'];
     final label = labelJson as String;
     final needsConfirmationJson = json['needsConfirmation'];
     final needsConfirmation = needsConfirmationJson as bool?;
-    final descriptionJson = json['description'];
-    final description = descriptionJson as String?;
     return ChangeAnnotation(
-        label: label,
-        needsConfirmation: needsConfirmation,
-        description: description);
+      description: description,
+      label: label,
+      needsConfirmation: needsConfirmation,
+    );
   }
 
   /// A human-readable string which is rendered less prominent in the user
@@ -1456,20 +1613,31 @@
   /// the change.
   final bool? needsConfirmation;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['label'] = label;
-    if (needsConfirmation != null) {
-      __result['needsConfirmation'] = needsConfirmation;
-    }
+    var result = <String, Object?>{};
     if (description != null) {
-      __result['description'] = description;
+      result['description'] = description;
     }
-    return __result;
+    result['label'] = label;
+    if (needsConfirmation != null) {
+      result['needsConfirmation'] = needsConfirmation;
+    }
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
+      reporter.push('description');
+      try {
+        final description = obj['description'];
+        if (description != null && description is! String) {
+          reporter.reportError('must be of type String');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
       reporter.push('label');
       try {
         if (!obj.containsKey('label')) {
@@ -1481,7 +1649,7 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(label is String)) {
+        if (label is! String) {
           reporter.reportError('must be of type String');
           return false;
         }
@@ -1491,23 +1659,13 @@
       reporter.push('needsConfirmation');
       try {
         final needsConfirmation = obj['needsConfirmation'];
-        if (needsConfirmation != null && !(needsConfirmation is bool)) {
+        if (needsConfirmation != null && needsConfirmation is! bool) {
           reporter.reportError('must be of type bool');
           return false;
         }
       } finally {
         reporter.pop();
       }
-      reporter.push('description');
-      try {
-        final description = obj['description'];
-        if (description != null && !(description is String)) {
-          reporter.reportError('must be of type String');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       return true;
     } else {
       reporter.reportError('must be of type ChangeAnnotation');
@@ -1518,36 +1676,51 @@
   @override
   bool operator ==(Object other) {
     if (other is ChangeAnnotation && other.runtimeType == ChangeAnnotation) {
-      return label == other.label &&
+      return description == other.description &&
+          label == other.label &&
           needsConfirmation == other.needsConfirmation &&
-          description == other.description &&
           true;
     }
     return false;
   }
 
   @override
-  int get hashCode => Object.hash(label, needsConfirmation, description);
+  int get hashCode => Object.hash(
+        description,
+        label,
+        needsConfirmation,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
 }
 
 class ClientCapabilities implements ToJsonable {
-  static const jsonHandler =
-      LspJsonHandler(ClientCapabilities.canParse, ClientCapabilities.fromJson);
+  static const jsonHandler = LspJsonHandler(
+    ClientCapabilities.canParse,
+    ClientCapabilities.fromJson,
+  );
 
-  ClientCapabilities(
-      {this.workspace,
-      this.textDocument,
-      this.window,
-      this.general,
-      this.experimental});
+  ClientCapabilities({
+    this.experimental,
+    this.general,
+    this.notebookDocument,
+    this.textDocument,
+    this.window,
+    this.workspace,
+  });
   static ClientCapabilities fromJson(Map<String, Object?> json) {
-    final workspaceJson = json['workspace'];
-    final workspace = workspaceJson != null
-        ? ClientCapabilitiesWorkspace.fromJson(
-            workspaceJson as Map<String, Object?>)
+    final experimentalJson = json['experimental'];
+    final experimental = experimentalJson;
+    final generalJson = json['general'];
+    final general = generalJson != null
+        ? GeneralClientCapabilities.fromJson(
+            generalJson as Map<String, Object?>)
+        : null;
+    final notebookDocumentJson = json['notebookDocument'];
+    final notebookDocument = notebookDocumentJson != null
+        ? NotebookDocumentClientCapabilities.fromJson(
+            notebookDocumentJson as Map<String, Object?>)
         : null;
     final textDocumentJson = json['textDocument'];
     final textDocument = textDocumentJson != null
@@ -1556,21 +1729,21 @@
         : null;
     final windowJson = json['window'];
     final window = windowJson != null
-        ? ClientCapabilitiesWindow.fromJson(windowJson as Map<String, Object?>)
+        ? WindowClientCapabilities.fromJson(windowJson as Map<String, Object?>)
         : null;
-    final generalJson = json['general'];
-    final general = generalJson != null
-        ? ClientCapabilitiesGeneral.fromJson(
-            generalJson as Map<String, Object?>)
+    final workspaceJson = json['workspace'];
+    final workspace = workspaceJson != null
+        ? WorkspaceClientCapabilities.fromJson(
+            workspaceJson as Map<String, Object?>)
         : null;
-    final experimentalJson = json['experimental'];
-    final experimental = experimentalJson;
     return ClientCapabilities(
-        workspace: workspace,
-        textDocument: textDocument,
-        window: window,
-        general: general,
-        experimental: experimental);
+      experimental: experimental,
+      general: general,
+      notebookDocument: notebookDocument,
+      textDocument: textDocument,
+      window: window,
+      workspace: workspace,
+    );
   }
 
   /// Experimental client capabilities.
@@ -1578,45 +1751,66 @@
 
   /// General client capabilities.
   ///  @since 3.16.0
-  final ClientCapabilitiesGeneral? general;
+  final GeneralClientCapabilities? general;
+
+  /// Capabilities specific to the notebook document support.
+  ///  @since 3.17.0
+  final NotebookDocumentClientCapabilities? notebookDocument;
 
   /// Text document specific client capabilities.
   final TextDocumentClientCapabilities? textDocument;
 
   /// Window specific client capabilities.
-  final ClientCapabilitiesWindow? window;
+  final WindowClientCapabilities? window;
 
   /// Workspace specific client capabilities.
-  final ClientCapabilitiesWorkspace? workspace;
+  final WorkspaceClientCapabilities? workspace;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    if (workspace != null) {
-      __result['workspace'] = workspace?.toJson();
-    }
-    if (textDocument != null) {
-      __result['textDocument'] = textDocument?.toJson();
-    }
-    if (window != null) {
-      __result['window'] = window?.toJson();
+    var result = <String, Object?>{};
+    if (experimental != null) {
+      result['experimental'] = experimental;
     }
     if (general != null) {
-      __result['general'] = general?.toJson();
+      result['general'] = general?.toJson();
     }
-    if (experimental != null) {
-      __result['experimental'] = experimental;
+    if (notebookDocument != null) {
+      result['notebookDocument'] = notebookDocument?.toJson();
     }
-    return __result;
+    if (textDocument != null) {
+      result['textDocument'] = textDocument?.toJson();
+    }
+    if (window != null) {
+      result['window'] = window?.toJson();
+    }
+    if (workspace != null) {
+      result['workspace'] = workspace?.toJson();
+    }
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
-      reporter.push('workspace');
+      reporter.push('general');
       try {
-        final workspace = obj['workspace'];
-        if (workspace != null &&
-            !(ClientCapabilitiesWorkspace.canParse(workspace, reporter))) {
-          reporter.reportError('must be of type ClientCapabilitiesWorkspace');
+        final general = obj['general'];
+        if (general != null &&
+            !GeneralClientCapabilities.canParse(general, reporter)) {
+          reporter.reportError('must be of type GeneralClientCapabilities');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('notebookDocument');
+      try {
+        final notebookDocument = obj['notebookDocument'];
+        if (notebookDocument != null &&
+            !NotebookDocumentClientCapabilities.canParse(
+                notebookDocument, reporter)) {
+          reporter.reportError(
+              'must be of type NotebookDocumentClientCapabilities');
           return false;
         }
       } finally {
@@ -1626,8 +1820,7 @@
       try {
         final textDocument = obj['textDocument'];
         if (textDocument != null &&
-            !(TextDocumentClientCapabilities.canParse(
-                textDocument, reporter))) {
+            !TextDocumentClientCapabilities.canParse(textDocument, reporter)) {
           reporter
               .reportError('must be of type TextDocumentClientCapabilities');
           return false;
@@ -1639,19 +1832,19 @@
       try {
         final window = obj['window'];
         if (window != null &&
-            !(ClientCapabilitiesWindow.canParse(window, reporter))) {
-          reporter.reportError('must be of type ClientCapabilitiesWindow');
+            !WindowClientCapabilities.canParse(window, reporter)) {
+          reporter.reportError('must be of type WindowClientCapabilities');
           return false;
         }
       } finally {
         reporter.pop();
       }
-      reporter.push('general');
+      reporter.push('workspace');
       try {
-        final general = obj['general'];
-        if (general != null &&
-            !(ClientCapabilitiesGeneral.canParse(general, reporter))) {
-          reporter.reportError('must be of type ClientCapabilitiesGeneral');
+        final workspace = obj['workspace'];
+        if (workspace != null &&
+            !WorkspaceClientCapabilities.canParse(workspace, reporter)) {
+          reporter.reportError('must be of type WorkspaceClientCapabilities');
           return false;
         }
       } finally {
@@ -1668,735 +1861,12 @@
   bool operator ==(Object other) {
     if (other is ClientCapabilities &&
         other.runtimeType == ClientCapabilities) {
-      return workspace == other.workspace &&
+      return experimental == other.experimental &&
+          general == other.general &&
+          notebookDocument == other.notebookDocument &&
           textDocument == other.textDocument &&
           window == other.window &&
-          general == other.general &&
-          experimental == other.experimental &&
-          true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode =>
-      Object.hash(workspace, textDocument, window, general, experimental);
-
-  @override
-  String toString() => jsonEncoder.convert(toJson());
-}
-
-class ClientCapabilitiesFileOperations implements ToJsonable {
-  static const jsonHandler = LspJsonHandler(
-      ClientCapabilitiesFileOperations.canParse,
-      ClientCapabilitiesFileOperations.fromJson);
-
-  ClientCapabilitiesFileOperations(
-      {this.dynamicRegistration,
-      this.didCreate,
-      this.willCreate,
-      this.didRename,
-      this.willRename,
-      this.didDelete,
-      this.willDelete});
-  static ClientCapabilitiesFileOperations fromJson(Map<String, Object?> json) {
-    final dynamicRegistrationJson = json['dynamicRegistration'];
-    final dynamicRegistration = dynamicRegistrationJson as bool?;
-    final didCreateJson = json['didCreate'];
-    final didCreate = didCreateJson as bool?;
-    final willCreateJson = json['willCreate'];
-    final willCreate = willCreateJson as bool?;
-    final didRenameJson = json['didRename'];
-    final didRename = didRenameJson as bool?;
-    final willRenameJson = json['willRename'];
-    final willRename = willRenameJson as bool?;
-    final didDeleteJson = json['didDelete'];
-    final didDelete = didDeleteJson as bool?;
-    final willDeleteJson = json['willDelete'];
-    final willDelete = willDeleteJson as bool?;
-    return ClientCapabilitiesFileOperations(
-        dynamicRegistration: dynamicRegistration,
-        didCreate: didCreate,
-        willCreate: willCreate,
-        didRename: didRename,
-        willRename: willRename,
-        didDelete: didDelete,
-        willDelete: willDelete);
-  }
-
-  /// The client has support for sending didCreateFiles notifications.
-  final bool? didCreate;
-
-  /// The client has support for sending didDeleteFiles notifications.
-  final bool? didDelete;
-
-  /// The client has support for sending didRenameFiles notifications.
-  final bool? didRename;
-
-  /// Whether the client supports dynamic registration for file
-  /// requests/notifications.
-  final bool? dynamicRegistration;
-
-  /// The client has support for sending willCreateFiles requests.
-  final bool? willCreate;
-
-  /// The client has support for sending willDeleteFiles requests.
-  final bool? willDelete;
-
-  /// The client has support for sending willRenameFiles requests.
-  final bool? willRename;
-
-  Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    if (dynamicRegistration != null) {
-      __result['dynamicRegistration'] = dynamicRegistration;
-    }
-    if (didCreate != null) {
-      __result['didCreate'] = didCreate;
-    }
-    if (willCreate != null) {
-      __result['willCreate'] = willCreate;
-    }
-    if (didRename != null) {
-      __result['didRename'] = didRename;
-    }
-    if (willRename != null) {
-      __result['willRename'] = willRename;
-    }
-    if (didDelete != null) {
-      __result['didDelete'] = didDelete;
-    }
-    if (willDelete != null) {
-      __result['willDelete'] = willDelete;
-    }
-    return __result;
-  }
-
-  static bool canParse(Object? obj, LspJsonReporter reporter) {
-    if (obj is Map<String, Object?>) {
-      reporter.push('dynamicRegistration');
-      try {
-        final dynamicRegistration = obj['dynamicRegistration'];
-        if (dynamicRegistration != null && !(dynamicRegistration is bool)) {
-          reporter.reportError('must be of type bool');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('didCreate');
-      try {
-        final didCreate = obj['didCreate'];
-        if (didCreate != null && !(didCreate is bool)) {
-          reporter.reportError('must be of type bool');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('willCreate');
-      try {
-        final willCreate = obj['willCreate'];
-        if (willCreate != null && !(willCreate is bool)) {
-          reporter.reportError('must be of type bool');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('didRename');
-      try {
-        final didRename = obj['didRename'];
-        if (didRename != null && !(didRename is bool)) {
-          reporter.reportError('must be of type bool');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('willRename');
-      try {
-        final willRename = obj['willRename'];
-        if (willRename != null && !(willRename is bool)) {
-          reporter.reportError('must be of type bool');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('didDelete');
-      try {
-        final didDelete = obj['didDelete'];
-        if (didDelete != null && !(didDelete is bool)) {
-          reporter.reportError('must be of type bool');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('willDelete');
-      try {
-        final willDelete = obj['willDelete'];
-        if (willDelete != null && !(willDelete is bool)) {
-          reporter.reportError('must be of type bool');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      return true;
-    } else {
-      reporter.reportError('must be of type ClientCapabilitiesFileOperations');
-      return false;
-    }
-  }
-
-  @override
-  bool operator ==(Object other) {
-    if (other is ClientCapabilitiesFileOperations &&
-        other.runtimeType == ClientCapabilitiesFileOperations) {
-      return dynamicRegistration == other.dynamicRegistration &&
-          didCreate == other.didCreate &&
-          willCreate == other.willCreate &&
-          didRename == other.didRename &&
-          willRename == other.willRename &&
-          didDelete == other.didDelete &&
-          willDelete == other.willDelete &&
-          true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode => Object.hash(dynamicRegistration, didCreate, willCreate,
-      didRename, willRename, didDelete, willDelete);
-
-  @override
-  String toString() => jsonEncoder.convert(toJson());
-}
-
-class ClientCapabilitiesGeneral implements ToJsonable {
-  static const jsonHandler = LspJsonHandler(
-      ClientCapabilitiesGeneral.canParse, ClientCapabilitiesGeneral.fromJson);
-
-  ClientCapabilitiesGeneral({this.regularExpressions, this.markdown});
-  static ClientCapabilitiesGeneral fromJson(Map<String, Object?> json) {
-    final regularExpressionsJson = json['regularExpressions'];
-    final regularExpressions = regularExpressionsJson != null
-        ? RegularExpressionsClientCapabilities.fromJson(
-            regularExpressionsJson as Map<String, Object?>)
-        : null;
-    final markdownJson = json['markdown'];
-    final markdown = markdownJson != null
-        ? MarkdownClientCapabilities.fromJson(
-            markdownJson as Map<String, Object?>)
-        : null;
-    return ClientCapabilitiesGeneral(
-        regularExpressions: regularExpressions, markdown: markdown);
-  }
-
-  /// Client capabilities specific to the client's markdown parser.
-  ///  @since 3.16.0
-  final MarkdownClientCapabilities? markdown;
-
-  /// Client capabilities specific to regular expressions.
-  ///  @since 3.16.0
-  final RegularExpressionsClientCapabilities? regularExpressions;
-
-  Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    if (regularExpressions != null) {
-      __result['regularExpressions'] = regularExpressions?.toJson();
-    }
-    if (markdown != null) {
-      __result['markdown'] = markdown?.toJson();
-    }
-    return __result;
-  }
-
-  static bool canParse(Object? obj, LspJsonReporter reporter) {
-    if (obj is Map<String, Object?>) {
-      reporter.push('regularExpressions');
-      try {
-        final regularExpressions = obj['regularExpressions'];
-        if (regularExpressions != null &&
-            !(RegularExpressionsClientCapabilities.canParse(
-                regularExpressions, reporter))) {
-          reporter.reportError(
-              'must be of type RegularExpressionsClientCapabilities');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('markdown');
-      try {
-        final markdown = obj['markdown'];
-        if (markdown != null &&
-            !(MarkdownClientCapabilities.canParse(markdown, reporter))) {
-          reporter.reportError('must be of type MarkdownClientCapabilities');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      return true;
-    } else {
-      reporter.reportError('must be of type ClientCapabilitiesGeneral');
-      return false;
-    }
-  }
-
-  @override
-  bool operator ==(Object other) {
-    if (other is ClientCapabilitiesGeneral &&
-        other.runtimeType == ClientCapabilitiesGeneral) {
-      return regularExpressions == other.regularExpressions &&
-          markdown == other.markdown &&
-          true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode => Object.hash(regularExpressions, markdown);
-
-  @override
-  String toString() => jsonEncoder.convert(toJson());
-}
-
-class ClientCapabilitiesWindow implements ToJsonable {
-  static const jsonHandler = LspJsonHandler(
-      ClientCapabilitiesWindow.canParse, ClientCapabilitiesWindow.fromJson);
-
-  ClientCapabilitiesWindow(
-      {this.workDoneProgress, this.showMessage, this.showDocument});
-  static ClientCapabilitiesWindow fromJson(Map<String, Object?> json) {
-    final workDoneProgressJson = json['workDoneProgress'];
-    final workDoneProgress = workDoneProgressJson as bool?;
-    final showMessageJson = json['showMessage'];
-    final showMessage = showMessageJson != null
-        ? ShowMessageRequestClientCapabilities.fromJson(
-            showMessageJson as Map<String, Object?>)
-        : null;
-    final showDocumentJson = json['showDocument'];
-    final showDocument = showDocumentJson != null
-        ? ShowDocumentClientCapabilities.fromJson(
-            showDocumentJson as Map<String, Object?>)
-        : null;
-    return ClientCapabilitiesWindow(
-        workDoneProgress: workDoneProgress,
-        showMessage: showMessage,
-        showDocument: showDocument);
-  }
-
-  /// Client capabilities for the show document request.
-  ///  @since 3.16.0
-  final ShowDocumentClientCapabilities? showDocument;
-
-  /// Capabilities specific to the showMessage request
-  ///  @since 3.16.0
-  final ShowMessageRequestClientCapabilities? showMessage;
-
-  /// Whether client supports handling progress notifications. If set servers
-  /// are allowed to report in `workDoneProgress` property in the request
-  /// specific server capabilities.
-  ///  @since 3.15.0
-  final bool? workDoneProgress;
-
-  Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    if (workDoneProgress != null) {
-      __result['workDoneProgress'] = workDoneProgress;
-    }
-    if (showMessage != null) {
-      __result['showMessage'] = showMessage?.toJson();
-    }
-    if (showDocument != null) {
-      __result['showDocument'] = showDocument?.toJson();
-    }
-    return __result;
-  }
-
-  static bool canParse(Object? obj, LspJsonReporter reporter) {
-    if (obj is Map<String, Object?>) {
-      reporter.push('workDoneProgress');
-      try {
-        final workDoneProgress = obj['workDoneProgress'];
-        if (workDoneProgress != null && !(workDoneProgress is bool)) {
-          reporter.reportError('must be of type bool');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('showMessage');
-      try {
-        final showMessage = obj['showMessage'];
-        if (showMessage != null &&
-            !(ShowMessageRequestClientCapabilities.canParse(
-                showMessage, reporter))) {
-          reporter.reportError(
-              'must be of type ShowMessageRequestClientCapabilities');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('showDocument');
-      try {
-        final showDocument = obj['showDocument'];
-        if (showDocument != null &&
-            !(ShowDocumentClientCapabilities.canParse(
-                showDocument, reporter))) {
-          reporter
-              .reportError('must be of type ShowDocumentClientCapabilities');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      return true;
-    } else {
-      reporter.reportError('must be of type ClientCapabilitiesWindow');
-      return false;
-    }
-  }
-
-  @override
-  bool operator ==(Object other) {
-    if (other is ClientCapabilitiesWindow &&
-        other.runtimeType == ClientCapabilitiesWindow) {
-      return workDoneProgress == other.workDoneProgress &&
-          showMessage == other.showMessage &&
-          showDocument == other.showDocument &&
-          true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode => Object.hash(workDoneProgress, showMessage, showDocument);
-
-  @override
-  String toString() => jsonEncoder.convert(toJson());
-}
-
-class ClientCapabilitiesWorkspace implements ToJsonable {
-  static const jsonHandler = LspJsonHandler(
-      ClientCapabilitiesWorkspace.canParse,
-      ClientCapabilitiesWorkspace.fromJson);
-
-  ClientCapabilitiesWorkspace(
-      {this.applyEdit,
-      this.workspaceEdit,
-      this.didChangeConfiguration,
-      this.didChangeWatchedFiles,
-      this.symbol,
-      this.executeCommand,
-      this.workspaceFolders,
-      this.configuration,
-      this.semanticTokens,
-      this.codeLens,
-      this.fileOperations});
-  static ClientCapabilitiesWorkspace fromJson(Map<String, Object?> json) {
-    final applyEditJson = json['applyEdit'];
-    final applyEdit = applyEditJson as bool?;
-    final workspaceEditJson = json['workspaceEdit'];
-    final workspaceEdit = workspaceEditJson != null
-        ? WorkspaceEditClientCapabilities.fromJson(
-            workspaceEditJson as Map<String, Object?>)
-        : null;
-    final didChangeConfigurationJson = json['didChangeConfiguration'];
-    final didChangeConfiguration = didChangeConfigurationJson != null
-        ? DidChangeConfigurationClientCapabilities.fromJson(
-            didChangeConfigurationJson as Map<String, Object?>)
-        : null;
-    final didChangeWatchedFilesJson = json['didChangeWatchedFiles'];
-    final didChangeWatchedFiles = didChangeWatchedFilesJson != null
-        ? DidChangeWatchedFilesClientCapabilities.fromJson(
-            didChangeWatchedFilesJson as Map<String, Object?>)
-        : null;
-    final symbolJson = json['symbol'];
-    final symbol = symbolJson != null
-        ? WorkspaceSymbolClientCapabilities.fromJson(
-            symbolJson as Map<String, Object?>)
-        : null;
-    final executeCommandJson = json['executeCommand'];
-    final executeCommand = executeCommandJson != null
-        ? ExecuteCommandClientCapabilities.fromJson(
-            executeCommandJson as Map<String, Object?>)
-        : null;
-    final workspaceFoldersJson = json['workspaceFolders'];
-    final workspaceFolders = workspaceFoldersJson as bool?;
-    final configurationJson = json['configuration'];
-    final configuration = configurationJson as bool?;
-    final semanticTokensJson = json['semanticTokens'];
-    final semanticTokens = semanticTokensJson != null
-        ? SemanticTokensWorkspaceClientCapabilities.fromJson(
-            semanticTokensJson as Map<String, Object?>)
-        : null;
-    final codeLensJson = json['codeLens'];
-    final codeLens = codeLensJson != null
-        ? CodeLensWorkspaceClientCapabilities.fromJson(
-            codeLensJson as Map<String, Object?>)
-        : null;
-    final fileOperationsJson = json['fileOperations'];
-    final fileOperations = fileOperationsJson != null
-        ? ClientCapabilitiesFileOperations.fromJson(
-            fileOperationsJson as Map<String, Object?>)
-        : null;
-    return ClientCapabilitiesWorkspace(
-        applyEdit: applyEdit,
-        workspaceEdit: workspaceEdit,
-        didChangeConfiguration: didChangeConfiguration,
-        didChangeWatchedFiles: didChangeWatchedFiles,
-        symbol: symbol,
-        executeCommand: executeCommand,
-        workspaceFolders: workspaceFolders,
-        configuration: configuration,
-        semanticTokens: semanticTokens,
-        codeLens: codeLens,
-        fileOperations: fileOperations);
-  }
-
-  /// The client supports applying batch edits to the workspace by supporting
-  /// the request 'workspace/applyEdit'
-  final bool? applyEdit;
-
-  /// Capabilities specific to the code lens requests scoped to the workspace.
-  ///  @since 3.16.0
-  final CodeLensWorkspaceClientCapabilities? codeLens;
-
-  /// The client supports `workspace/configuration` requests.
-  ///  @since 3.6.0
-  final bool? configuration;
-
-  /// Capabilities specific to the `workspace/didChangeConfiguration`
-  /// notification.
-  final DidChangeConfigurationClientCapabilities? didChangeConfiguration;
-
-  /// Capabilities specific to the `workspace/didChangeWatchedFiles`
-  /// notification.
-  final DidChangeWatchedFilesClientCapabilities? didChangeWatchedFiles;
-
-  /// Capabilities specific to the `workspace/executeCommand` request.
-  final ExecuteCommandClientCapabilities? executeCommand;
-
-  /// The client has support for file requests/notifications.
-  ///  @since 3.16.0
-  final ClientCapabilitiesFileOperations? fileOperations;
-
-  /// Capabilities specific to the semantic token requests scoped to the
-  /// workspace.
-  ///  @since 3.16.0
-  final SemanticTokensWorkspaceClientCapabilities? semanticTokens;
-
-  /// Capabilities specific to the `workspace/symbol` request.
-  final WorkspaceSymbolClientCapabilities? symbol;
-
-  /// Capabilities specific to `WorkspaceEdit`s
-  final WorkspaceEditClientCapabilities? workspaceEdit;
-
-  /// The client has support for workspace folders.
-  ///  @since 3.6.0
-  final bool? workspaceFolders;
-
-  Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    if (applyEdit != null) {
-      __result['applyEdit'] = applyEdit;
-    }
-    if (workspaceEdit != null) {
-      __result['workspaceEdit'] = workspaceEdit?.toJson();
-    }
-    if (didChangeConfiguration != null) {
-      __result['didChangeConfiguration'] = didChangeConfiguration?.toJson();
-    }
-    if (didChangeWatchedFiles != null) {
-      __result['didChangeWatchedFiles'] = didChangeWatchedFiles?.toJson();
-    }
-    if (symbol != null) {
-      __result['symbol'] = symbol?.toJson();
-    }
-    if (executeCommand != null) {
-      __result['executeCommand'] = executeCommand?.toJson();
-    }
-    if (workspaceFolders != null) {
-      __result['workspaceFolders'] = workspaceFolders;
-    }
-    if (configuration != null) {
-      __result['configuration'] = configuration;
-    }
-    if (semanticTokens != null) {
-      __result['semanticTokens'] = semanticTokens?.toJson();
-    }
-    if (codeLens != null) {
-      __result['codeLens'] = codeLens?.toJson();
-    }
-    if (fileOperations != null) {
-      __result['fileOperations'] = fileOperations?.toJson();
-    }
-    return __result;
-  }
-
-  static bool canParse(Object? obj, LspJsonReporter reporter) {
-    if (obj is Map<String, Object?>) {
-      reporter.push('applyEdit');
-      try {
-        final applyEdit = obj['applyEdit'];
-        if (applyEdit != null && !(applyEdit is bool)) {
-          reporter.reportError('must be of type bool');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('workspaceEdit');
-      try {
-        final workspaceEdit = obj['workspaceEdit'];
-        if (workspaceEdit != null &&
-            !(WorkspaceEditClientCapabilities.canParse(
-                workspaceEdit, reporter))) {
-          reporter
-              .reportError('must be of type WorkspaceEditClientCapabilities');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('didChangeConfiguration');
-      try {
-        final didChangeConfiguration = obj['didChangeConfiguration'];
-        if (didChangeConfiguration != null &&
-            !(DidChangeConfigurationClientCapabilities.canParse(
-                didChangeConfiguration, reporter))) {
-          reporter.reportError(
-              'must be of type DidChangeConfigurationClientCapabilities');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('didChangeWatchedFiles');
-      try {
-        final didChangeWatchedFiles = obj['didChangeWatchedFiles'];
-        if (didChangeWatchedFiles != null &&
-            !(DidChangeWatchedFilesClientCapabilities.canParse(
-                didChangeWatchedFiles, reporter))) {
-          reporter.reportError(
-              'must be of type DidChangeWatchedFilesClientCapabilities');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('symbol');
-      try {
-        final symbol = obj['symbol'];
-        if (symbol != null &&
-            !(WorkspaceSymbolClientCapabilities.canParse(symbol, reporter))) {
-          reporter
-              .reportError('must be of type WorkspaceSymbolClientCapabilities');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('executeCommand');
-      try {
-        final executeCommand = obj['executeCommand'];
-        if (executeCommand != null &&
-            !(ExecuteCommandClientCapabilities.canParse(
-                executeCommand, reporter))) {
-          reporter
-              .reportError('must be of type ExecuteCommandClientCapabilities');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('workspaceFolders');
-      try {
-        final workspaceFolders = obj['workspaceFolders'];
-        if (workspaceFolders != null && !(workspaceFolders is bool)) {
-          reporter.reportError('must be of type bool');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('configuration');
-      try {
-        final configuration = obj['configuration'];
-        if (configuration != null && !(configuration is bool)) {
-          reporter.reportError('must be of type bool');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('semanticTokens');
-      try {
-        final semanticTokens = obj['semanticTokens'];
-        if (semanticTokens != null &&
-            !(SemanticTokensWorkspaceClientCapabilities.canParse(
-                semanticTokens, reporter))) {
-          reporter.reportError(
-              'must be of type SemanticTokensWorkspaceClientCapabilities');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('codeLens');
-      try {
-        final codeLens = obj['codeLens'];
-        if (codeLens != null &&
-            !(CodeLensWorkspaceClientCapabilities.canParse(
-                codeLens, reporter))) {
-          reporter.reportError(
-              'must be of type CodeLensWorkspaceClientCapabilities');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('fileOperations');
-      try {
-        final fileOperations = obj['fileOperations'];
-        if (fileOperations != null &&
-            !(ClientCapabilitiesFileOperations.canParse(
-                fileOperations, reporter))) {
-          reporter
-              .reportError('must be of type ClientCapabilitiesFileOperations');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      return true;
-    } else {
-      reporter.reportError('must be of type ClientCapabilitiesWorkspace');
-      return false;
-    }
-  }
-
-  @override
-  bool operator ==(Object other) {
-    if (other is ClientCapabilitiesWorkspace &&
-        other.runtimeType == ClientCapabilitiesWorkspace) {
-      return applyEdit == other.applyEdit &&
-          workspaceEdit == other.workspaceEdit &&
-          didChangeConfiguration == other.didChangeConfiguration &&
-          didChangeWatchedFiles == other.didChangeWatchedFiles &&
-          symbol == other.symbol &&
-          executeCommand == other.executeCommand &&
-          workspaceFolders == other.workspaceFolders &&
-          configuration == other.configuration &&
-          semanticTokens == other.semanticTokens &&
-          codeLens == other.codeLens &&
-          fileOperations == other.fileOperations &&
+          workspace == other.workspace &&
           true;
     }
     return false;
@@ -2404,17 +1874,13 @@
 
   @override
   int get hashCode => Object.hash(
-      applyEdit,
-      workspaceEdit,
-      didChangeConfiguration,
-      didChangeWatchedFiles,
-      symbol,
-      executeCommand,
-      workspaceFolders,
-      configuration,
-      semanticTokens,
-      codeLens,
-      fileOperations);
+        experimental,
+        general,
+        notebookDocument,
+        textDocument,
+        window,
+        workspace,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
@@ -2426,30 +1892,32 @@
 /// A CodeAction must set either `edit` and/or a `command`. If both are
 /// supplied, the `edit` is applied first, then the `command` is executed.
 class CodeAction implements ToJsonable {
-  static const jsonHandler =
-      LspJsonHandler(CodeAction.canParse, CodeAction.fromJson);
+  static const jsonHandler = LspJsonHandler(
+    CodeAction.canParse,
+    CodeAction.fromJson,
+  );
 
-  CodeAction(
-      {required this.title,
-      this.kind,
-      this.diagnostics,
-      this.isPreferred,
-      this.disabled,
-      this.edit,
-      this.command,
-      this.data});
+  CodeAction({
+    this.command,
+    this.data,
+    this.diagnostics,
+    this.disabled,
+    this.edit,
+    this.isPreferred,
+    this.kind,
+    required this.title,
+  });
   static CodeAction fromJson(Map<String, Object?> json) {
-    final titleJson = json['title'];
-    final title = titleJson as String;
-    final kindJson = json['kind'];
-    final kind =
-        kindJson != null ? CodeActionKind.fromJson(kindJson as String) : null;
+    final commandJson = json['command'];
+    final command = commandJson != null
+        ? Command.fromJson(commandJson as Map<String, Object?>)
+        : null;
+    final dataJson = json['data'];
+    final data = dataJson;
     final diagnosticsJson = json['diagnostics'];
     final diagnostics = (diagnosticsJson as List<Object?>?)
         ?.map((item) => Diagnostic.fromJson(item as Map<String, Object?>))
         .toList();
-    final isPreferredJson = json['isPreferred'];
-    final isPreferred = isPreferredJson as bool?;
     final disabledJson = json['disabled'];
     final disabled = disabledJson != null
         ? CodeActionDisabled.fromJson(disabledJson as Map<String, Object?>)
@@ -2458,21 +1926,23 @@
     final edit = editJson != null
         ? WorkspaceEdit.fromJson(editJson as Map<String, Object?>)
         : null;
-    final commandJson = json['command'];
-    final command = commandJson != null
-        ? Command.fromJson(commandJson as Map<String, Object?>)
-        : null;
-    final dataJson = json['data'];
-    final data = dataJson;
+    final isPreferredJson = json['isPreferred'];
+    final isPreferred = isPreferredJson as bool?;
+    final kindJson = json['kind'];
+    final kind =
+        kindJson != null ? CodeActionKind.fromJson(kindJson as String) : null;
+    final titleJson = json['title'];
+    final title = titleJson as String;
     return CodeAction(
-        title: title,
-        kind: kind,
-        diagnostics: diagnostics,
-        isPreferred: isPreferred,
-        disabled: disabled,
-        edit: edit,
-        command: command,
-        data: data);
+      command: command,
+      data: data,
+      diagnostics: diagnostics,
+      disabled: disabled,
+      edit: edit,
+      isPreferred: isPreferred,
+      kind: kind,
+      title: title,
+    );
   }
 
   /// A command this code action executes. If a code action provides an edit and
@@ -2525,36 +1995,101 @@
   /// A short, human-readable, title for this code action.
   final String title;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['title'] = title;
-    if (kind != null) {
-      __result['kind'] = kind?.toJson();
-    }
-    if (diagnostics != null) {
-      __result['diagnostics'] =
-          diagnostics?.map((item) => item.toJson()).toList();
-    }
-    if (isPreferred != null) {
-      __result['isPreferred'] = isPreferred;
-    }
-    if (disabled != null) {
-      __result['disabled'] = disabled?.toJson();
-    }
-    if (edit != null) {
-      __result['edit'] = edit?.toJson();
-    }
+    var result = <String, Object?>{};
     if (command != null) {
-      __result['command'] = command?.toJson();
+      result['command'] = command?.toJson();
     }
     if (data != null) {
-      __result['data'] = data;
+      result['data'] = data;
     }
-    return __result;
+    if (diagnostics != null) {
+      result['diagnostics'] =
+          diagnostics?.map((item) => item.toJson()).toList();
+    }
+    if (disabled != null) {
+      result['disabled'] = disabled?.toJson();
+    }
+    if (edit != null) {
+      result['edit'] = edit?.toJson();
+    }
+    if (isPreferred != null) {
+      result['isPreferred'] = isPreferred;
+    }
+    if (kind != null) {
+      result['kind'] = kind?.toJson();
+    }
+    result['title'] = title;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
+      reporter.push('command');
+      try {
+        final command = obj['command'];
+        if (command != null && !Command.canParse(command, reporter)) {
+          reporter.reportError('must be of type Command');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('diagnostics');
+      try {
+        final diagnostics = obj['diagnostics'];
+        if (diagnostics != null &&
+            (diagnostics is! List<Object?> ||
+                diagnostics
+                    .any((item) => !Diagnostic.canParse(item, reporter)))) {
+          reporter.reportError('must be of type List<Diagnostic>');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('disabled');
+      try {
+        final disabled = obj['disabled'];
+        if (disabled != null &&
+            !CodeActionDisabled.canParse(disabled, reporter)) {
+          reporter.reportError('must be of type CodeActionDisabled');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('edit');
+      try {
+        final edit = obj['edit'];
+        if (edit != null && !WorkspaceEdit.canParse(edit, reporter)) {
+          reporter.reportError('must be of type WorkspaceEdit');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('isPreferred');
+      try {
+        final isPreferred = obj['isPreferred'];
+        if (isPreferred != null && isPreferred is! bool) {
+          reporter.reportError('must be of type bool');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('kind');
+      try {
+        final kind = obj['kind'];
+        if (kind != null && !CodeActionKind.canParse(kind, reporter)) {
+          reporter.reportError('must be of type CodeActionKind');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
       reporter.push('title');
       try {
         if (!obj.containsKey('title')) {
@@ -2566,77 +2101,13 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(title is String)) {
+        if (title is! String) {
           reporter.reportError('must be of type String');
           return false;
         }
       } finally {
         reporter.pop();
       }
-      reporter.push('kind');
-      try {
-        final kind = obj['kind'];
-        if (kind != null && !(CodeActionKind.canParse(kind, reporter))) {
-          reporter.reportError('must be of type CodeActionKind');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('diagnostics');
-      try {
-        final diagnostics = obj['diagnostics'];
-        if (diagnostics != null &&
-            !((diagnostics is List<Object?> &&
-                (diagnostics
-                    .every((item) => Diagnostic.canParse(item, reporter)))))) {
-          reporter.reportError('must be of type List<Diagnostic>');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('isPreferred');
-      try {
-        final isPreferred = obj['isPreferred'];
-        if (isPreferred != null && !(isPreferred is bool)) {
-          reporter.reportError('must be of type bool');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('disabled');
-      try {
-        final disabled = obj['disabled'];
-        if (disabled != null &&
-            !(CodeActionDisabled.canParse(disabled, reporter))) {
-          reporter.reportError('must be of type CodeActionDisabled');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('edit');
-      try {
-        final edit = obj['edit'];
-        if (edit != null && !(WorkspaceEdit.canParse(edit, reporter))) {
-          reporter.reportError('must be of type WorkspaceEdit');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('command');
-      try {
-        final command = obj['command'];
-        if (command != null && !(Command.canParse(command, reporter))) {
-          reporter.reportError('must be of type Command');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       return true;
     } else {
       reporter.reportError('must be of type CodeAction');
@@ -2647,23 +2118,31 @@
   @override
   bool operator ==(Object other) {
     if (other is CodeAction && other.runtimeType == CodeAction) {
-      return title == other.title &&
-          kind == other.kind &&
+      return command == other.command &&
+          data == other.data &&
           listEqual(diagnostics, other.diagnostics,
               (Diagnostic a, Diagnostic b) => a == b) &&
-          isPreferred == other.isPreferred &&
           disabled == other.disabled &&
           edit == other.edit &&
-          command == other.command &&
-          data == other.data &&
+          isPreferred == other.isPreferred &&
+          kind == other.kind &&
+          title == other.title &&
           true;
     }
     return false;
   }
 
   @override
-  int get hashCode => Object.hash(title, kind, lspHashCode(diagnostics),
-      isPreferred, disabled, edit, command, data);
+  int get hashCode => Object.hash(
+        command,
+        data,
+        lspHashCode(diagnostics),
+        disabled,
+        edit,
+        isPreferred,
+        kind,
+        title,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
@@ -2671,46 +2150,49 @@
 
 class CodeActionClientCapabilities implements ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      CodeActionClientCapabilities.canParse,
-      CodeActionClientCapabilities.fromJson);
+    CodeActionClientCapabilities.canParse,
+    CodeActionClientCapabilities.fromJson,
+  );
 
-  CodeActionClientCapabilities(
-      {this.dynamicRegistration,
-      this.codeActionLiteralSupport,
-      this.isPreferredSupport,
-      this.disabledSupport,
-      this.dataSupport,
-      this.resolveSupport,
-      this.honorsChangeAnnotations});
+  CodeActionClientCapabilities({
+    this.codeActionLiteralSupport,
+    this.dataSupport,
+    this.disabledSupport,
+    this.dynamicRegistration,
+    this.honorsChangeAnnotations,
+    this.isPreferredSupport,
+    this.resolveSupport,
+  });
   static CodeActionClientCapabilities fromJson(Map<String, Object?> json) {
-    final dynamicRegistrationJson = json['dynamicRegistration'];
-    final dynamicRegistration = dynamicRegistrationJson as bool?;
     final codeActionLiteralSupportJson = json['codeActionLiteralSupport'];
     final codeActionLiteralSupport = codeActionLiteralSupportJson != null
         ? CodeActionClientCapabilitiesCodeActionLiteralSupport.fromJson(
             codeActionLiteralSupportJson as Map<String, Object?>)
         : null;
-    final isPreferredSupportJson = json['isPreferredSupport'];
-    final isPreferredSupport = isPreferredSupportJson as bool?;
-    final disabledSupportJson = json['disabledSupport'];
-    final disabledSupport = disabledSupportJson as bool?;
     final dataSupportJson = json['dataSupport'];
     final dataSupport = dataSupportJson as bool?;
+    final disabledSupportJson = json['disabledSupport'];
+    final disabledSupport = disabledSupportJson as bool?;
+    final dynamicRegistrationJson = json['dynamicRegistration'];
+    final dynamicRegistration = dynamicRegistrationJson as bool?;
+    final honorsChangeAnnotationsJson = json['honorsChangeAnnotations'];
+    final honorsChangeAnnotations = honorsChangeAnnotationsJson as bool?;
+    final isPreferredSupportJson = json['isPreferredSupport'];
+    final isPreferredSupport = isPreferredSupportJson as bool?;
     final resolveSupportJson = json['resolveSupport'];
     final resolveSupport = resolveSupportJson != null
         ? CodeActionClientCapabilitiesResolveSupport.fromJson(
             resolveSupportJson as Map<String, Object?>)
         : null;
-    final honorsChangeAnnotationsJson = json['honorsChangeAnnotations'];
-    final honorsChangeAnnotations = honorsChangeAnnotationsJson as bool?;
     return CodeActionClientCapabilities(
-        dynamicRegistration: dynamicRegistration,
-        codeActionLiteralSupport: codeActionLiteralSupport,
-        isPreferredSupport: isPreferredSupport,
-        disabledSupport: disabledSupport,
-        dataSupport: dataSupport,
-        resolveSupport: resolveSupport,
-        honorsChangeAnnotations: honorsChangeAnnotations);
+      codeActionLiteralSupport: codeActionLiteralSupport,
+      dataSupport: dataSupport,
+      disabledSupport: disabledSupport,
+      dynamicRegistration: dynamicRegistration,
+      honorsChangeAnnotations: honorsChangeAnnotations,
+      isPreferredSupport: isPreferredSupport,
+      resolveSupport: resolveSupport,
+    );
   }
 
   /// The client supports code action literals as a valid response of the
@@ -2731,9 +2213,9 @@
   /// Whether code action supports dynamic registration.
   final bool? dynamicRegistration;
 
-  /// Whether th client honors the change annotations in text edits and resource
-  /// operations returned via the `CodeAction#edit` property by for example
-  /// presenting the workspace edit in the user interface and asking for
+  /// Whether the client honors the change annotations in text edits and
+  /// resource operations returned via the `CodeAction#edit` property by for
+  /// example presenting the workspace edit in the user interface and asking for
   /// confirmation.
   ///  @since 3.16.0
   final bool? honorsChangeAnnotations;
@@ -2747,50 +2229,41 @@
   ///  @since 3.16.0
   final CodeActionClientCapabilitiesResolveSupport? resolveSupport;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    if (dynamicRegistration != null) {
-      __result['dynamicRegistration'] = dynamicRegistration;
-    }
+    var result = <String, Object?>{};
     if (codeActionLiteralSupport != null) {
-      __result['codeActionLiteralSupport'] = codeActionLiteralSupport?.toJson();
-    }
-    if (isPreferredSupport != null) {
-      __result['isPreferredSupport'] = isPreferredSupport;
-    }
-    if (disabledSupport != null) {
-      __result['disabledSupport'] = disabledSupport;
+      result['codeActionLiteralSupport'] = codeActionLiteralSupport?.toJson();
     }
     if (dataSupport != null) {
-      __result['dataSupport'] = dataSupport;
+      result['dataSupport'] = dataSupport;
     }
-    if (resolveSupport != null) {
-      __result['resolveSupport'] = resolveSupport?.toJson();
+    if (disabledSupport != null) {
+      result['disabledSupport'] = disabledSupport;
+    }
+    if (dynamicRegistration != null) {
+      result['dynamicRegistration'] = dynamicRegistration;
     }
     if (honorsChangeAnnotations != null) {
-      __result['honorsChangeAnnotations'] = honorsChangeAnnotations;
+      result['honorsChangeAnnotations'] = honorsChangeAnnotations;
     }
-    return __result;
+    if (isPreferredSupport != null) {
+      result['isPreferredSupport'] = isPreferredSupport;
+    }
+    if (resolveSupport != null) {
+      result['resolveSupport'] = resolveSupport?.toJson();
+    }
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
-      reporter.push('dynamicRegistration');
-      try {
-        final dynamicRegistration = obj['dynamicRegistration'];
-        if (dynamicRegistration != null && !(dynamicRegistration is bool)) {
-          reporter.reportError('must be of type bool');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       reporter.push('codeActionLiteralSupport');
       try {
         final codeActionLiteralSupport = obj['codeActionLiteralSupport'];
         if (codeActionLiteralSupport != null &&
-            !(CodeActionClientCapabilitiesCodeActionLiteralSupport.canParse(
-                codeActionLiteralSupport, reporter))) {
+            !CodeActionClientCapabilitiesCodeActionLiteralSupport.canParse(
+                codeActionLiteralSupport, reporter)) {
           reporter.reportError(
               'must be of type CodeActionClientCapabilitiesCodeActionLiteralSupport');
           return false;
@@ -2798,10 +2271,10 @@
       } finally {
         reporter.pop();
       }
-      reporter.push('isPreferredSupport');
+      reporter.push('dataSupport');
       try {
-        final isPreferredSupport = obj['isPreferredSupport'];
-        if (isPreferredSupport != null && !(isPreferredSupport is bool)) {
+        final dataSupport = obj['dataSupport'];
+        if (dataSupport != null && dataSupport is! bool) {
           reporter.reportError('must be of type bool');
           return false;
         }
@@ -2811,17 +2284,38 @@
       reporter.push('disabledSupport');
       try {
         final disabledSupport = obj['disabledSupport'];
-        if (disabledSupport != null && !(disabledSupport is bool)) {
+        if (disabledSupport != null && disabledSupport is! bool) {
           reporter.reportError('must be of type bool');
           return false;
         }
       } finally {
         reporter.pop();
       }
-      reporter.push('dataSupport');
+      reporter.push('dynamicRegistration');
       try {
-        final dataSupport = obj['dataSupport'];
-        if (dataSupport != null && !(dataSupport is bool)) {
+        final dynamicRegistration = obj['dynamicRegistration'];
+        if (dynamicRegistration != null && dynamicRegistration is! bool) {
+          reporter.reportError('must be of type bool');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('honorsChangeAnnotations');
+      try {
+        final honorsChangeAnnotations = obj['honorsChangeAnnotations'];
+        if (honorsChangeAnnotations != null &&
+            honorsChangeAnnotations is! bool) {
+          reporter.reportError('must be of type bool');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('isPreferredSupport');
+      try {
+        final isPreferredSupport = obj['isPreferredSupport'];
+        if (isPreferredSupport != null && isPreferredSupport is! bool) {
           reporter.reportError('must be of type bool');
           return false;
         }
@@ -2832,8 +2326,8 @@
       try {
         final resolveSupport = obj['resolveSupport'];
         if (resolveSupport != null &&
-            !(CodeActionClientCapabilitiesResolveSupport.canParse(
-                resolveSupport, reporter))) {
+            !CodeActionClientCapabilitiesResolveSupport.canParse(
+                resolveSupport, reporter)) {
           reporter.reportError(
               'must be of type CodeActionClientCapabilitiesResolveSupport');
           return false;
@@ -2841,17 +2335,6 @@
       } finally {
         reporter.pop();
       }
-      reporter.push('honorsChangeAnnotations');
-      try {
-        final honorsChangeAnnotations = obj['honorsChangeAnnotations'];
-        if (honorsChangeAnnotations != null &&
-            !(honorsChangeAnnotations is bool)) {
-          reporter.reportError('must be of type bool');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       return true;
     } else {
       reporter.reportError('must be of type CodeActionClientCapabilities');
@@ -2863,13 +2346,13 @@
   bool operator ==(Object other) {
     if (other is CodeActionClientCapabilities &&
         other.runtimeType == CodeActionClientCapabilities) {
-      return dynamicRegistration == other.dynamicRegistration &&
-          codeActionLiteralSupport == other.codeActionLiteralSupport &&
-          isPreferredSupport == other.isPreferredSupport &&
-          disabledSupport == other.disabledSupport &&
+      return codeActionLiteralSupport == other.codeActionLiteralSupport &&
           dataSupport == other.dataSupport &&
-          resolveSupport == other.resolveSupport &&
+          disabledSupport == other.disabledSupport &&
+          dynamicRegistration == other.dynamicRegistration &&
           honorsChangeAnnotations == other.honorsChangeAnnotations &&
+          isPreferredSupport == other.isPreferredSupport &&
+          resolveSupport == other.resolveSupport &&
           true;
     }
     return false;
@@ -2877,87 +2360,14 @@
 
   @override
   int get hashCode => Object.hash(
-      dynamicRegistration,
-      codeActionLiteralSupport,
-      isPreferredSupport,
-      disabledSupport,
-      dataSupport,
-      resolveSupport,
-      honorsChangeAnnotations);
-
-  @override
-  String toString() => jsonEncoder.convert(toJson());
-}
-
-class CodeActionClientCapabilitiesCodeActionKind implements ToJsonable {
-  static const jsonHandler = LspJsonHandler(
-      CodeActionClientCapabilitiesCodeActionKind.canParse,
-      CodeActionClientCapabilitiesCodeActionKind.fromJson);
-
-  CodeActionClientCapabilitiesCodeActionKind({required this.valueSet});
-  static CodeActionClientCapabilitiesCodeActionKind fromJson(
-      Map<String, Object?> json) {
-    final valueSetJson = json['valueSet'];
-    final valueSet = (valueSetJson as List<Object?>)
-        .map((item) => CodeActionKind.fromJson(item as String))
-        .toList();
-    return CodeActionClientCapabilitiesCodeActionKind(valueSet: valueSet);
-  }
-
-  /// The code action kind values the client supports. When this property exists
-  /// the client also guarantees that it will handle values outside its set
-  /// gracefully and falls back to a default value when unknown.
-  final List<CodeActionKind> valueSet;
-
-  Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['valueSet'] = valueSet.map((item) => item.toJson()).toList();
-    return __result;
-  }
-
-  static bool canParse(Object? obj, LspJsonReporter reporter) {
-    if (obj is Map<String, Object?>) {
-      reporter.push('valueSet');
-      try {
-        if (!obj.containsKey('valueSet')) {
-          reporter.reportError('must not be undefined');
-          return false;
-        }
-        final valueSet = obj['valueSet'];
-        if (valueSet == null) {
-          reporter.reportError('must not be null');
-          return false;
-        }
-        if (!((valueSet is List<Object?> &&
-            (valueSet
-                .every((item) => CodeActionKind.canParse(item, reporter)))))) {
-          reporter.reportError('must be of type List<CodeActionKind>');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      return true;
-    } else {
-      reporter.reportError(
-          'must be of type CodeActionClientCapabilitiesCodeActionKind');
-      return false;
-    }
-  }
-
-  @override
-  bool operator ==(Object other) {
-    if (other is CodeActionClientCapabilitiesCodeActionKind &&
-        other.runtimeType == CodeActionClientCapabilitiesCodeActionKind) {
-      return listEqual(valueSet, other.valueSet,
-              (CodeActionKind a, CodeActionKind b) => a == b) &&
-          true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode => lspHashCode(valueSet);
+        codeActionLiteralSupport,
+        dataSupport,
+        disabledSupport,
+        dynamicRegistration,
+        honorsChangeAnnotations,
+        isPreferredSupport,
+        resolveSupport,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
@@ -2966,27 +2376,31 @@
 class CodeActionClientCapabilitiesCodeActionLiteralSupport
     implements ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      CodeActionClientCapabilitiesCodeActionLiteralSupport.canParse,
-      CodeActionClientCapabilitiesCodeActionLiteralSupport.fromJson);
+    CodeActionClientCapabilitiesCodeActionLiteralSupport.canParse,
+    CodeActionClientCapabilitiesCodeActionLiteralSupport.fromJson,
+  );
 
-  CodeActionClientCapabilitiesCodeActionLiteralSupport(
-      {required this.codeActionKind});
+  CodeActionClientCapabilitiesCodeActionLiteralSupport({
+    required this.codeActionKind,
+  });
   static CodeActionClientCapabilitiesCodeActionLiteralSupport fromJson(
       Map<String, Object?> json) {
     final codeActionKindJson = json['codeActionKind'];
-    final codeActionKind = CodeActionClientCapabilitiesCodeActionKind.fromJson(
+    final codeActionKind = CodeActionLiteralSupportCodeActionKind.fromJson(
         codeActionKindJson as Map<String, Object?>);
     return CodeActionClientCapabilitiesCodeActionLiteralSupport(
-        codeActionKind: codeActionKind);
+      codeActionKind: codeActionKind,
+    );
   }
 
   /// The code action kind is supported with the following value set.
-  final CodeActionClientCapabilitiesCodeActionKind codeActionKind;
+  final CodeActionLiteralSupportCodeActionKind codeActionKind;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['codeActionKind'] = codeActionKind.toJson();
-    return __result;
+    var result = <String, Object?>{};
+    result['codeActionKind'] = codeActionKind.toJson();
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -3002,10 +2416,10 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(CodeActionClientCapabilitiesCodeActionKind.canParse(
-            codeActionKind, reporter))) {
+        if (!CodeActionLiteralSupportCodeActionKind.canParse(
+            codeActionKind, reporter)) {
           reporter.reportError(
-              'must be of type CodeActionClientCapabilitiesCodeActionKind');
+              'must be of type CodeActionLiteralSupportCodeActionKind');
           return false;
         }
       } finally {
@@ -3038,26 +2452,32 @@
 
 class CodeActionClientCapabilitiesResolveSupport implements ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      CodeActionClientCapabilitiesResolveSupport.canParse,
-      CodeActionClientCapabilitiesResolveSupport.fromJson);
+    CodeActionClientCapabilitiesResolveSupport.canParse,
+    CodeActionClientCapabilitiesResolveSupport.fromJson,
+  );
 
-  CodeActionClientCapabilitiesResolveSupport({required this.properties});
+  CodeActionClientCapabilitiesResolveSupport({
+    required this.properties,
+  });
   static CodeActionClientCapabilitiesResolveSupport fromJson(
       Map<String, Object?> json) {
     final propertiesJson = json['properties'];
     final properties = (propertiesJson as List<Object?>)
         .map((item) => item as String)
         .toList();
-    return CodeActionClientCapabilitiesResolveSupport(properties: properties);
+    return CodeActionClientCapabilitiesResolveSupport(
+      properties: properties,
+    );
   }
 
   /// The properties that a client can resolve lazily.
   final List<String> properties;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['properties'] = properties;
-    return __result;
+    var result = <String, Object?>{};
+    result['properties'] = properties;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -3073,8 +2493,8 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!((properties is List<Object?> &&
-            (properties.every((item) => item is String))))) {
+        if (properties is! List<Object?> ||
+            properties.any((item) => item is! String)) {
           reporter.reportError('must be of type List<String>');
           return false;
         }
@@ -3110,10 +2530,16 @@
 /// Contains additional diagnostic information about the context in which a code
 /// action is run.
 class CodeActionContext implements ToJsonable {
-  static const jsonHandler =
-      LspJsonHandler(CodeActionContext.canParse, CodeActionContext.fromJson);
+  static const jsonHandler = LspJsonHandler(
+    CodeActionContext.canParse,
+    CodeActionContext.fromJson,
+  );
 
-  CodeActionContext({required this.diagnostics, this.only});
+  CodeActionContext({
+    required this.diagnostics,
+    this.only,
+    this.triggerKind,
+  });
   static CodeActionContext fromJson(Map<String, Object?> json) {
     final diagnosticsJson = json['diagnostics'];
     final diagnostics = (diagnosticsJson as List<Object?>)
@@ -3123,7 +2549,15 @@
     final only = (onlyJson as List<Object?>?)
         ?.map((item) => CodeActionKind.fromJson(item as String))
         .toList();
-    return CodeActionContext(diagnostics: diagnostics, only: only);
+    final triggerKindJson = json['triggerKind'];
+    final triggerKind = triggerKindJson != null
+        ? CodeActionTriggerKind.fromJson(triggerKindJson as int)
+        : null;
+    return CodeActionContext(
+      diagnostics: diagnostics,
+      only: only,
+      triggerKind: triggerKind,
+    );
   }
 
   /// An array of diagnostics known on the client side overlapping the range
@@ -3140,13 +2574,21 @@
   /// shown. So servers can omit computing them.
   final List<CodeActionKind>? only;
 
+  /// The reason why code actions were requested.
+  ///  @since 3.17.0
+  final CodeActionTriggerKind? triggerKind;
+
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['diagnostics'] = diagnostics.map((item) => item.toJson()).toList();
+    var result = <String, Object?>{};
+    result['diagnostics'] = diagnostics.map((item) => item.toJson()).toList();
     if (only != null) {
-      __result['only'] = only?.map((item) => item.toJson()).toList();
+      result['only'] = only?.map((item) => item.toJson()).toList();
     }
-    return __result;
+    if (triggerKind != null) {
+      result['triggerKind'] = triggerKind?.toJson();
+    }
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -3162,9 +2604,8 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!((diagnostics is List<Object?> &&
-            (diagnostics
-                .every((item) => Diagnostic.canParse(item, reporter)))))) {
+        if (diagnostics is! List<Object?> ||
+            diagnostics.any((item) => !Diagnostic.canParse(item, reporter))) {
           reporter.reportError('must be of type List<Diagnostic>');
           return false;
         }
@@ -3175,15 +2616,25 @@
       try {
         final only = obj['only'];
         if (only != null &&
-            !((only is List<Object?> &&
-                (only.every(
-                    (item) => CodeActionKind.canParse(item, reporter)))))) {
+            (only is! List<Object?> ||
+                only.any((item) => !CodeActionKind.canParse(item, reporter)))) {
           reporter.reportError('must be of type List<CodeActionKind>');
           return false;
         }
       } finally {
         reporter.pop();
       }
+      reporter.push('triggerKind');
+      try {
+        final triggerKind = obj['triggerKind'];
+        if (triggerKind != null &&
+            !CodeActionTriggerKind.canParse(triggerKind, reporter)) {
+          reporter.reportError('must be of type CodeActionTriggerKind');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
       return true;
     } else {
       reporter.reportError('must be of type CodeActionContext');
@@ -3198,27 +2649,38 @@
               (Diagnostic a, Diagnostic b) => a == b) &&
           listEqual(only, other.only,
               (CodeActionKind a, CodeActionKind b) => a == b) &&
+          triggerKind == other.triggerKind &&
           true;
     }
     return false;
   }
 
   @override
-  int get hashCode => Object.hash(lspHashCode(diagnostics), lspHashCode(only));
+  int get hashCode => Object.hash(
+        lspHashCode(diagnostics),
+        lspHashCode(only),
+        triggerKind,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
 }
 
 class CodeActionDisabled implements ToJsonable {
-  static const jsonHandler =
-      LspJsonHandler(CodeActionDisabled.canParse, CodeActionDisabled.fromJson);
+  static const jsonHandler = LspJsonHandler(
+    CodeActionDisabled.canParse,
+    CodeActionDisabled.fromJson,
+  );
 
-  CodeActionDisabled({required this.reason});
+  CodeActionDisabled({
+    required this.reason,
+  });
   static CodeActionDisabled fromJson(Map<String, Object?> json) {
     final reasonJson = json['reason'];
     final reason = reasonJson as String;
-    return CodeActionDisabled(reason: reason);
+    return CodeActionDisabled(
+      reason: reason,
+    );
   }
 
   /// Human readable description of why the code action is currently disabled.
@@ -3226,10 +2688,11 @@
   /// This is displayed in the code actions UI.
   final String reason;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['reason'] = reason;
-    return __result;
+    var result = <String, Object?>{};
+    result['reason'] = reason;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -3245,7 +2708,7 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(reason is String)) {
+        if (reason is! String) {
           reporter.reportError('must be of type String');
           return false;
         }
@@ -3276,7 +2739,7 @@
 }
 
 /// A set of predefined code action kinds.
-class CodeActionKind {
+class CodeActionKind implements ToJsonable {
   const CodeActionKind(this._value);
   const CodeActionKind.fromJson(this._value);
 
@@ -3333,9 +2796,17 @@
   /// Source code actions apply to the entire file.
   static const Source = CodeActionKind('source');
 
+  /// Base kind for a 'fix all' source action: `source.fixAll`.
+  ///  'Fix all' actions automatically fix errors that have a clear fix that do
+  /// not require user input. They should not suppress errors or perform unsafe
+  /// fixes such as generating new types or classes.
+  ///  @since 3.17.0
+  static const SourceFixAll = CodeActionKind('source.fixAll');
+
   /// Base kind for an organize imports source action: `source.organizeImports`.
   static const SourceOrganizeImports = CodeActionKind('source.organizeImports');
 
+  @override
   Object toJson() => _value;
 
   @override
@@ -3344,15 +2815,101 @@
   @override
   int get hashCode => _value.hashCode;
 
-  bool operator ==(Object o) => o is CodeActionKind && o._value == _value;
+  @override
+  bool operator ==(Object other) =>
+      other is CodeActionKind && other._value == _value;
+}
+
+class CodeActionLiteralSupportCodeActionKind implements ToJsonable {
+  static const jsonHandler = LspJsonHandler(
+    CodeActionLiteralSupportCodeActionKind.canParse,
+    CodeActionLiteralSupportCodeActionKind.fromJson,
+  );
+
+  CodeActionLiteralSupportCodeActionKind({
+    required this.valueSet,
+  });
+  static CodeActionLiteralSupportCodeActionKind fromJson(
+      Map<String, Object?> json) {
+    final valueSetJson = json['valueSet'];
+    final valueSet = (valueSetJson as List<Object?>)
+        .map((item) => CodeActionKind.fromJson(item as String))
+        .toList();
+    return CodeActionLiteralSupportCodeActionKind(
+      valueSet: valueSet,
+    );
+  }
+
+  /// The code action kind values the client supports. When this property exists
+  /// the client also guarantees that it will handle values outside its set
+  /// gracefully and falls back to a default value when unknown.
+  final List<CodeActionKind> valueSet;
+
+  @override
+  Map<String, Object?> toJson() {
+    var result = <String, Object?>{};
+    result['valueSet'] = valueSet.map((item) => item.toJson()).toList();
+    return result;
+  }
+
+  static bool canParse(Object? obj, LspJsonReporter reporter) {
+    if (obj is Map<String, Object?>) {
+      reporter.push('valueSet');
+      try {
+        if (!obj.containsKey('valueSet')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final valueSet = obj['valueSet'];
+        if (valueSet == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (valueSet is! List<Object?> ||
+            valueSet.any((item) => !CodeActionKind.canParse(item, reporter))) {
+          reporter.reportError('must be of type List<CodeActionKind>');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      return true;
+    } else {
+      reporter.reportError(
+          'must be of type CodeActionLiteralSupportCodeActionKind');
+      return false;
+    }
+  }
+
+  @override
+  bool operator ==(Object other) {
+    if (other is CodeActionLiteralSupportCodeActionKind &&
+        other.runtimeType == CodeActionLiteralSupportCodeActionKind) {
+      return listEqual(valueSet, other.valueSet,
+              (CodeActionKind a, CodeActionKind b) => a == b) &&
+          true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode => lspHashCode(valueSet);
+
+  @override
+  String toString() => jsonEncoder.convert(toJson());
 }
 
 class CodeActionOptions implements WorkDoneProgressOptions, ToJsonable {
-  static const jsonHandler =
-      LspJsonHandler(CodeActionOptions.canParse, CodeActionOptions.fromJson);
+  static const jsonHandler = LspJsonHandler(
+    CodeActionOptions.canParse,
+    CodeActionOptions.fromJson,
+  );
 
-  CodeActionOptions(
-      {this.codeActionKinds, this.resolveProvider, this.workDoneProgress});
+  CodeActionOptions({
+    this.codeActionKinds,
+    this.resolveProvider,
+    this.workDoneProgress,
+  });
   static CodeActionOptions fromJson(Map<String, Object?> json) {
     if (CodeActionRegistrationOptions.canParse(json, nullLspJsonReporter)) {
       return CodeActionRegistrationOptions.fromJson(json);
@@ -3366,9 +2923,10 @@
     final workDoneProgressJson = json['workDoneProgress'];
     final workDoneProgress = workDoneProgressJson as bool?;
     return CodeActionOptions(
-        codeActionKinds: codeActionKinds,
-        resolveProvider: resolveProvider,
-        workDoneProgress: workDoneProgress);
+      codeActionKinds: codeActionKinds,
+      resolveProvider: resolveProvider,
+      workDoneProgress: workDoneProgress,
+    );
   }
 
   /// CodeActionKinds that this server may return.
@@ -3381,21 +2939,23 @@
   /// action.
   ///  @since 3.16.0
   final bool? resolveProvider;
+  @override
   final bool? workDoneProgress;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
+    var result = <String, Object?>{};
     if (codeActionKinds != null) {
-      __result['codeActionKinds'] =
+      result['codeActionKinds'] =
           codeActionKinds?.map((item) => item.toJson()).toList();
     }
     if (resolveProvider != null) {
-      __result['resolveProvider'] = resolveProvider;
+      result['resolveProvider'] = resolveProvider;
     }
     if (workDoneProgress != null) {
-      __result['workDoneProgress'] = workDoneProgress;
+      result['workDoneProgress'] = workDoneProgress;
     }
-    return __result;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -3404,9 +2964,9 @@
       try {
         final codeActionKinds = obj['codeActionKinds'];
         if (codeActionKinds != null &&
-            !((codeActionKinds is List<Object?> &&
-                (codeActionKinds.every(
-                    (item) => CodeActionKind.canParse(item, reporter)))))) {
+            (codeActionKinds is! List<Object?> ||
+                codeActionKinds
+                    .any((item) => !CodeActionKind.canParse(item, reporter)))) {
           reporter.reportError('must be of type List<CodeActionKind>');
           return false;
         }
@@ -3416,7 +2976,7 @@
       reporter.push('resolveProvider');
       try {
         final resolveProvider = obj['resolveProvider'];
-        if (resolveProvider != null && !(resolveProvider is bool)) {
+        if (resolveProvider != null && resolveProvider is! bool) {
           reporter.reportError('must be of type bool');
           return false;
         }
@@ -3426,7 +2986,7 @@
       reporter.push('workDoneProgress');
       try {
         final workDoneProgress = obj['workDoneProgress'];
-        if (workDoneProgress != null && !(workDoneProgress is bool)) {
+        if (workDoneProgress != null && workDoneProgress is! bool) {
           reporter.reportError('must be of type bool');
           return false;
         }
@@ -3454,7 +3014,10 @@
 
   @override
   int get hashCode => Object.hash(
-      lspHashCode(codeActionKinds), resolveProvider, workDoneProgress);
+        lspHashCode(codeActionKinds),
+        resolveProvider,
+        workDoneProgress,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
@@ -3462,33 +3025,23 @@
 
 /// Params for the CodeActionRequest
 class CodeActionParams
-    implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
-  static const jsonHandler =
-      LspJsonHandler(CodeActionParams.canParse, CodeActionParams.fromJson);
+    implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
+  static const jsonHandler = LspJsonHandler(
+    CodeActionParams.canParse,
+    CodeActionParams.fromJson,
+  );
 
-  CodeActionParams(
-      {required this.textDocument,
-      required this.range,
-      required this.context,
-      this.workDoneToken,
-      this.partialResultToken});
+  CodeActionParams({
+    required this.context,
+    this.partialResultToken,
+    required this.range,
+    required this.textDocument,
+    this.workDoneToken,
+  });
   static CodeActionParams fromJson(Map<String, Object?> json) {
-    final textDocumentJson = json['textDocument'];
-    final textDocument = TextDocumentIdentifier.fromJson(
-        textDocumentJson as Map<String, Object?>);
-    final rangeJson = json['range'];
-    final range = Range.fromJson(rangeJson as Map<String, Object?>);
     final contextJson = json['context'];
     final context =
         CodeActionContext.fromJson(contextJson as Map<String, Object?>);
-    final workDoneTokenJson = json['workDoneToken'];
-    final workDoneToken = workDoneTokenJson == null
-        ? null
-        : (workDoneTokenJson is int
-            ? Either2<int, String>.t1(workDoneTokenJson)
-            : (workDoneTokenJson is String
-                ? Either2<int, String>.t2(workDoneTokenJson)
-                : (throw '''$workDoneTokenJson was not one of (int, String)''')));
     final partialResultTokenJson = json['partialResultToken'];
     final partialResultToken = partialResultTokenJson == null
         ? null
@@ -3497,12 +3050,26 @@
             : (partialResultTokenJson is String
                 ? Either2<int, String>.t2(partialResultTokenJson)
                 : (throw '''$partialResultTokenJson was not one of (int, String)''')));
+    final rangeJson = json['range'];
+    final range = Range.fromJson(rangeJson as Map<String, Object?>);
+    final textDocumentJson = json['textDocument'];
+    final textDocument = TextDocumentIdentifier.fromJson(
+        textDocumentJson as Map<String, Object?>);
+    final workDoneTokenJson = json['workDoneToken'];
+    final workDoneToken = workDoneTokenJson == null
+        ? null
+        : (workDoneTokenJson is int
+            ? Either2<int, String>.t1(workDoneTokenJson)
+            : (workDoneTokenJson is String
+                ? Either2<int, String>.t2(workDoneTokenJson)
+                : (throw '''$workDoneTokenJson was not one of (int, String)''')));
     return CodeActionParams(
-        textDocument: textDocument,
-        range: range,
-        context: context,
-        workDoneToken: workDoneToken,
-        partialResultToken: partialResultToken);
+      context: context,
+      partialResultToken: partialResultToken,
+      range: range,
+      textDocument: textDocument,
+      workDoneToken: workDoneToken,
+    );
   }
 
   /// Context carrying additional information.
@@ -3510,6 +3077,7 @@
 
   /// An optional token that a server can use to report partial results (e.g.
   /// streaming) to the client.
+  @override
   final Either2<int, String>? partialResultToken;
 
   /// The range for which the command was invoked.
@@ -3519,37 +3087,51 @@
   final TextDocumentIdentifier textDocument;
 
   /// An optional token that a server can use to report work done progress.
+  @override
   final Either2<int, String>? workDoneToken;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['textDocument'] = textDocument.toJson();
-    __result['range'] = range.toJson();
-    __result['context'] = context.toJson();
-    if (workDoneToken != null) {
-      __result['workDoneToken'] = workDoneToken;
-    }
+    var result = <String, Object?>{};
+    result['context'] = context.toJson();
     if (partialResultToken != null) {
-      __result['partialResultToken'] = partialResultToken;
+      result['partialResultToken'] = partialResultToken;
     }
-    return __result;
+    result['range'] = range.toJson();
+    result['textDocument'] = textDocument.toJson();
+    if (workDoneToken != null) {
+      result['workDoneToken'] = workDoneToken;
+    }
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
-      reporter.push('textDocument');
+      reporter.push('context');
       try {
-        if (!obj.containsKey('textDocument')) {
+        if (!obj.containsKey('context')) {
           reporter.reportError('must not be undefined');
           return false;
         }
-        final textDocument = obj['textDocument'];
-        if (textDocument == null) {
+        final context = obj['context'];
+        if (context == null) {
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) {
-          reporter.reportError('must be of type TextDocumentIdentifier');
+        if (!CodeActionContext.canParse(context, reporter)) {
+          reporter.reportError('must be of type CodeActionContext');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('partialResultToken');
+      try {
+        final partialResultToken = obj['partialResultToken'];
+        if (partialResultToken != null &&
+            partialResultToken is! int &&
+            partialResultToken is! String) {
+          reporter.reportError('must be of type Either2<int, String>');
           return false;
         }
       } finally {
@@ -3566,26 +3148,26 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(Range.canParse(range, reporter))) {
+        if (!Range.canParse(range, reporter)) {
           reporter.reportError('must be of type Range');
           return false;
         }
       } finally {
         reporter.pop();
       }
-      reporter.push('context');
+      reporter.push('textDocument');
       try {
-        if (!obj.containsKey('context')) {
+        if (!obj.containsKey('textDocument')) {
           reporter.reportError('must not be undefined');
           return false;
         }
-        final context = obj['context'];
-        if (context == null) {
+        final textDocument = obj['textDocument'];
+        if (textDocument == null) {
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(CodeActionContext.canParse(context, reporter))) {
-          reporter.reportError('must be of type CodeActionContext');
+        if (!TextDocumentIdentifier.canParse(textDocument, reporter)) {
+          reporter.reportError('must be of type TextDocumentIdentifier');
           return false;
         }
       } finally {
@@ -3595,18 +3177,8 @@
       try {
         final workDoneToken = obj['workDoneToken'];
         if (workDoneToken != null &&
-            !((workDoneToken is int || workDoneToken is String))) {
-          reporter.reportError('must be of type Either2<int, String>');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('partialResultToken');
-      try {
-        final partialResultToken = obj['partialResultToken'];
-        if (partialResultToken != null &&
-            !((partialResultToken is int || partialResultToken is String))) {
+            workDoneToken is! int &&
+            workDoneToken is! String) {
           reporter.reportError('must be of type Either2<int, String>');
           return false;
         }
@@ -3623,11 +3195,11 @@
   @override
   bool operator ==(Object other) {
     if (other is CodeActionParams && other.runtimeType == CodeActionParams) {
-      return textDocument == other.textDocument &&
-          range == other.range &&
-          context == other.context &&
-          workDoneToken == other.workDoneToken &&
+      return context == other.context &&
           partialResultToken == other.partialResultToken &&
+          range == other.range &&
+          textDocument == other.textDocument &&
+          workDoneToken == other.workDoneToken &&
           true;
     }
     return false;
@@ -3635,77 +3207,104 @@
 
   @override
   int get hashCode => Object.hash(
-      textDocument, range, context, workDoneToken, partialResultToken);
+        context,
+        partialResultToken,
+        range,
+        textDocument,
+        workDoneToken,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
 }
 
 class CodeActionRegistrationOptions
-    implements TextDocumentRegistrationOptions, CodeActionOptions, ToJsonable {
+    implements CodeActionOptions, TextDocumentRegistrationOptions, ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      CodeActionRegistrationOptions.canParse,
-      CodeActionRegistrationOptions.fromJson);
+    CodeActionRegistrationOptions.canParse,
+    CodeActionRegistrationOptions.fromJson,
+  );
 
-  CodeActionRegistrationOptions(
-      {this.documentSelector,
-      this.codeActionKinds,
-      this.resolveProvider,
-      this.workDoneProgress});
+  CodeActionRegistrationOptions({
+    this.codeActionKinds,
+    this.documentSelector,
+    this.resolveProvider,
+    this.workDoneProgress,
+  });
   static CodeActionRegistrationOptions fromJson(Map<String, Object?> json) {
-    final documentSelectorJson = json['documentSelector'];
-    final documentSelector = (documentSelectorJson as List<Object?>?)
-        ?.map((item) => DocumentFilter.fromJson(item as Map<String, Object?>))
-        .toList();
     final codeActionKindsJson = json['codeActionKinds'];
     final codeActionKinds = (codeActionKindsJson as List<Object?>?)
         ?.map((item) => CodeActionKind.fromJson(item as String))
         .toList();
+    final documentSelectorJson = json['documentSelector'];
+    final documentSelector = (documentSelectorJson as List<Object?>?)
+        ?.map((item) =>
+            TextDocumentFilterWithScheme.fromJson(item as Map<String, Object?>))
+        .toList();
     final resolveProviderJson = json['resolveProvider'];
     final resolveProvider = resolveProviderJson as bool?;
     final workDoneProgressJson = json['workDoneProgress'];
     final workDoneProgress = workDoneProgressJson as bool?;
     return CodeActionRegistrationOptions(
-        documentSelector: documentSelector,
-        codeActionKinds: codeActionKinds,
-        resolveProvider: resolveProvider,
-        workDoneProgress: workDoneProgress);
+      codeActionKinds: codeActionKinds,
+      documentSelector: documentSelector,
+      resolveProvider: resolveProvider,
+      workDoneProgress: workDoneProgress,
+    );
   }
 
   /// CodeActionKinds that this server may return.
   ///
   /// The list of kinds may be generic, such as `CodeActionKind.Refactor`, or
   /// the server may list out every specific kind they provide.
+  @override
   final List<CodeActionKind>? codeActionKinds;
 
   /// A document selector to identify the scope of the registration. If set to
   /// null the document selector provided on the client side will be used.
-  final List<DocumentFilter>? documentSelector;
+  @override
+  final List<TextDocumentFilterWithScheme>? documentSelector;
 
   /// The server provides support to resolve additional information for a code
   /// action.
   ///  @since 3.16.0
+  @override
   final bool? resolveProvider;
+  @override
   final bool? workDoneProgress;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['documentSelector'] = documentSelector;
+    var result = <String, Object?>{};
     if (codeActionKinds != null) {
-      __result['codeActionKinds'] =
+      result['codeActionKinds'] =
           codeActionKinds?.map((item) => item.toJson()).toList();
     }
+    result['documentSelector'] = documentSelector;
     if (resolveProvider != null) {
-      __result['resolveProvider'] = resolveProvider;
+      result['resolveProvider'] = resolveProvider;
     }
     if (workDoneProgress != null) {
-      __result['workDoneProgress'] = workDoneProgress;
+      result['workDoneProgress'] = workDoneProgress;
     }
-    return __result;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
+      reporter.push('codeActionKinds');
+      try {
+        final codeActionKinds = obj['codeActionKinds'];
+        if (codeActionKinds != null &&
+            (codeActionKinds is! List<Object?> ||
+                codeActionKinds
+                    .any((item) => !CodeActionKind.canParse(item, reporter)))) {
+          reporter.reportError('must be of type List<CodeActionKind>');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
       reporter.push('documentSelector');
       try {
         if (!obj.containsKey('documentSelector')) {
@@ -3714,23 +3313,11 @@
         }
         final documentSelector = obj['documentSelector'];
         if (documentSelector != null &&
-            !((documentSelector is List<Object?> &&
-                (documentSelector.every(
-                    (item) => DocumentFilter.canParse(item, reporter)))))) {
-          reporter.reportError('must be of type List<DocumentFilter>');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('codeActionKinds');
-      try {
-        final codeActionKinds = obj['codeActionKinds'];
-        if (codeActionKinds != null &&
-            !((codeActionKinds is List<Object?> &&
-                (codeActionKinds.every(
-                    (item) => CodeActionKind.canParse(item, reporter)))))) {
-          reporter.reportError('must be of type List<CodeActionKind>');
+            (documentSelector is! List<Object?> ||
+                documentSelector.any((item) =>
+                    !TextDocumentFilterWithScheme.canParse(item, reporter)))) {
+          reporter.reportError(
+              'must be of type List<TextDocumentFilterWithScheme>');
           return false;
         }
       } finally {
@@ -3739,7 +3326,7 @@
       reporter.push('resolveProvider');
       try {
         final resolveProvider = obj['resolveProvider'];
-        if (resolveProvider != null && !(resolveProvider is bool)) {
+        if (resolveProvider != null && resolveProvider is! bool) {
           reporter.reportError('must be of type bool');
           return false;
         }
@@ -3749,7 +3336,7 @@
       reporter.push('workDoneProgress');
       try {
         final workDoneProgress = obj['workDoneProgress'];
-        if (workDoneProgress != null && !(workDoneProgress is bool)) {
+        if (workDoneProgress != null && workDoneProgress is! bool) {
           reporter.reportError('must be of type bool');
           return false;
         }
@@ -3767,10 +3354,14 @@
   bool operator ==(Object other) {
     if (other is CodeActionRegistrationOptions &&
         other.runtimeType == CodeActionRegistrationOptions) {
-      return listEqual(documentSelector, other.documentSelector,
-              (DocumentFilter a, DocumentFilter b) => a == b) &&
-          listEqual(codeActionKinds, other.codeActionKinds,
+      return listEqual(codeActionKinds, other.codeActionKinds,
               (CodeActionKind a, CodeActionKind b) => a == b) &&
+          listEqual(
+              documentSelector,
+              other.documentSelector,
+              (TextDocumentFilterWithScheme a,
+                      TextDocumentFilterWithScheme b) =>
+                  a == b) &&
           resolveProvider == other.resolveProvider &&
           workDoneProgress == other.workDoneProgress &&
           true;
@@ -3779,33 +3370,79 @@
   }
 
   @override
-  int get hashCode => Object.hash(lspHashCode(documentSelector),
-      lspHashCode(codeActionKinds), resolveProvider, workDoneProgress);
+  int get hashCode => Object.hash(
+        lspHashCode(codeActionKinds),
+        lspHashCode(documentSelector),
+        resolveProvider,
+        workDoneProgress,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
 }
 
+/// The reason why code actions were requested.
+///  @since 3.17.0
+class CodeActionTriggerKind implements ToJsonable {
+  const CodeActionTriggerKind(this._value);
+  const CodeActionTriggerKind.fromJson(this._value);
+
+  final int _value;
+
+  static bool canParse(Object? obj, LspJsonReporter reporter) {
+    return obj is int;
+  }
+
+  /// Code actions were requested automatically.
+  ///
+  /// This typically happens when current selection in a file changes, but can
+  /// also be triggered when file content changes.
+  static const Automatic = CodeActionTriggerKind(2);
+
+  /// Code actions were explicitly requested by the user or by an extension.
+  static const Invoked = CodeActionTriggerKind(1);
+
+  @override
+  Object toJson() => _value;
+
+  @override
+  String toString() => _value.toString();
+
+  @override
+  int get hashCode => _value.hashCode;
+
+  @override
+  bool operator ==(Object other) =>
+      other is CodeActionTriggerKind && other._value == _value;
+}
+
 /// Structure to capture a description for an error code.
 ///  @since 3.16.0
 class CodeDescription implements ToJsonable {
-  static const jsonHandler =
-      LspJsonHandler(CodeDescription.canParse, CodeDescription.fromJson);
+  static const jsonHandler = LspJsonHandler(
+    CodeDescription.canParse,
+    CodeDescription.fromJson,
+  );
 
-  CodeDescription({required this.href});
+  CodeDescription({
+    required this.href,
+  });
   static CodeDescription fromJson(Map<String, Object?> json) {
     final hrefJson = json['href'];
     final href = hrefJson as String;
-    return CodeDescription(href: href);
+    return CodeDescription(
+      href: href,
+    );
   }
 
   /// An URI to open with more information about the diagnostic error.
   final String href;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['href'] = href;
-    return __result;
+    var result = <String, Object?>{};
+    result['href'] = href;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -3821,7 +3458,7 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(href is String)) {
+        if (href is! String) {
           reporter.reportError('must be of type String');
           return false;
         }
@@ -3857,20 +3494,30 @@
 /// performance reasons the creation of a code lens and resolving should be done
 /// in two stages.
 class CodeLens implements ToJsonable {
-  static const jsonHandler =
-      LspJsonHandler(CodeLens.canParse, CodeLens.fromJson);
+  static const jsonHandler = LspJsonHandler(
+    CodeLens.canParse,
+    CodeLens.fromJson,
+  );
 
-  CodeLens({required this.range, this.command, this.data});
+  CodeLens({
+    this.command,
+    this.data,
+    required this.range,
+  });
   static CodeLens fromJson(Map<String, Object?> json) {
-    final rangeJson = json['range'];
-    final range = Range.fromJson(rangeJson as Map<String, Object?>);
     final commandJson = json['command'];
     final command = commandJson != null
         ? Command.fromJson(commandJson as Map<String, Object?>)
         : null;
     final dataJson = json['data'];
     final data = dataJson;
-    return CodeLens(range: range, command: command, data: data);
+    final rangeJson = json['range'];
+    final range = Range.fromJson(rangeJson as Map<String, Object?>);
+    return CodeLens(
+      command: command,
+      data: data,
+      range: range,
+    );
   }
 
   /// The command this code lens represents.
@@ -3884,20 +3531,31 @@
   /// line.
   final Range range;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['range'] = range.toJson();
+    var result = <String, Object?>{};
     if (command != null) {
-      __result['command'] = command?.toJson();
+      result['command'] = command?.toJson();
     }
     if (data != null) {
-      __result['data'] = data;
+      result['data'] = data;
     }
-    return __result;
+    result['range'] = range.toJson();
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
+      reporter.push('command');
+      try {
+        final command = obj['command'];
+        if (command != null && !Command.canParse(command, reporter)) {
+          reporter.reportError('must be of type Command');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
       reporter.push('range');
       try {
         if (!obj.containsKey('range')) {
@@ -3909,23 +3567,13 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(Range.canParse(range, reporter))) {
+        if (!Range.canParse(range, reporter)) {
           reporter.reportError('must be of type Range');
           return false;
         }
       } finally {
         reporter.pop();
       }
-      reporter.push('command');
-      try {
-        final command = obj['command'];
-        if (command != null && !(Command.canParse(command, reporter))) {
-          reporter.reportError('must be of type Command');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       return true;
     } else {
       reporter.reportError('must be of type CodeLens');
@@ -3936,16 +3584,20 @@
   @override
   bool operator ==(Object other) {
     if (other is CodeLens && other.runtimeType == CodeLens) {
-      return range == other.range &&
-          command == other.command &&
+      return command == other.command &&
           data == other.data &&
+          range == other.range &&
           true;
     }
     return false;
   }
 
   @override
-  int get hashCode => Object.hash(range, command, data);
+  int get hashCode => Object.hash(
+        command,
+        data,
+        range,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
@@ -3953,24 +3605,31 @@
 
 class CodeLensClientCapabilities implements ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      CodeLensClientCapabilities.canParse, CodeLensClientCapabilities.fromJson);
+    CodeLensClientCapabilities.canParse,
+    CodeLensClientCapabilities.fromJson,
+  );
 
-  CodeLensClientCapabilities({this.dynamicRegistration});
+  CodeLensClientCapabilities({
+    this.dynamicRegistration,
+  });
   static CodeLensClientCapabilities fromJson(Map<String, Object?> json) {
     final dynamicRegistrationJson = json['dynamicRegistration'];
     final dynamicRegistration = dynamicRegistrationJson as bool?;
-    return CodeLensClientCapabilities(dynamicRegistration: dynamicRegistration);
+    return CodeLensClientCapabilities(
+      dynamicRegistration: dynamicRegistration,
+    );
   }
 
   /// Whether code lens supports dynamic registration.
   final bool? dynamicRegistration;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
+    var result = <String, Object?>{};
     if (dynamicRegistration != null) {
-      __result['dynamicRegistration'] = dynamicRegistration;
+      result['dynamicRegistration'] = dynamicRegistration;
     }
-    return __result;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -3978,7 +3637,7 @@
       reporter.push('dynamicRegistration');
       try {
         final dynamicRegistration = obj['dynamicRegistration'];
-        if (dynamicRegistration != null && !(dynamicRegistration is bool)) {
+        if (dynamicRegistration != null && dynamicRegistration is! bool) {
           reporter.reportError('must be of type bool');
           return false;
         }
@@ -4009,10 +3668,15 @@
 }
 
 class CodeLensOptions implements WorkDoneProgressOptions, ToJsonable {
-  static const jsonHandler =
-      LspJsonHandler(CodeLensOptions.canParse, CodeLensOptions.fromJson);
+  static const jsonHandler = LspJsonHandler(
+    CodeLensOptions.canParse,
+    CodeLensOptions.fromJson,
+  );
 
-  CodeLensOptions({this.resolveProvider, this.workDoneProgress});
+  CodeLensOptions({
+    this.resolveProvider,
+    this.workDoneProgress,
+  });
   static CodeLensOptions fromJson(Map<String, Object?> json) {
     if (CodeLensRegistrationOptions.canParse(json, nullLspJsonReporter)) {
       return CodeLensRegistrationOptions.fromJson(json);
@@ -4022,22 +3686,26 @@
     final workDoneProgressJson = json['workDoneProgress'];
     final workDoneProgress = workDoneProgressJson as bool?;
     return CodeLensOptions(
-        resolveProvider: resolveProvider, workDoneProgress: workDoneProgress);
+      resolveProvider: resolveProvider,
+      workDoneProgress: workDoneProgress,
+    );
   }
 
   /// Code lens has a resolve provider as well.
   final bool? resolveProvider;
+  @override
   final bool? workDoneProgress;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
+    var result = <String, Object?>{};
     if (resolveProvider != null) {
-      __result['resolveProvider'] = resolveProvider;
+      result['resolveProvider'] = resolveProvider;
     }
     if (workDoneProgress != null) {
-      __result['workDoneProgress'] = workDoneProgress;
+      result['workDoneProgress'] = workDoneProgress;
     }
-    return __result;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -4045,7 +3713,7 @@
       reporter.push('resolveProvider');
       try {
         final resolveProvider = obj['resolveProvider'];
-        if (resolveProvider != null && !(resolveProvider is bool)) {
+        if (resolveProvider != null && resolveProvider is! bool) {
           reporter.reportError('must be of type bool');
           return false;
         }
@@ -4055,7 +3723,7 @@
       reporter.push('workDoneProgress');
       try {
         final workDoneProgress = obj['workDoneProgress'];
-        if (workDoneProgress != null && !(workDoneProgress is bool)) {
+        if (workDoneProgress != null && workDoneProgress is! bool) {
           reporter.reportError('must be of type bool');
           return false;
         }
@@ -4080,22 +3748,36 @@
   }
 
   @override
-  int get hashCode => Object.hash(resolveProvider, workDoneProgress);
+  int get hashCode => Object.hash(
+        resolveProvider,
+        workDoneProgress,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
 }
 
 class CodeLensParams
-    implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
-  static const jsonHandler =
-      LspJsonHandler(CodeLensParams.canParse, CodeLensParams.fromJson);
+    implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
+  static const jsonHandler = LspJsonHandler(
+    CodeLensParams.canParse,
+    CodeLensParams.fromJson,
+  );
 
-  CodeLensParams(
-      {required this.textDocument,
-      this.workDoneToken,
-      this.partialResultToken});
+  CodeLensParams({
+    this.partialResultToken,
+    required this.textDocument,
+    this.workDoneToken,
+  });
   static CodeLensParams fromJson(Map<String, Object?> json) {
+    final partialResultTokenJson = json['partialResultToken'];
+    final partialResultToken = partialResultTokenJson == null
+        ? null
+        : (partialResultTokenJson is int
+            ? Either2<int, String>.t1(partialResultTokenJson)
+            : (partialResultTokenJson is String
+                ? Either2<int, String>.t2(partialResultTokenJson)
+                : (throw '''$partialResultTokenJson was not one of (int, String)''')));
     final textDocumentJson = json['textDocument'];
     final textDocument = TextDocumentIdentifier.fromJson(
         textDocumentJson as Map<String, Object?>);
@@ -4107,44 +3789,52 @@
             : (workDoneTokenJson is String
                 ? Either2<int, String>.t2(workDoneTokenJson)
                 : (throw '''$workDoneTokenJson was not one of (int, String)''')));
-    final partialResultTokenJson = json['partialResultToken'];
-    final partialResultToken = partialResultTokenJson == null
-        ? null
-        : (partialResultTokenJson is int
-            ? Either2<int, String>.t1(partialResultTokenJson)
-            : (partialResultTokenJson is String
-                ? Either2<int, String>.t2(partialResultTokenJson)
-                : (throw '''$partialResultTokenJson was not one of (int, String)''')));
     return CodeLensParams(
-        textDocument: textDocument,
-        workDoneToken: workDoneToken,
-        partialResultToken: partialResultToken);
+      partialResultToken: partialResultToken,
+      textDocument: textDocument,
+      workDoneToken: workDoneToken,
+    );
   }
 
   /// An optional token that a server can use to report partial results (e.g.
   /// streaming) to the client.
+  @override
   final Either2<int, String>? partialResultToken;
 
   /// The document to request code lens for.
   final TextDocumentIdentifier textDocument;
 
   /// An optional token that a server can use to report work done progress.
+  @override
   final Either2<int, String>? workDoneToken;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['textDocument'] = textDocument.toJson();
-    if (workDoneToken != null) {
-      __result['workDoneToken'] = workDoneToken;
-    }
+    var result = <String, Object?>{};
     if (partialResultToken != null) {
-      __result['partialResultToken'] = partialResultToken;
+      result['partialResultToken'] = partialResultToken;
     }
-    return __result;
+    result['textDocument'] = textDocument.toJson();
+    if (workDoneToken != null) {
+      result['workDoneToken'] = workDoneToken;
+    }
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
+      reporter.push('partialResultToken');
+      try {
+        final partialResultToken = obj['partialResultToken'];
+        if (partialResultToken != null &&
+            partialResultToken is! int &&
+            partialResultToken is! String) {
+          reporter.reportError('must be of type Either2<int, String>');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
       reporter.push('textDocument');
       try {
         if (!obj.containsKey('textDocument')) {
@@ -4156,7 +3846,7 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(TextDocumentIdentifier.canParse(textDocument, reporter))) {
+        if (!TextDocumentIdentifier.canParse(textDocument, reporter)) {
           reporter.reportError('must be of type TextDocumentIdentifier');
           return false;
         }
@@ -4167,18 +3857,8 @@
       try {
         final workDoneToken = obj['workDoneToken'];
         if (workDoneToken != null &&
-            !((workDoneToken is int || workDoneToken is String))) {
-          reporter.reportError('must be of type Either2<int, String>');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('partialResultToken');
-      try {
-        final partialResultToken = obj['partialResultToken'];
-        if (partialResultToken != null &&
-            !((partialResultToken is int || partialResultToken is String))) {
+            workDoneToken is! int &&
+            workDoneToken is! String) {
           reporter.reportError('must be of type Either2<int, String>');
           return false;
         }
@@ -4195,63 +3875,76 @@
   @override
   bool operator ==(Object other) {
     if (other is CodeLensParams && other.runtimeType == CodeLensParams) {
-      return textDocument == other.textDocument &&
+      return partialResultToken == other.partialResultToken &&
+          textDocument == other.textDocument &&
           workDoneToken == other.workDoneToken &&
-          partialResultToken == other.partialResultToken &&
           true;
     }
     return false;
   }
 
   @override
-  int get hashCode =>
-      Object.hash(textDocument, workDoneToken, partialResultToken);
+  int get hashCode => Object.hash(
+        partialResultToken,
+        textDocument,
+        workDoneToken,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
 }
 
 class CodeLensRegistrationOptions
-    implements TextDocumentRegistrationOptions, CodeLensOptions, ToJsonable {
+    implements CodeLensOptions, TextDocumentRegistrationOptions, ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      CodeLensRegistrationOptions.canParse,
-      CodeLensRegistrationOptions.fromJson);
+    CodeLensRegistrationOptions.canParse,
+    CodeLensRegistrationOptions.fromJson,
+  );
 
-  CodeLensRegistrationOptions(
-      {this.documentSelector, this.resolveProvider, this.workDoneProgress});
+  CodeLensRegistrationOptions({
+    this.documentSelector,
+    this.resolveProvider,
+    this.workDoneProgress,
+  });
   static CodeLensRegistrationOptions fromJson(Map<String, Object?> json) {
     final documentSelectorJson = json['documentSelector'];
     final documentSelector = (documentSelectorJson as List<Object?>?)
-        ?.map((item) => DocumentFilter.fromJson(item as Map<String, Object?>))
+        ?.map((item) =>
+            TextDocumentFilterWithScheme.fromJson(item as Map<String, Object?>))
         .toList();
     final resolveProviderJson = json['resolveProvider'];
     final resolveProvider = resolveProviderJson as bool?;
     final workDoneProgressJson = json['workDoneProgress'];
     final workDoneProgress = workDoneProgressJson as bool?;
     return CodeLensRegistrationOptions(
-        documentSelector: documentSelector,
-        resolveProvider: resolveProvider,
-        workDoneProgress: workDoneProgress);
+      documentSelector: documentSelector,
+      resolveProvider: resolveProvider,
+      workDoneProgress: workDoneProgress,
+    );
   }
 
   /// A document selector to identify the scope of the registration. If set to
   /// null the document selector provided on the client side will be used.
-  final List<DocumentFilter>? documentSelector;
+  @override
+  final List<TextDocumentFilterWithScheme>? documentSelector;
 
   /// Code lens has a resolve provider as well.
+  @override
   final bool? resolveProvider;
+  @override
   final bool? workDoneProgress;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['documentSelector'] = documentSelector;
+    var result = <String, Object?>{};
+    result['documentSelector'] = documentSelector;
     if (resolveProvider != null) {
-      __result['resolveProvider'] = resolveProvider;
+      result['resolveProvider'] = resolveProvider;
     }
     if (workDoneProgress != null) {
-      __result['workDoneProgress'] = workDoneProgress;
+      result['workDoneProgress'] = workDoneProgress;
     }
-    return __result;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -4264,10 +3957,11 @@
         }
         final documentSelector = obj['documentSelector'];
         if (documentSelector != null &&
-            !((documentSelector is List<Object?> &&
-                (documentSelector.every(
-                    (item) => DocumentFilter.canParse(item, reporter)))))) {
-          reporter.reportError('must be of type List<DocumentFilter>');
+            (documentSelector is! List<Object?> ||
+                documentSelector.any((item) =>
+                    !TextDocumentFilterWithScheme.canParse(item, reporter)))) {
+          reporter.reportError(
+              'must be of type List<TextDocumentFilterWithScheme>');
           return false;
         }
       } finally {
@@ -4276,7 +3970,7 @@
       reporter.push('resolveProvider');
       try {
         final resolveProvider = obj['resolveProvider'];
-        if (resolveProvider != null && !(resolveProvider is bool)) {
+        if (resolveProvider != null && resolveProvider is! bool) {
           reporter.reportError('must be of type bool');
           return false;
         }
@@ -4286,7 +3980,7 @@
       reporter.push('workDoneProgress');
       try {
         final workDoneProgress = obj['workDoneProgress'];
-        if (workDoneProgress != null && !(workDoneProgress is bool)) {
+        if (workDoneProgress != null && workDoneProgress is! bool) {
           reporter.reportError('must be of type bool');
           return false;
         }
@@ -4304,8 +3998,12 @@
   bool operator ==(Object other) {
     if (other is CodeLensRegistrationOptions &&
         other.runtimeType == CodeLensRegistrationOptions) {
-      return listEqual(documentSelector, other.documentSelector,
-              (DocumentFilter a, DocumentFilter b) => a == b) &&
+      return listEqual(
+              documentSelector,
+              other.documentSelector,
+              (TextDocumentFilterWithScheme a,
+                      TextDocumentFilterWithScheme b) =>
+                  a == b) &&
           resolveProvider == other.resolveProvider &&
           workDoneProgress == other.workDoneProgress &&
           true;
@@ -4315,7 +4013,10 @@
 
   @override
   int get hashCode => Object.hash(
-      lspHashCode(documentSelector), resolveProvider, workDoneProgress);
+        lspHashCode(documentSelector),
+        resolveProvider,
+        workDoneProgress,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
@@ -4323,15 +4024,20 @@
 
 class CodeLensWorkspaceClientCapabilities implements ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      CodeLensWorkspaceClientCapabilities.canParse,
-      CodeLensWorkspaceClientCapabilities.fromJson);
+    CodeLensWorkspaceClientCapabilities.canParse,
+    CodeLensWorkspaceClientCapabilities.fromJson,
+  );
 
-  CodeLensWorkspaceClientCapabilities({this.refreshSupport});
+  CodeLensWorkspaceClientCapabilities({
+    this.refreshSupport,
+  });
   static CodeLensWorkspaceClientCapabilities fromJson(
       Map<String, Object?> json) {
     final refreshSupportJson = json['refreshSupport'];
     final refreshSupport = refreshSupportJson as bool?;
-    return CodeLensWorkspaceClientCapabilities(refreshSupport: refreshSupport);
+    return CodeLensWorkspaceClientCapabilities(
+      refreshSupport: refreshSupport,
+    );
   }
 
   /// Whether the client implementation supports a refresh request sent from the
@@ -4343,12 +4049,13 @@
   /// change that requires such a calculation.
   final bool? refreshSupport;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
+    var result = <String, Object?>{};
     if (refreshSupport != null) {
-      __result['refreshSupport'] = refreshSupport;
+      result['refreshSupport'] = refreshSupport;
     }
-    return __result;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
@@ -4356,7 +4063,7 @@
       reporter.push('refreshSupport');
       try {
         final refreshSupport = obj['refreshSupport'];
-        if (refreshSupport != null && !(refreshSupport is bool)) {
+        if (refreshSupport != null && refreshSupport is! bool) {
           reporter.reportError('must be of type bool');
           return false;
         }
@@ -4389,23 +4096,32 @@
 
 /// Represents a color in RGBA space.
 class Color implements ToJsonable {
-  static const jsonHandler = LspJsonHandler(Color.canParse, Color.fromJson);
+  static const jsonHandler = LspJsonHandler(
+    Color.canParse,
+    Color.fromJson,
+  );
 
-  Color(
-      {required this.red,
-      required this.green,
-      required this.blue,
-      required this.alpha});
+  Color({
+    required this.alpha,
+    required this.blue,
+    required this.green,
+    required this.red,
+  });
   static Color fromJson(Map<String, Object?> json) {
-    final redJson = json['red'];
-    final red = redJson as num;
-    final greenJson = json['green'];
-    final green = greenJson as num;
-    final blueJson = json['blue'];
-    final blue = blueJson as num;
     final alphaJson = json['alpha'];
     final alpha = alphaJson as num;
-    return Color(red: red, green: green, blue: blue, alpha: alpha);
+    final blueJson = json['blue'];
+    final blue = blueJson as num;
+    final greenJson = json['green'];
+    final green = greenJson as num;
+    final redJson = json['red'];
+    final red = redJson as num;
+    return Color(
+      alpha: alpha,
+      blue: blue,
+      green: green,
+      red: red,
+    );
   }
 
   /// The alpha component of this color in the range [0-1].
@@ -4420,47 +4136,30 @@
   /// The red component of this color in the range [0-1].
   final num red;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['red'] = red;
-    __result['green'] = green;
-    __result['blue'] = blue;
-    __result['alpha'] = alpha;
-    return __result;
+    var result = <String, Object?>{};
+    result['alpha'] = alpha;
+    result['blue'] = blue;
+    result['green'] = green;
+    result['red'] = red;
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
-      reporter.push('red');
+      reporter.push('alpha');
       try {
-        if (!obj.containsKey('red')) {
+        if (!obj.containsKey('alpha')) {
           reporter.reportError('must not be undefined');
           return false;
         }
-        final red = obj['red'];
-        if (red == null) {
+        final alpha = obj['alpha'];
+        if (alpha == null) {
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(red is num)) {
-          reporter.reportError('must be of type num');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
-      reporter.push('green');
-      try {
-        if (!obj.containsKey('green')) {
-          reporter.reportError('must not be undefined');
-          return false;
-        }
-        final green = obj['green'];
-        if (green == null) {
-          reporter.reportError('must not be null');
-          return false;
-        }
-        if (!(green is num)) {
+        if (alpha is! num) {
           reporter.reportError('must be of type num');
           return false;
         }
@@ -4478,25 +4177,43 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(blue is num)) {
+        if (blue is! num) {
           reporter.reportError('must be of type num');
           return false;
         }
       } finally {
         reporter.pop();
       }
-      reporter.push('alpha');
+      reporter.push('green');
       try {
-        if (!obj.containsKey('alpha')) {
+        if (!obj.containsKey('green')) {
           reporter.reportError('must not be undefined');
           return false;
         }
-        final alpha = obj['alpha'];
-        if (alpha == null) {
+        final green = obj['green'];
+        if (green == null) {
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(alpha is num)) {
+        if (green is! num) {
+          reporter.reportError('must be of type num');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
+      reporter.push('red');
+      try {
+        if (!obj.containsKey('red')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final red = obj['red'];
+        if (red == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (red is! num) {
           reporter.reportError('must be of type num');
           return false;
         }
@@ -4513,33 +4230,46 @@
   @override
   bool operator ==(Object other) {
     if (other is Color && other.runtimeType == Color) {
-      return red == other.red &&
-          green == other.green &&
+      return alpha == other.alpha &&
           blue == other.blue &&
-          alpha == other.alpha &&
+          green == other.green &&
+          red == other.red &&
           true;
     }
     return false;
   }
 
   @override
-  int get hashCode => Object.hash(red, green, blue, alpha);
+  int get hashCode => Object.hash(
+        alpha,
+        blue,
+        green,
+        red,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
 }
 
 class ColorInformation implements ToJsonable {
-  static const jsonHandler =
-      LspJsonHandler(ColorInformation.canParse, ColorInformation.fromJson);
+  static const jsonHandler = LspJsonHandler(
+    ColorInformation.canParse,
+    ColorInformation.fromJson,
+  );
 
-  ColorInformation({required this.range, required this.color});
+  ColorInformation({
+    required this.color,
+    required this.range,
+  });
   static ColorInformation fromJson(Map<String, Object?> json) {
-    final rangeJson = json['range'];
-    final range = Range.fromJson(rangeJson as Map<String, Object?>);
     final colorJson = json['color'];
     final color = Color.fromJson(colorJson as Map<String, Object?>);
-    return ColorInformation(range: range, color: color);
+    final rangeJson = json['range'];
+    final range = Range.fromJson(rangeJson as Map<String, Object?>);
+    return ColorInformation(
+      color: color,
+      range: range,
+    );
   }
 
   /// The actual color value for this color range.
@@ -4548,33 +4278,16 @@
   /// The range in the document where this color appears.
   final Range range;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['range'] = range.toJson();
-    __result['color'] = color.toJson();
-    return __result;
+    var result = <String, Object?>{};
+    result['color'] = color.toJson();
+    result['range'] = range.toJson();
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
-      reporter.push('range');
-      try {
-        if (!obj.containsKey('range')) {
-          reporter.reportError('must not be undefined');
-          return false;
-        }
-        final range = obj['range'];
-        if (range == null) {
-          reporter.reportError('must not be null');
-          return false;
-        }
-        if (!(Range.canParse(range, reporter))) {
-          reporter.reportError('must be of type Range');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       reporter.push('color');
       try {
         if (!obj.containsKey('color')) {
@@ -4586,13 +4299,31 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(Color.canParse(color, reporter))) {
+        if (!Color.canParse(color, reporter)) {
           reporter.reportError('must be of type Color');
           return false;
         }
       } finally {
         reporter.pop();
       }
+      reporter.push('range');
+      try {
+        if (!obj.containsKey('range')) {
+          reporter.reportError('must not be undefined');
+          return false;
+        }
+        final range = obj['range'];
+        if (range == null) {
+          reporter.reportError('must not be null');
+          return false;
+        }
+        if (!Range.canParse(range, reporter)) {
+          reporter.reportError('must be of type Range');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
       return true;
     } else {
       reporter.reportError('must be of type ColorInformation');
@@ -4603,39 +4334,48 @@
   @override
   bool operator ==(Object other) {
     if (other is ColorInformation && other.runtimeType == ColorInformation) {
-      return range == other.range && color == other.color && true;
+      return color == other.color && range == other.range && true;
     }
     return false;
   }
 
   @override
-  int get hashCode => Object.hash(range, color);
+  int get hashCode => Object.hash(
+        color,
+        range,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
 }
 
 class ColorPresentation implements ToJsonable {
-  static const jsonHandler =
-      LspJsonHandler(ColorPresentation.canParse, ColorPresentation.fromJson);
+  static const jsonHandler = LspJsonHandler(
+    ColorPresentation.canParse,
+    ColorPresentation.fromJson,
+  );
 
-  ColorPresentation(
-      {required this.label, this.textEdit, this.additionalTextEdits});
+  ColorPresentation({
+    this.additionalTextEdits,
+    required this.label,
+    this.textEdit,
+  });
   static ColorPresentation fromJson(Map<String, Object?> json) {
+    final additionalTextEditsJson = json['additionalTextEdits'];
+    final additionalTextEdits = (additionalTextEditsJson as List<Object?>?)
+        ?.map((item) => TextEdit.fromJson(item as Map<String, Object?>))
+        .toList();
     final labelJson = json['label'];
     final label = labelJson as String;
     final textEditJson = json['textEdit'];
     final textEdit = textEditJson != null
         ? TextEdit.fromJson(textEditJson as Map<String, Object?>)
         : null;
-    final additionalTextEditsJson = json['additionalTextEdits'];
-    final additionalTextEdits = (additionalTextEditsJson as List<Object?>?)
-        ?.map((item) => TextEdit.fromJson(item as Map<String, Object?>))
-        .toList();
     return ColorPresentation(
-        label: label,
-        textEdit: textEdit,
-        additionalTextEdits: additionalTextEdits);
+      additionalTextEdits: additionalTextEdits,
+      label: label,
+      textEdit: textEdit,
+    );
   }
 
   /// An optional array of additional text edits ([TextEdit]) that are applied
@@ -4649,25 +4389,39 @@
   final String label;
 
   /// An edit ([TextEdit]) which is applied to a document when selecting this
-  /// presentation for the color.  When `falsy` the
+  /// presentation for the color. When `falsy` the
   /// [label](#ColorPresentation.label) is used.
   final TextEdit? textEdit;
 
+  @override
   Map<String, Object?> toJson() {
-    var __result = <String, Object?>{};
-    __result['label'] = label;
-    if (textEdit != null) {
-      __result['textEdit'] = textEdit?.toJson();
-    }
+    var result = <String, Object?>{};
     if (additionalTextEdits != null) {
-      __result['additionalTextEdits'] =
+      result['additionalTextEdits'] =
           additionalTextEdits?.map((item) => item.toJson()).toList();
     }
-    return __result;
+    result['label'] = label;
+    if (textEdit != null) {
+      result['textEdit'] = textEdit?.toJson();
+    }
+    return result;
   }
 
   static bool canParse(Object? obj, LspJsonReporter reporter) {
     if (obj is Map<String, Object?>) {
+      reporter.push('additionalTextEdits');
+      try {
+        final additionalTextEdits = obj['additionalTextEdits'];
+        if (additionalTextEdits != null &&
+            (additionalTextEdits is! List<Object?> ||
+                additionalTextEdits
+                    .any((item) => !TextEdit.canParse(item, reporter)))) {
+          reporter.reportError('must be of type List<TextEdit>');
+          return false;
+        }
+      } finally {
+        reporter.pop();
+      }
       reporter.push('label');
       try {
         if (!obj.containsKey('label')) {
@@ -4679,7 +4433,7 @@
           reporter.reportError('must not be null');
           return false;
         }
-        if (!(label is String)) {
+        if (label is! String) {
           reporter.reportError('must be of type String');
           return false;
         }
@@ -4689,26 +4443,13 @@
       reporter.push('textEdit');
       try {
         final textEdit = obj['textEdit'];
-        if (textEdit != null && !(TextEdit.canParse(textEdit, reporter))) {
+        if (textEdit != null && !TextEdit.canParse(textEdit, reporter)) {
           reporter.reportError('must be of type TextEdit');
           return false;
         }
       } finally {
         reporter.pop();
       }
-      reporter.push('additionalTextEdits');
-      try {
-        final additionalTextEdits = obj['additionalTextEdits'];
-        if (additionalTextEdits != null &&
-            !((additionalTextEdits is List<Object?> &&
-                (additionalTextEdits
-                    .every((item) => TextEdit.canParse(item, reporter)))))) {
-          reporter.reportError('must be of type List<TextEdit>');
-          return false;
-        }
-      } finally {
-        reporter.pop();
-      }
       return true;
     } else {
       reporter.reportError('must be of type ColorPresentation');
@@ -4719,50 +4460,43 @@
   @override
   bool operator ==(Object other) {
     if (other is ColorPresentation && other.runtimeType == ColorPresentation) {
-      return label == other.label &&
-          textEdit == other.textEdit &&
-          listEqual(additionalTextEdits, other.additionalTextEdits,
+      return listEqual(additionalTextEdits, other.additionalTextEdits,
               (TextEdit a, TextEdit b) => a == b) &&
+          label == other.label &&
+          textEdit == other.textEdit &&
           true;
     }
     return false;
   }
 
   @override
-  int get hashCode =>
-      Object.hash(label, textEdit, lspHashCode(additionalTextEdits));
+  int get hashCode => Object.hash(
+        lspHashCode(additionalTextEdits),
+        label,
+        textEdit,
+      );
 
   @override
   String toString() => jsonEncoder.convert(toJson());
 }
 
 class ColorPresentationParams
-    implements WorkDoneProgressParams, PartialResultParams, ToJsonable {
+    implements PartialResultParams, WorkDoneProgressParams, ToJsonable {
   static const jsonHandler = LspJsonHandler(
-      ColorPresentationParams.canParse, ColorPresentationParams.fromJson);
+    ColorPresentationParams.canParse,
+    ColorPresentationParams.fromJson,
+  );
 
-  ColorPresentationParams(
-      {required this.textDocument,
-      required this.color,
-      required this.range,
-      this.workDoneToken,
-      this.partialResultToken});
+  ColorPresentationParams({
+    required this.color,
+    this.partialResultToken,
+    required this.range,
+    required this.textDocument,
+    this.workDoneToken,
+  });
   static ColorPresentationParams fromJson(Map<String, Object?> json) {
-    final textDocumentJson = json['textDocument'];
-    final textDocument = TextDocumentIdentifier.fromJson(
-        textDocumentJson as Map<String, Object?>);
     final colorJson = json['color'];
     final color = Color.fromJson(colorJson as Map<String, Object?>);
-    final rangeJson = json['range'];
-    final range = Range.fromJson(rangeJson as Map<String, Object?>);
-    final workDoneTokenJson = json['workDoneToken'];
-    final workDoneToken = workDoneTokenJson == null
-        ? null
-        : (workDoneTokenJson is int
-            ? Either2<int, String>.t1(workDoneTokenJson)
-            : (workDoneTokenJson is String
-                ? Either2<int, String>.t2(workDoneTokenJson)
-                : (throw '''$workDoneTokenJson was not one of (int, String)''')));
     final partialResultTokenJson = json['partialResultToken'];
     final partialResultToken = partialResultTokenJson == null
         ? null
@@ -4771,12 +4505,26 @@
             : (partialResultTokenJson is String
                 ? Either2<int, String>.t2(partialResultTokenJson)
                 : (throw '''$partialResultTokenJson was not one of (int, String)''')));
+    final rangeJson = json['range'];
+    final range = Range.fromJson(rangeJson as Map<String, Object?>);
+    final textDocumentJson = json['textDocument'];
+    final textDocument = TextDocumentIdentifier.fromJson(
+        textDocumentJson as Map<String, Object?>);
+    final workDoneTokenJson = json['workDoneToken'];
+    final workDoneToken = workDoneTokenJson == null
+        ? null
+        : (workDoneTokenJson is int
+            ? Either2<int, String>.t1(workDoneTokenJson)
+            : (workDoneTokenJson is String
+                ? Either2<int, String>.t2(workDoneTokenJson)
+                : (throw '''$workDoneTokenJson was not one of (int, String)''')));
     return ColorPresentationParams(
-        textDocument: textDocument,
-        color: color,
-        range: range,
-        workDoneToken: workDoneToken,
-        partialResultToken: partialResultToken);
+      color: color,
+      partialResultToken: partialResultToken,
+      range: range,
+      textDocument: textDocument,
+      workDoneToken: workDoneToken,
+    );
   }
 
   /// The color information to request presentations for.
@@ -4784,6 +4532,7 @@
 
   /// An optional token that a server can use to report partial results (e.g.
   /// streaming) to the client.
+  @override
   final Either2<int, String>? partialResultToken;
 
   /// The range where the color would be inserted. Serves as a context.
@@ -4793,42 +4542,26 @@
   final TextDocumentIdentifier textDocument;
 
   /// An optional token that a server can use to report work done progress.
+  @override
   final Either2<int, String>? workDoneToken;
 
+  @override