该文档称已弃用:
(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.
但我发现的唯一一个例子仍然使用
https://microsoft.github.io/monaco-editor/playground.html#interacting-带有编辑器行和内联装饰
这份文件没有说明是什么取代了它。
根据https://github.com/microsoft/monaco-editor/blob/main/CHANGELOG.md,
ICodeEditor.deltaDecorations的软弃用,无需采用。应改用IEditor.createDecorationsCollection API。