Why are Nodejs breakpoints in VS Code disabled depending on whether the full path appears in the tab title?

為{幸葍}努か 提交于 2019-12-12 08:28:23

问题


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.

Repro steps:

  • If you open files from the Explorer view, the bug occurs.
  • If you open files using CTRL-P, as in the screenshot, then both variants are usually available, and choosing the one with/without path gives the different behaviors.

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

(Here is a GitHub ticket that I opened.)


回答1:


Answer (figured out on the GitHub thread):

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

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

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



来源:https://stackoverflow.com/questions/56788044/why-are-nodejs-breakpoints-in-vs-code-disabled-depending-on-whether-the-full-pat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!