什么取代了 Monaco Editor 已弃用的 deltaDecorations 函数?

Bil*_*Yan 5 monaco-editor

该文档说它已被弃用:

(method) editor.ICodeEditor.deltaDecorations(oldDecorations: string[], newDecorations: monaco.editor.IModelDeltaDecoration[]): string[]
All decorations added through this call will get the ownerId of this editor.

@deprecated

The signature '(oldDecorations: string[], newDecorations: IModelDeltaDecoration[]): string[]' of 'editor.deltaDecorations' is deprecated.

Run Code Online (Sandbox Code Playgroud)

但我发现的唯一例子仍然使用它

https://microsoft.github.io/monaco-editor/playground.html#interacting-with-the-editor-line-and-inline-decorations

该文件没有说明是什么取代了它。

put*_*uth 1

根据https://github.com/microsoft/monaco-editor/blob/main/CHANGELOG.md

软弃用 ICodeEditor.deltaDecorations,无需采用。应改用 IEditor.createDecorationsCollection API。