简体   繁体   English

扩展打开新的 windows 时如何继续调试 VSCode 扩展?

[英]How to continue debug VSCode extension when extension open new windows?

I press F5 to debug a VSCode extension and VSCode will open a new window that will contain the extension.我按F5调试 VSCode 扩展,VSCode 将打开一个包含扩展的新 window。 The extension will open a new VSCode window to open a specific project.该扩展将打开一个新的 VSCode window 来打开一个特定的项目。 But this new VSCode window didn't contain the extension and I can't debug it anymore.但是这个新的 VSCode window 不包含扩展,我不能再调试它了。 What can I do?我能做些什么?

Not sure if you are looking for a specific extension.不确定您是否正在寻找特定的扩展名。 If you have already installed the debugger extension, Try to uninstall/reinstall.如果您已经安装了调试器扩展,请尝试卸载/重新安装。

Your automatically generated extension launch configuration should look like this:您自动生成的扩展启动配置应如下所示:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Run Extension",
            "type": "extensionHost",
            "request": "launch",
            "runtimeExecutable": "${execPath}",
            "args": [

                "${workspaceFolder}/../OneDrive/Test Bed",     // add the path here 

                "--extensionDevelopmentPath=${workspaceFolder}"
            ]
        },
        {
            "name": "Extension Tests",
            "type": "extensionHost",
            "request": "launch",
            "runtimeExecutable": "${execPath}",
            "args": [
                "--extensionDevelopmentPath=${workspaceFolder}",
                "--extensionTestsPath=${workspaceFolder}/test/suite/index"
            ]
        }
    ]
}

You see in the Run Extension configuration that I added a path from the extension's ${workspaceFolder} up one level and then into my OneDrive folder to another folder named Test Bed .您在Run Extension配置中看到,我从扩展的${workspaceFolder}向上添加了一个路径,然后添加到我的 OneDrive 文件夹到另一个名为Test Bed的文件夹。 That Test Bed folder will be opened in the first ExtensionHost window that is opened when you F5 and you can debug the extension using that folder immediately.Test Bed文件夹将在您按F5时打开的第一个ExtensionHost window 中打开,您可以立即使用该文件夹调试扩展。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 开发新的vscode扩展时如何将新文件添加到工作区? - How to add a new file to the workspace when developing a new vscode extension? 如何调试 vscode 扩展的 WebView javascript - How To Debug a vscode extension's WebView javascript 在 Windows 上的 VSCode 中调试 Python C/C++ 扩展 - Debug a Python C/C++ extension in VSCode on Windows 如何在 vscode 扩展中打开本地(扩展包内)文件 - How to open a local (inside the extension package) file in a vscode extension 如何在 vscode linux 中配置实时服务器扩展以在已打开的浏览器 window 中打开新实例 - how to configure live server extension in vscode linux to open new instance in already open browser window 在VSCode扩展中检测调试模式 - Detect debug mode in VSCode Extension 将jar添加到vscode调试扩展 - Adding jar to vscode debug extension 如何使用新文件启动VSCode扩展? - How to launch a VSCode extension with a new file? VSCode 扩展:如何调试“激活扩展 'undefined_publisher.extension-name' 失败:意外的令牌 {。” - VSCode Extension: How to debug "Activating extension 'undefined_publisher.extension-name' failed: Unexpected token {." 如何在VScode扩展中打开新的终端标签? (拆分终端) - How do I open a new terminal tab in my VScode extension? (split terminal)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM