From 5e0f563ee4864eb9a628f9caf9ecc2d6e6ebb8dd Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Mon, 7 Apr 2025 18:39:21 +0200 Subject: [PATCH] [red-knot] Fix stale syntax errors in playground (#17280) ## Summary React requires that `key`s are unique but the constructed key for diagnostics wasn't guaranteed when two diagnostics had the same name and location. This PR fixes this by using a disambiguator map to disambiguate the key. Fixes #17276 ## Test Plan https://github.com/user-attachments/assets/f3f9d10a-ecc4-4ffe-8676-3633a12e07ce --- playground/knot/src/Editor/Diagnostics.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/playground/knot/src/Editor/Diagnostics.tsx b/playground/knot/src/Editor/Diagnostics.tsx index 2a087c33ed..a8616c9bb0 100644 --- a/playground/knot/src/Editor/Diagnostics.tsx +++ b/playground/knot/src/Editor/Diagnostics.tsx @@ -62,9 +62,11 @@ function Items({ ); } + const uniqueIds: Map = new Map(); + return (