VSCode extensions location variable

筅森魡賤 提交于 2019-11-27 09:51:40

You can get that information by the asAbsolutePath() method of the ExtensionContext.
This method gets you the absolute path of a resource for a given relative path (regarding your project root).

Therefore I suggest you to change your code to the following:

export async function activate(context: vscode.ExtensionContext) {
    const execLocation = context.asAbsolutePath("script");
    console.log("Absolute exec location: " + execLocation);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!