如何在设置中引用 VSCode 可移植子目录的路径(相对于“Code.exe”)?

发布于 2025-01-10 10:24:42 字数 481 浏览 4 评论 0原文

我很感激你的帮助。

根据 VSCode 变量参考,我期待这样的工作:

${execPath}\data_cadu

尽管如此,${execPath} 不起作用。

如何设置适用于 Windows 的 VSCode 可移植子目录的路径(相对于“Code.exe”)?

下面的屏幕截图进一步详细说明了我尝试在 VSCode 设置中设置的路径。

谢谢你!

子目录VSCode

I'd appreciate your help.

According to VSCode Variables Reference, I was expecting something like this to work:

${execPath}\data_cadu

Nonetheless, ${execPath} didn't work.

How to set up path to subdirectory within VSCode portable for Windows (relative to 'Code.exe')?

The screenshot below details further the path I'm trying to set within VSCode settings.

Thank you!

subdirectory within VSCode

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

断爱 2025-01-17 10:24:42

在所描述的上下文中,子目录的路径与无法识别 ${execPath} 的扩展相关。我联系了扩展开发人员,他提供了一个澄清的答案:

在本例中,我只需将 ${execPath} 替换为 process.exePath 的返回值。

因此您想要的路径应该是:

<前><代码>${execPath}\..\data_cadu

请注意额外的..,因为exePath不是目录,而是exe文件。

我已经用其他扩展测试了路径“${execPath}..”,这些扩展已经识别了它。

此回复也与关于在 VSCode 可移植子目录中使用 powershell 的另一个线程保持一致,谁报告 ${execPath}\..\ 工作正常。

In the described context, the path to a subdirectory is related to an extension that wasn't recognizing ${execPath}. I contacted the extension developer, who provided a clarifying answer:

in this case I simply replace ${execPath} with the return value of the process.exePath.

Thus your desired path should be:

${execPath}\..\data_cadu

Note extra .. as exePath is not the dir but the exe file.

I already tested the path `${execPath}..' with other extensions, which have recognized it.

This reply is also aligned to another thread about using powershell within VSCode portable subdirectory, who reported that ${execPath}\..\ worked properly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文