【发布时间】:2018-01-19 05:12:16
【问题描述】:
在为 vscode 创建扩展时,我卡在了选择中,现在的问题是,当我通过 api 替换某些范围的 textEditor 时,它会替换该范围并选择该范围。对于 sn-ps 这是一个好主意,但我的扩展要求不是选择替换文本,我在 api 中搜索但没有找到与删除文本选择相关的任何内容(当文档为空时发生选择)
editor.edit((editBuilder)=>{ //editor is an object of active text editor
editBuilder.replace(textRange,text) // text = 'dummydummydummy'
}) //after this I got the following output
【问题讨论】:
标签: visual-studio-code vscode-extensions