microsoft / vscode-debugadapter-node

Debug adapter protocol and implementation for VS Code.
Other
273 stars 79 forks source link

Starting debug when a Git diff window is active, ${script} is not expanded. #134

Closed rkeithhill closed 7 years ago

rkeithhill commented 7 years ago

We've been getting some bugs submitted on the PowerShell debugger that are related to people starting a debug session when their active editor window is a Git diff window of a PowerShell script file. With script debuggers, it is often desirable to be able to simply start debugging the current file. As such we have debug config for this:

        {
            "type": "PowerShell",
            "request": "launch",
            "name": "PowerShell Launch Current File",
            "script": "${file}",
            "args": [],
            "cwd": "${file}"
        }

Normally, when we handle the resolveDebugConfiguration call we don't do anything with config.script or config.cwd. And the debug server gets these values expanded. However, when the currently selected file is a Git diff window, these two values come through as "".

Are we handling this correctly? And/or is this a bug? What do you recommend when folks try to start a debug session from a Git diff window? Personally, I think we should cancel the debug request from the VSCode extension but I'm not seeing anything in the config object that tells me this is a Git diff window.

cc @daviwil

weinand commented 7 years ago

This issue was moved to Microsoft/vscode#37821