You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support extension debugging in a clean environment #159572
In order to develop and debug extensions in a "clean environment", that means with a clean (or empty) set of extensions and settings, some users tried to use the --extensions-dir and --user-data-dir command line options in their extension's debug configuration.
Since this does not work, issues #126737 and #130504 were created.
Fixing these issues is difficult and would result in large and high-risk code changes.
With the recent work on "settings profiles", a much simpler solution is in reach.
This feature request will make profiles available for extension debugging in a clean environment.
With the "settings profile" feature and the new command line support for profiles it is now possible to specify profiles in the extension's debug configuration.
There are basically two possible approaches:
"debugging in a clean environment" by using an unnamed "empty" profile that gets automatically deleted when debugging has stopped.
"debugging in a controlled environment" by using a named profile that has been created specifically for extension debugging and contains specific settings and extensions.
This debug configuration shows how to "debug in a clean environment":
Please note: the configuration from above passes a workspace folder ${workspaceFolder}/sampleWorkspace which is currently mandatory for the --profile-temp option. If the workspace folder argument is missing, the --profile-temp option is silently ignored. We will try to remove this requirement soon (see issue #159577).
And here is a debug configuration for "debugging in a controlled environment" that uses a previously created "debug" profile:
With the fix for #159577 here is now an up-to-date description of the feature:
With the "settings profile" feature and the new command line support for profiles it is now possible to specify profiles in the extension's debug configuration.
There are basically two possible approaches:
"debugging in a clean environment" by using an unnamed "empty" profile that gets automatically deleted when debugging has stopped.
"debugging in a controlled environment" by using a named profile that has been created specifically for extension debugging and contains specific settings and extensions.
This debug configuration shows how to "debug in a clean environment":
Please note:
when using --profile-temp for debugging an extension in a remote location (via one of the "Remote Development" extensions, e.g. "Remote - SSH"), the remote VS Code instance will show this status message:
This is expected because the temporary profile does not include any extensions which means that the "Remote Development" extensions are missing. The workaround is to create an empty named profile, add the "Remote Development" extensions to it, and use the --profile=.... command line option.
Activity
weinand commentedon Aug 30, 2022
With the "settings profile" feature and the new command line support for profiles it is now possible to specify profiles in the extension's debug configuration.
There are basically two possible approaches:
This debug configuration shows how to "debug in a clean environment":
{ "name": "Extension", "type": "extensionHost", "request": "launch", "args": [ "--profile-temp", "--extensionDevelopmentPath=${workspaceFolder}", "${workspaceFolder}/sampleWorkspace" ], "outFiles": [ "${workspaceFolder}/dist/**/*.js" ], "preLaunchTask": "npm: watch" }Please note: the configuration from above passes a workspace folder
${workspaceFolder}/sampleWorkspacewhich is currently mandatory for the--profile-tempoption. If the workspace folder argument is missing, the--profile-tempoption is silently ignored. We will try to remove this requirement soon (see issue #159577).And here is a debug configuration for "debugging in a controlled environment" that uses a previously created "debug" profile:
{ "name": "Extension", "type": "extensionHost", "request": "launch", "args": [ "--profile=debug", "--extensionDevelopmentPath=${workspaceFolder}" ], "outFiles": [ "${workspaceFolder}/dist/**/*.js" ], "preLaunchTask": "npm: watch" }weinand commentedon Sep 8, 2022
With the fix for #159577 here is now an up-to-date description of the feature:
With the "settings profile" feature and the new command line support for profiles it is now possible to specify profiles in the extension's debug configuration.
There are basically two possible approaches:
This debug configuration shows how to "debug in a clean environment":
{ "name": "Extension", "type": "extensionHost", "request": "launch", "args": [ "--profile-temp", "--extensionDevelopmentPath=${workspaceFolder}" ], "outFiles": [ "${workspaceFolder}/dist/**/*.js" ], "preLaunchTask": "npm: watch" }And here is a debug configuration for "debugging in a controlled environment" that uses a previously created "debug" profile:
{ "name": "Extension", "type": "extensionHost", "request": "launch", "args": [ "--profile=debug", "--extensionDevelopmentPath=${workspaceFolder}" ], "outFiles": [ "${workspaceFolder}/dist/**/*.js" ], "preLaunchTask": "npm: watch" }Please note:
when using
--profile-tempfor debugging an extension in a remote location (via one of the "Remote Development" extensions, e.g. "Remote - SSH"), the remote VS Code instance will show this status message:This is expected because the temporary profile does not include any extensions which means that the "Remote Development" extensions are missing. The workaround is to create an empty named profile, add the "Remote Development" extensions to it, and use the
--profile=....command line option.