mirror of
https://github.com/astral-sh/ruff
synced 2026-01-21 05:20:49 -05:00
[ty] Fix playground inlay hint location (#22200)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user