[ty] Fix playground inlay hint location (#22200)

This commit is contained in:
Matthew Mckee
2025-12-26 08:20:57 +00:00
committed by GitHub
parent 19b10993e1
commit 1ec3503cc3

View File

@@ -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,