Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试为 vscode 编写扩展。功能是选择括号中的文本。但是一开始就卡住了。当我想如下使用位置时,它会抛出异常 var pos = new Position(1, 1);
有人可以分享一些示例代码给我吗?
只是应对迈克的回答(作为评论插入):
取决于你的进口。如果你有var vscode = require("vscode");那么你必须写var pos = new vscode.Position(1, 1);
var vscode = require("vscode");
var pos = new vscode.Position(1, 1);