vscode插件开发

阅读量: 鲁文奎 2021-04-22 12:04:31
Categories: Tags:

vscode插件开发

获取当前文件路径:
context.subscriptions.push(vscode.commands.registerCommand('extension.demo.getCurrentFilePath', (uri) => {
vscode.window.showInformationMessage(当前文件(夹)路径是:${uri ? uri.path : '空'});
}));

当前正在编辑的编辑器,如果没有打开文件, 则返回值editor == undefined:
let editor = vscode.window activeTextEditor
if (!editor){
return;
}

设置vscode 颜色
"workbench.colorCustomizations": {
"editor.background": "#ff0000"
}