dotnet watch run with the startup project, configuration, platform and per-project launch options from the status bar. The debugger is no longer attached automatically: attach on demand, one notification with Re-attach when the watcher replaces the process. Rude edits follow a setting (restart / ask / warn). Warns before starting under an optimised configuration, which SDK 10's dotnet watch cannot hot reload. Solution build runs first so the Editor's post-build step finds the Builder. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0169iPWwKHZoBTNN9qwXiwqk
472 lines
16 KiB
JSON
472 lines
16 KiB
JSON
{
|
|
"name": "dotnet-solution-launcher",
|
|
"displayName": ".NET Solution Launcher",
|
|
"description": "Startup project and solution configuration (Debug|x64, Test|x64, ...) in the status bar, with build, debug, run and hot reload that honour them. Made for DotRush, which shows the configuration but not the project and never passes the platform.",
|
|
"version": "0.1.0",
|
|
"publisher": "local",
|
|
"license": "MIT",
|
|
"engines": {
|
|
"vscode": "^1.85.0"
|
|
},
|
|
"categories": [
|
|
"Debuggers",
|
|
"Other"
|
|
],
|
|
"keywords": [
|
|
"dotnet",
|
|
"csharp",
|
|
"solution",
|
|
"configuration",
|
|
"dotrush",
|
|
"startup project",
|
|
"hot reload",
|
|
"dotnet watch"
|
|
],
|
|
"activationEvents": [
|
|
"onLanguage:csharp",
|
|
"onDebug",
|
|
"workspaceContains:**/*.{sln,slnx,csproj}"
|
|
],
|
|
"main": "./out/extension.js",
|
|
"contributes": {
|
|
"commands": [
|
|
{
|
|
"command": "dotnetSolution.selectStartupProject",
|
|
"title": "Select Startup Project",
|
|
"category": ".NET Solution"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.selectConfiguration",
|
|
"title": "Select Configuration",
|
|
"category": ".NET Solution"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.selectSolution",
|
|
"title": "Select Solution",
|
|
"category": ".NET Solution"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.build",
|
|
"title": "Build",
|
|
"category": ".NET Solution",
|
|
"icon": "$(tools)"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.rebuild",
|
|
"title": "Rebuild",
|
|
"category": ".NET Solution"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.clean",
|
|
"title": "Clean",
|
|
"category": ".NET Solution"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.publish",
|
|
"title": "Publish Startup Project",
|
|
"category": ".NET Solution",
|
|
"icon": "$(package)"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.test",
|
|
"title": "Run Tests",
|
|
"category": ".NET Solution",
|
|
"icon": "$(beaker)"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.debug",
|
|
"title": "Debug Startup Project",
|
|
"category": ".NET Solution",
|
|
"icon": "$(debug-alt)"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.run",
|
|
"title": "Run Startup Project (without debugging)",
|
|
"category": ".NET Solution",
|
|
"icon": "$(play)"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.hotReload.start",
|
|
"title": "Run Startup Project with Hot Reload",
|
|
"category": ".NET Solution",
|
|
"icon": "$(flame)"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.hotReload.apply",
|
|
"title": "Hot Reload: Apply Changes",
|
|
"category": ".NET Solution",
|
|
"icon": "$(flame)"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.hotReload.restart",
|
|
"title": "Hot Reload: Restart Application",
|
|
"category": ".NET Solution",
|
|
"icon": "$(debug-restart)"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.hotReload.stop",
|
|
"title": "Hot Reload: Stop",
|
|
"category": ".NET Solution",
|
|
"icon": "$(debug-stop)"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.hotReload.attach",
|
|
"title": "Hot Reload: Attach Debugger",
|
|
"category": ".NET Solution"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.hotReload.detach",
|
|
"title": "Hot Reload: Detach Debugger",
|
|
"category": ".NET Solution"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.hotReload.showTerminal",
|
|
"title": "Hot Reload: Show Terminal",
|
|
"category": ".NET Solution"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.hotReload.menu",
|
|
"title": "Hot Reload: Actions",
|
|
"category": ".NET Solution"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.generateLaunchConfig",
|
|
"title": "Create launch.json and tasks.json entries",
|
|
"category": ".NET Solution"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.reload",
|
|
"title": "Reload Solution",
|
|
"category": ".NET Solution"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.showOutput",
|
|
"title": "Show Log",
|
|
"category": ".NET Solution"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.setStartupProject",
|
|
"title": "Set as Startup Project (.NET Solution)",
|
|
"category": ".NET Solution"
|
|
}
|
|
],
|
|
"menus": {
|
|
"explorer/context": [
|
|
{
|
|
"command": "dotnetSolution.setStartupProject",
|
|
"when": "resourceExtname =~ /\\.(cs|fs|vb)proj$/",
|
|
"group": "dotnet_0@0"
|
|
}
|
|
],
|
|
"commandPalette": [
|
|
{
|
|
"command": "dotnetSolution.setStartupProject",
|
|
"when": "false"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.hotReload.apply",
|
|
"when": "dotnetSolution.hotReload.running"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.hotReload.restart",
|
|
"when": "dotnetSolution.hotReload.running"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.hotReload.stop",
|
|
"when": "dotnetSolution.hotReload.running"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.hotReload.attach",
|
|
"when": "dotnetSolution.hotReload.running && !dotnetSolution.hotReload.attached"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.hotReload.detach",
|
|
"when": "dotnetSolution.hotReload.attached"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.hotReload.showTerminal",
|
|
"when": "dotnetSolution.hotReload.running"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.hotReload.menu",
|
|
"when": "false"
|
|
}
|
|
],
|
|
"debug/toolBar": [
|
|
{
|
|
"command": "dotnetSolution.hotReload.apply",
|
|
"when": "dotnetSolution.hotReload.attached",
|
|
"group": "navigation@10"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.hotReload.restart",
|
|
"when": "dotnetSolution.hotReload.attached",
|
|
"group": "navigation@11"
|
|
}
|
|
]
|
|
},
|
|
"taskDefinitions": [
|
|
{
|
|
"type": "dotnet-solution",
|
|
"required": [],
|
|
"properties": {
|
|
"target": {
|
|
"type": "string",
|
|
"enum": [
|
|
"build",
|
|
"rebuild",
|
|
"clean",
|
|
"publish",
|
|
"test"
|
|
],
|
|
"default": "build",
|
|
"description": "What to do. Publish always targets the startup project; test runs the solution or project depending on scope."
|
|
},
|
|
"scope": {
|
|
"type": "string",
|
|
"enum": [
|
|
"solution",
|
|
"project"
|
|
],
|
|
"description": "Build the whole solution with the selected solution configuration, or only the startup project with the project configuration the solution maps it to. Defaults to the dotnetSolution.buildScope setting."
|
|
},
|
|
"args": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"description": "Extra arguments appended to the dotnet command."
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"problemMatchers": [],
|
|
"configuration": {
|
|
"title": ".NET Solution Launcher",
|
|
"properties": {
|
|
"dotnetSolution.solution": {
|
|
"type": "string",
|
|
"default": "",
|
|
"description": "Solution file to use, relative to the workspace. Empty picks the one closest to the workspace root, preferring the one with the most projects."
|
|
},
|
|
"dotnetSolution.buildScope": {
|
|
"type": "string",
|
|
"enum": [
|
|
"solution",
|
|
"project"
|
|
],
|
|
"enumDescriptions": [
|
|
"dotnet build <solution> -c <Configuration> -p:Platform=<Platform>. Honours solution-level project dependencies and per-project configuration mapping, like Visual Studio's Build Solution.",
|
|
"dotnet build <startup project> with the configuration and platform the solution maps it to. Faster, but ignores dependencies that only exist in the .sln (ProjectDependencies)."
|
|
],
|
|
"default": "solution",
|
|
"description": "What the build task builds before a launch."
|
|
},
|
|
"dotnetSolution.targetFramework": {
|
|
"type": "string",
|
|
"default": "",
|
|
"description": "Target framework to launch for multi-targeting projects (TargetFrameworks). Empty uses the first one."
|
|
},
|
|
"dotnetSolution.launch.args": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"default": [],
|
|
"description": "Arguments passed to the startup project when launched from this extension."
|
|
},
|
|
"dotnetSolution.launch.env": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
},
|
|
"default": {},
|
|
"description": "Environment variables for the launched startup project."
|
|
},
|
|
"dotnetSolution.launch.cwd": {
|
|
"type": "string",
|
|
"default": "",
|
|
"description": "Working directory for the launched startup project, relative to the project folder. Empty uses launchSettings.json or the output directory (TargetDir)."
|
|
},
|
|
"dotnetSolution.launch.console": {
|
|
"type": "string",
|
|
"enum": [
|
|
"internalConsole",
|
|
"integratedTerminal",
|
|
"externalTerminal"
|
|
],
|
|
"default": "internalConsole",
|
|
"description": "Console for the debugged application."
|
|
},
|
|
"dotnetSolution.debugType": {
|
|
"type": "string",
|
|
"default": "coreclr",
|
|
"description": "Debug adapter type. DotRush and C# Dev Kit both provide coreclr."
|
|
},
|
|
"dotnetSolution.syncDotRush": {
|
|
"type": "boolean",
|
|
"default": true,
|
|
"markdownDescription": "Keep DotRush's own startup project in sync (`dotrush.setStartupProject`), so its test explorer, launchSettings lookup and `${command:dotrush.activeProjectPath}` agree with the status bar here."
|
|
},
|
|
"dotnetSolution.syncDotRushWorkspaceProperties": {
|
|
"type": "boolean",
|
|
"default": false,
|
|
"markdownDescription": "Write `Configuration=<Cfg>;Platform=<Platform>` into `dotrush.roslyn.workspaceProperties` when the configuration changes, so IntelliSense sees the same DefineConstants as the build. DotRush reloads its workspace on each change, which is why this is off by default."
|
|
},
|
|
"dotnetSolution.additionalBuildArguments": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"default": [],
|
|
"description": "Extra arguments for every dotnet build / clean run by this extension."
|
|
},
|
|
"dotnetSolution.launch.projects": {
|
|
"type": "object",
|
|
"default": {},
|
|
"markdownDescription": "Per-project launch options, keyed by project name. Each entry may set `args`, `env`, `cwd` (relative to the project folder), `console` and `profile` (a launchSettings.json profile name). These override the global `dotnetSolution.launch.*` settings and `Properties/launchSettings.json`.\n\nExample: `{ \"MyGame.Builder\": { \"args\": [\"-build\"], \"cwd\": \"../Bin/MyGame.Builder\" } }`",
|
|
"additionalProperties": {
|
|
"type": "object",
|
|
"properties": {
|
|
"args": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"env": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"cwd": {
|
|
"type": "string"
|
|
},
|
|
"console": {
|
|
"type": "string",
|
|
"enum": [
|
|
"internalConsole",
|
|
"integratedTerminal",
|
|
"externalTerminal"
|
|
]
|
|
},
|
|
"profile": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"dotnetSolution.launch.profile": {
|
|
"type": "string",
|
|
"default": "",
|
|
"description": "Profile to take from Properties/launchSettings.json. Empty picks the first profile with commandName \"Project\"."
|
|
},
|
|
"dotnetSolution.publish.runtime": {
|
|
"type": "string",
|
|
"default": "",
|
|
"description": "Runtime identifier for dotnet publish, e.g. win-x64. Required for PublishAot. Empty omits -r."
|
|
},
|
|
"dotnetSolution.publish.args": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"default": [],
|
|
"description": "Extra arguments for dotnet publish, e.g. [\"--self-contained\"]."
|
|
},
|
|
"dotnetSolution.test.args": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"default": [],
|
|
"description": "Extra arguments for dotnet test, e.g. [\"--no-build\"] or a filter."
|
|
},
|
|
"dotnetSolution.showProblemsOnFailure": {
|
|
"type": "boolean",
|
|
"default": true,
|
|
"description": "Open the Problems panel when a build, publish or test run fails."
|
|
},
|
|
"dotnetSolution.hotReload.rudeEdit": {
|
|
"type": "string",
|
|
"enum": [
|
|
"restart",
|
|
"ask",
|
|
"warn"
|
|
],
|
|
"default": "restart",
|
|
"enumDescriptions": [
|
|
"Restart the application automatically (DOTNET_WATCH_RESTART_ON_RUDE_EDIT).",
|
|
"Show a prompt with Restart / Keep running.",
|
|
"Keep running the old code and show a warning with a Restart button."
|
|
],
|
|
"description": "What happens when an edit cannot be hot reloaded (a rude edit)."
|
|
},
|
|
"dotnetSolution.hotReload.buildSolutionFirst": {
|
|
"type": "boolean",
|
|
"default": true,
|
|
"markdownDescription": "Run the solution build before starting `dotnet watch`. dotnet watch builds only the startup project, so solution-level dependencies (the Editor's post-build step needs the Builder) would otherwise be missing on a clean checkout."
|
|
},
|
|
"dotnetSolution.hotReload.watchArgs": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"default": [],
|
|
"description": "Extra arguments for dotnet watch itself, e.g. [\"--verbose\"]."
|
|
}
|
|
}
|
|
},
|
|
"keybindings": [
|
|
{
|
|
"command": "dotnetSolution.build",
|
|
"key": "ctrl+shift+b",
|
|
"mac": "cmd+shift+b",
|
|
"when": "dotnetSolution.active && !dotnetSolution.hasLaunchEntry"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.debug",
|
|
"key": "f5",
|
|
"when": "dotnetSolution.active && !inDebugMode && !dotnetSolution.hasLaunchEntry && !terminalFocus"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.run",
|
|
"key": "ctrl+f5",
|
|
"when": "dotnetSolution.active && !inDebugMode && !dotnetSolution.hasLaunchEntry"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.selectConfiguration",
|
|
"key": "ctrl+alt+c",
|
|
"when": "dotnetSolution.active"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.selectStartupProject",
|
|
"key": "ctrl+alt+p",
|
|
"when": "dotnetSolution.active"
|
|
},
|
|
{
|
|
"command": "dotnetSolution.hotReload.start",
|
|
"key": "ctrl+alt+f5",
|
|
"when": "dotnetSolution.active && !dotnetSolution.hotReload.running"
|
|
}
|
|
]
|
|
},
|
|
"scripts": {
|
|
"vscode:prepublish": "npm run compile",
|
|
"compile": "tsc -p ./",
|
|
"watch": "tsc -watch -p ./",
|
|
"pretest": "npm run compile",
|
|
"test": "node ./out/test/runTest.js",
|
|
"test:unit": "npm run compile && mocha --ui tdd out/test/unit/*.test.js"
|
|
},
|
|
"devDependencies": {
|
|
"@types/mocha": "^10.0.6",
|
|
"@types/node": "^20.11.0",
|
|
"@types/vscode": "^1.85.0",
|
|
"@vscode/test-electron": "^2.4.1",
|
|
"mocha": "^10.4.0",
|
|
"typescript": "^5.4.0"
|
|
}
|
|
}
|