typescript - 如何使用它的 API 为 VsCode 扩展制作自定义排水沟指示器?
问题描述
我在一个带有突出显示的图像下方附加了我想要实现用于放置装订线指示器的自定义线的位置。与放置断点的工作方式类似,我想实现我自己的排水沟指示器系统,该系统将在悬停时显示指示器的阴影,并且可以在单击时放置。
如果可能的话,我该怎么做,文档的链接将不胜感激!
我当前使用的装饰类型是使用键绑定设置的。
const decorationType = vscode.window.createTextEditorDecorationType({
isWholeLine: true,
borderWidth: `0 0 0 0`,
backgroundColor: new vscode.ThemeColor("checkbox.border"),
gutterIconPath: path.join(__filename, "..", "..", "assets", "pin.png"),
gutterIconSize: "contain",
rangeBehavior: vscode.DecorationRangeBehavior.ClosedOpen,
});
editor.setDecorations(decorationType, [
new vscode.Range(editor.selection.active, editor.selection.active),
]);
解决方案
推荐阅读
- c++ - 需要帮助修复代码以从文件中输出正确的唯一字数
- react-native - 是否可以在 react-native 中镜像文本?
- java - 什么是填充数组列表并在页面重新加载时使其保持不变的最佳方法
- d - D:从源代码构建 - 没有预装 DMD
- python - 使用 JSON 作为 Flask 的数据存储?
- c++ - 严格的别名和二进制 I/O
- kubernetes - 如何让 CronJob 尊重夏令时?
- angular - 使用 Jasmine 参考 environment.ts 的单元测试方法
- conv-neural-network - 这个 luminoth 命令的每个部分的含义是什么?
- sql - 如何填充 SQLite 查询结果