Skip to content

Commit

Permalink
Debugger: Update configuration snippets and 'hiddenWhen' (#6456)
Browse files Browse the repository at this point in the history
This PR makes a few tweaks to package.json to hopefully further improve the experience configuring projects to launch --

1. This adds a launch.json configuration snippet that uses the `dotnet` type to aid folks in using `dotnet` debugger type in polygot workspaces
2. Update the various launch.json configuration snippets so that:
    A. The new 'Launch C# Project' snippet stands out more
    B. Localization is enabled
    C. They are better grouped (ex: remote debugging ones are together)
    D. They have better descriptions
4. This hides the `dotnet` configuration provider if you try and bring up an action that will show you available debuggers when DevKit is not available, as it will do nothing if selected
5. This hides the `clr` configuration provider in all cases, as it will do nothing if selected
  • Loading branch information
gregg-miskelly authored Oct 3, 2023
1 parent 1c109e8 commit e02678f
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 16 deletions.
44 changes: 28 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3283,8 +3283,8 @@
},
"configurationSnippets": [
{
"label": ".NET: Launch .NET Core Console App",
"description": "Launch a .NET Core Console App with a debugger.",
"label": "%debuggers.coreclr.configurationSnippets.label.console-local%",
"description": "%debuggers.coreclr.configurationSnippets.description.console-local%",
"body": {
"name": ".NET Core Launch (console)",
"type": "coreclr",
Expand All @@ -3298,17 +3298,17 @@
}
},
{
"label": ".NET: Attach to local .NET Core Console App",
"description": "Attach a debugger to a .NET Core Console App.",
"label": "%debuggers.coreclr.configurationSnippets.label.attach-local%",
"description": "%debuggers.coreclr.configurationSnippets.description.attach%",
"body": {
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
},
{
"label": ".NET: Launch a local .NET Core Web App",
"description": "Launch a .NET Core Web App with both a browser and a debugger.",
"label": "%debuggers.coreclr.configurationSnippets.label.web-local%",
"description": "%debuggers.coreclr.configurationSnippets.description.web-local%",
"body": {
"name": ".NET Core Launch (web)",
"type": "coreclr",
Expand All @@ -3331,8 +3331,8 @@
}
},
{
"label": ".NET: Launch a remote .NET Core Console App",
"description": "Launch a .NET Core Console App on a remote machine.",
"label": "%debuggers.coreclr.configurationSnippets.label.console-remote%",
"description": "%debuggers.coreclr.configurationSnippets.description.remote%",
"body": {
"name": ".NET Core Launch (console)",
"type": "coreclr",
Expand All @@ -3352,8 +3352,8 @@
}
},
{
"label": ".NET: Attach to remote .NET Core Console App",
"description": "Attach a debugger to a .NET Core Console App on a remote machine.",
"label": "%debuggers.coreclr.configurationSnippets.label.attach-remote%",
"description": "%debuggers.coreclr.configurationSnippets.description.remote%",
"body": {
"name": ".NET Core Attach",
"type": "coreclr",
Expand All @@ -3367,8 +3367,8 @@
}
},
{
"label": ".NET: Launch and Debug Hosted Blazor WebAssembly App",
"description": "Launches a Hosted Blazor WebAssembly App with a debugger",
"label": "%debuggers.coreclr.configurationSnippets.label.blazor-hosted%",
"description": "%debuggers.coreclr.configurationSnippets.description.blazor-hosted%",
"body": {
"name": "Launch and Debug Hosted Blazor WebAssembly App",
"type": "blazorwasm",
Expand All @@ -3379,8 +3379,8 @@
}
},
{
"label": ".NET: Launch and Debug Standalone Blazor WebAssembly App",
"description": "Launches Standalone Blazor WebAssembly App with a debugger",
"label": "%debuggers.coreclr.configurationSnippets.label.blazor-standalone%",
"description": "%debuggers.coreclr.configurationSnippets.description.blazor-standalone%",
"body": {
"name": "Launch and Debug Standalone Blazor WebAssembly App",
"type": "blazorwasm",
Expand All @@ -3393,7 +3393,7 @@
{
"type": "clr",
"when": "workspacePlatform == windows",
"hiddenWhen": "dotnet.debug.serviceBrokerAvailable",
"hiddenWhen": "true",
"label": ".NET Framework 4.x",
"languages": [
"csharp",
Expand Down Expand Up @@ -4766,6 +4766,7 @@
{
"type": "dotnet",
"label": "C#",
"hiddenWhen": "!dotnet.debug.serviceBrokerAvailable",
"languages": [
"csharp",
"razor",
Expand All @@ -4792,7 +4793,18 @@
}
}
},
"configurationSnippets": []
"configurationSnippets": [
{
"label": "%debuggers.dotnet.configurationSnippets.label%",
"description": "%debuggers.dotnet.configurationSnippets.description%",
"body": {
"name": "C#: ${1:<project-name>} Debug",
"type": "dotnet",
"request": "launch",
"projectPath": "^\"\\${workspaceFolder}/${2:<relative-path-to-project-folder>}${1:<project-name>}.csproj\""
}
}
]
}
],
"semanticTokenTypes": [
Expand Down
45 changes: 45 additions & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,53 @@
"configuration.razor.trace.off": "Does not log messages from the Razor extension",
"configuration.razor.trace.messages": "Logs only some messages from the Razor extension",
"configuration.razor.trace.verbose": "Logs all messages from the Razor extension",
"debuggers.coreclr.configurationSnippets.label.console-local": ".NET: Launch Executable file (Console)",
"debuggers.coreclr.configurationSnippets.label.web-local": ".NET: Launch Executable file (Web)",
"debuggers.coreclr.configurationSnippets.label.attach-local": ".NET: Attach to a .NET process",
"debuggers.coreclr.configurationSnippets.label.console-remote": ".NET: Remote debugging - Launch Executable file (Console)",
"debuggers.coreclr.configurationSnippets.label.attach-remote": ".NET: Remote debugging - Attach to a .NET process",
"debuggers.coreclr.configurationSnippets.label.blazor-hosted": ".NET: Web Assembly - Launch hosted Blazor project",
"debuggers.coreclr.configurationSnippets.label.blazor-standalone": ".NET: Web Assembly - Launch standalone Blazor project",
"debuggers.coreclr.configurationSnippets.description.console-local": {
"message" : "This snippet is used to launch a new process under the .NET debugger (coreclr), specifying the path to the executable to launch. In most cases, the \".NET: Launch C# project\" snippet is a better choice. This snippet is useful when the project was built outside this VS Code instance or you want to host your .NET Code in a custom executable, such as a specific version of 'dotnet.exe'/'dotnet' or the .NET Code is hosted by a native application. This snippet is for console applications.",
"comment": [
"'coreclr' is the name of the debugger 'type', and should not be localized",
"{Locked='(coreclr)'}"
]
},
"debuggers.coreclr.configurationSnippets.description.web-local": {
"message": "This snippet is used to launch a new process under the .NET debugger (coreclr), specifying the path to the executable to launch. In most cases, the \".NET: Launch C# project\" snippet is a better choice. This snippet is useful when the project was built outside this VS Code instance or you want to host your .NET Code in a custom executable, such as a specific version of 'dotnet.exe'/'dotnet' or the .NET Code is hosted by a native application. This snippet is for web (ASP.NET Core) applications.",
"comment": [
"'coreclr' is the name of the debugger 'type', and should not be localized",
"{Locked='(coreclr)'}"
]
},
"debuggers.coreclr.configurationSnippets.description.attach": {
"message": "Attach the .NET debugger (coreclr) to a running process. This can also be done using the 'Attach to a .NET 5+ or .NET Core process' command.",
"comment": [
"'coreclr' is the name of the debugger 'type', and should not be localized",
"{Locked='(coreclr)'}"
]
},
"debuggers.coreclr.configurationSnippets.description.remote": "This snippet shows how to remote debug .NET Code **without** using VS Code remoting. It should be used in cases where you want to build your project locally but run it on another computer.",
"debuggers.coreclr.configurationSnippets.description.blazor-hosted": {
"message": "This snippet is used to launch a new process under the Blazor WebAssembly debugger (blazorwasm), specifying the path to the executable to launch. In most cases, the \".NET: Launch C# project\" snippet is a better choice, but this snippet can be used to have full control over all launch options. This snippet is for hosted Blazor projects, which is a project that has a backend ASP.NET Core app to serve its files.",
"comment": [
"'blazorwasm' is the name of the debugger 'type', and should not be localized",
"{Locked='(blazorwasm)'}"
]
},
"debuggers.coreclr.configurationSnippets.description.blazor-standalone": {
"message": "This snippet is used to launch a new process under the Blazor WebAssembly debugger (blazorwasm). In most cases, the \".NET: Launch C# project\" snippet is a better choice, but this snippet can be used to have full control over all launch options. This snippet is for standalone Blazor projects, which is a project that does not have a backend ASP.NET Core app to serve its files.",
"comment": [
"'blazorwasm' is the name of the debugger 'type', and should not be localized",
"{Locked='(blazorwasm)'}"
]
},
"debuggers.dotnet.launch.projectPath.description": "Path to the .csproj file.",
"debuggers.dotnet.launch.launchConfigurationId.description": "The launch configuration id to use. Empty string will use the current active configuration.",
"debuggers.dotnet.configurationSnippets.label": ".NET: Launch C# project",
"debuggers.dotnet.configurationSnippets.description": "This snippet configures VS Code to debug a C# project. Debug options (example: arguments to the executable) can be configured through the '<project-directory>/Properties/launchSettings.json' file.",
"viewsWelcome.debug.contents": {
"message": "[Generate C# Assets for Build and Debug](command:dotnet.generateAssets)\n\nTo learn more about launch.json, see [Configuring launch.json for C# debugging](https://aka.ms/VSCode-CS-LaunchJson).",
"comment": [
Expand Down

0 comments on commit e02678f

Please sign in to comment.