【发布时间】:2022-08-24 03:42:06
【问题描述】:
我正在使用deltaDecorations 在我的编辑器中显示错误。
这是我的代码:https://gist.github.com/dinager/41578bd658b60cc912a6023f80431810
结果如下:
我正在尝试通过添加到样式来将调整大小属性添加到编辑器
resize: both;overflow: auto;
但是随后悬停消息被编辑器的边缘部分隐藏
正如您在下面的附加图片中看到的 - 编辑器现在可以调整大小(右下角),但悬停消息部分隐藏
如何添加调整大小属性以不隐藏元素?
另一个问题:我可以让悬停消息在编辑器内浮动,这意味着如果它在顶行它应该浮动到底部,如果在编辑器的一侧浮动到中间,等等。
附加代码添加markerDecorations(也存在于顶部的要点链接中):
this.markerDecorations = codeEditor.deltaDecorations(this.markerDecorations, [
{
range: new monaco.Range(pos.startLine, pos.startColumn, pos.endLine, pos.endColumn),
options: {
className: \'squiggly-error\',
minimap: {
color: { id: \'minimap.errorHighlight\' },
position: monaco.editor.MinimapPosition.Gutter,
},
overviewRuler: {
color: { id: \'editorOverviewRuler.errorForeground\' },
position: monaco.editor.OverviewRulerLane.Full,
},
stickiness: monaco.editor.TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges,
zIndex: 1,
hoverMessage: { value: parseResponse.error, isTrusted: false },
},
},
]);
标签: html css monaco-editor