[analysis_server] Support String IDs in log replay + run some LSP integration tests with string IDs

My previous CL made some LSP tests run with String IDs instead of ints, but those tests don't appear to go through the session logger so did not fail with the casts here.

This change adds a base integration test that also uses string IDs, which did fail on the cast, so I've updated the session logger to use `Either2<int, String>` for IDs instead.

Fixes https://github.com/dart-lang/sdk/issues/62442

Change-Id: Iee582e9ce2b8b5a1127120c987670a679d2ca76c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/473260
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
Danny Tuppeny
2026-01-21 12:24:27 -08:00
committed by Commit Queue
parent 7a441b7f9d
commit 2b88f4fea8
6 changed files with 58 additions and 20 deletions
@@ -67,6 +67,7 @@ class Either2<T1, T2> implements ToJsonable {
@override
bool operator ==(other) =>
other is Either2<T1, T2> &&
other._which == _which &&
lspEquals(other._t1, _t1) &&
lspEquals(other._t2, _t2);
@@ -111,6 +112,7 @@ class Either3<T1, T2, T3> implements ToJsonable {
@override
bool operator ==(other) =>
other is Either3<T1, T2, T3> &&
other._which == _which &&
lspEquals(other._t1, _t1) &&
lspEquals(other._t2, _t2) &&
lspEquals(other._t3, _t3);
@@ -176,6 +178,7 @@ class Either4<T1, T2, T3, T4> implements ToJsonable {
@override
bool operator ==(other) =>
other is Either4<T1, T2, T3, T4> &&
other._which == _which &&
lspEquals(other._t1, _t1) &&
lspEquals(other._t2, _t2) &&
lspEquals(other._t3, _t3) &&