microsoft / vscode-mock-debug

Starter sample for developing debug adapters for VSCode.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Debugger won't start

tjhu opened this issue · comments

Pressing F5 will not start the debugger if "program" in launch.json is already set to "readme.md"

Hi, I am facing the same question as you, may i ask you how you fix it? Thank you very much!

@z00420691 sorry, I don't remember whether I fixed it or not. It's been a while since I worked on my vscode debugger project

Hi, I'can't debug readme.md file, error message shows,

Active extension "andreweinand.mock-debug" failure:
Cannot find module '...\out\extension' Require stack: -...\resources\app\out\vs\loader.js - ...\resource\app\out\bootstrap-amd.js -..\resource\app\out\bootstrap-fork.js.

Anyone can help me?

@enochcytian what are steps that resulted in this problem?

Following these steps,

  1. Install VS Code version,

版本: 1.45.0 (system setup)
提交: d69a79b73808559a91206d73d7717ff5f798f23c
日期: 2020-05-07T16:18:48.860Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.19613

  1. git clone (https://github.com/Microsoft/vscode-mock-debug.git) (54ef289)
    clone to "d:\work\vscode-mock-debug"
    open the folder in VS Code.

  2. in VS Code, Press 'F5' to build & launch
    (there is an error, " 终端进程已终止,退出代码:1 ")
    mock_step1

  3. in another VS Code window. open folder “D:\work\mock test\” and open file "readme.md", Press 'F5' and choose 'Mock Debug', error shows that failure.
    mock_step3

That's all. Would you give me help? PLS. Thank you.

What else should I do?

Same here, nothing happened when I click the start button. System information:

Version: 1.45.1
Commit: 5763d909d5f12fe19f215cbfdd29a91c0fa9208a
Date: 2020-05-14T08:33:47.663Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.4.0

Ok, I found out what's wrong. The auto-generated launch.json is like this:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "mock",
            "request": "launch",
            "name": "Ask for file name",
            "program": "${workspaceFolder}/${command:AskForProgramName}",
            "stopOnEntry": true
        }
    ]
}

However, if your file is in a subdirectory, like

root/
  mock test/
    readme.md

Then selecting readme.md when launching the debugger won't work. Clearly it's because the subdirectory mock test is not taken into consideration.

A solution is to change the value of "program" to include the subdirectory:

"program": "${workspaceFolder}/mock test/readme.md"

This will work.

Hi laike9m ,
I try as your suggestions, it can't work. :-(

@enochcytian please note that "Mock Debug" is a sample that shows the basic structure of a debug extension. It doesn't cover all corner cases.
The purpose of the auto generated launch config is to show how "asking the user for input" can be done. It is not something to use in production.