From 1ec3503cc3de69b5dbc9008083f4684971b32d41 Mon Sep 17 00:00:00 2001 From: Matthew Mckee Date: Fri, 26 Dec 2025 08:20:57 +0000 Subject: [PATCH] [ty] Fix playground inlay hint location (#22200) --- playground/ty/src/Editor/Editor.tsx | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/playground/ty/src/Editor/Editor.tsx b/playground/ty/src/Editor/Editor.tsx index c104a93c63..465fcd6e4f 100644 --- a/playground/ty/src/Editor/Editor.tsx +++ b/playground/ty/src/Editor/Editor.tsx @@ -454,10 +454,22 @@ class PlaygroundServer return { dispose: () => {}, hints: inlayHints.map((hint) => ({ - label: hint.label.map((part) => ({ - label: part.label, - // As of 2025-09-23, location isn't supported by Monaco which is why we don't set it - })), + label: hint.label.map((part) => { + const locationLink = part.location + ? this.mapNavigationTarget(part.location) + : undefined; + + return { + label: part.label, + // Range cannot be `undefined`. + location: locationLink?.targetSelectionRange + ? { + uri: locationLink.uri, + range: locationLink.targetSelectionRange, + } + : undefined, + }; + }), position: { lineNumber: hint.position.line, column: hint.position.column,