为什么在VS Code中禁用Nodejs断点,取决于是否在选项卡标题中显示完整路径? [英] Why are Nodejs breakpoints in VS Code disabled depending on whether the full path appears in the tab title?

查看:64
本文介绍了为什么在VS Code中禁用Nodejs断点,取决于是否在选项卡标题中显示完整路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当在一个VS Code选项卡中的完全相同的行而不是在另一行中的完全相同的行上设置时,我的Mocha测试中的断点起作用。

A breakpoint in my Mocha test works when set on the exact same line in one VS Code tab but not in another.

区别:如果出现完整路径在选项卡中,然后断点起作用。 (屏幕快照中的第二项。)

The difference: If the full path appears in the tab, then breakpoints work. (Second item in screenshot.)

但是如果没有路径的文件名出现在选项卡标题中,则断点在执行期间全部变为未验证(灰色)。

But if the filename, without path, appears in the tab header, then breakpoints all become Unverified (gray) during execution.

复制步骤:


  • 如果从资源管理器视图中打开文件,错误发生。

  • 如果使用CTRL-P打开文件(如屏幕截图所示),则通常两个
    变体都可用,并选择一个带/不带
    的变量路径给出了不同的行为。

如何在不不断检查出现哪种路径变化的情况下避免这种情况?

How can I avoid this without continually checking which path variant is appearing?

这里是我打开的GitHub票证。 )

(Here is a GitHub ticket that I opened.)

推荐答案

答案(在 GitHub线程):

我的工作空间路径在符号链接(Ubuntu)下。

My workspace path was under a symbolic link (Ubuntu).

VS代码显然取消了符号链接的引用,从而为Node提供了可以使用的路径来支持断点。

VS Code apparently dereferences symbolic links to give Node a path that it can work with, to support breakpoints.

VS代码也在我定义的工作空间文件夹中的正确引用路径(在符号链接下)显示文件。

VS Code also shows the file at the correctly referenced path in my workspace folder as I defined it (under the symbolic link).

这篇关于为什么在VS Code中禁用Nodejs断点,取决于是否在选项卡标题中显示完整路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆