Skip to content

Commit b91f464

Browse files
committed
fix(ui): switch hint decorations to deltaDecorations API for Monaco 0.55 compat
1 parent d833482 commit b91f464

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎ui/src/core/page-components/agent-detail/modals/edit-control/json-editor-view.tsx‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,13 @@ export const JsonEditorView = ({
299299
const monaco = monacoRef.current;
300300
if (!editor || !monaco || !mounted) return;
301301

302-
const decorations = editor.createDecorationsCollection();
302+
let decorationIds: string[] = [];
303303
const updateHints = () => {
304304
const model = editor.getModel();
305305
if (!model) return;
306306
try {
307-
decorations.set(
307+
decorationIds = editor.deltaDecorations(
308+
decorationIds,
308309
getEmptyValueHints(monaco, model, autocompleteContext).map((h) => ({
309310
range: h.range,
310311
options: {
@@ -317,7 +318,7 @@ export const JsonEditorView = ({
317318
}))
318319
);
319320
} catch {
320-
decorations.clear();
321+
decorationIds = editor.deltaDecorations(decorationIds, []);
321322
}
322323
};
323324
updateHints();
@@ -422,7 +423,7 @@ export const JsonEditorView = ({
422423
if (hintTimer) window.clearTimeout(hintTimer);
423424
if (commaTimer) window.clearTimeout(commaTimer);
424425
disposable.dispose();
425-
decorations.clear();
426+
editor.deltaDecorations(decorationIds, []);
426427
};
427428
}, [mounted, autocompleteContext, editorMode, evaluators, handleJsonChange]);
428429

0 commit comments

Comments
 (0)