Skip to content

Commit 26de0cd

Browse files
committed
Implement debug proxy to display error message before install completes
This adds a debug proxy that acts as the debug adapter program before the coreclr-debug are fully downloaded. If the user tries to start debugging before download is finished, the proxy displays a sane error message. Once the download is complete, we rewrite the manifest to no longer call the proxy. During the VS Code session that downloads the components, the manifest is rewritten but not reloaded. In this case the proxy spawns the real debugger as a child process and proxies its stdin/stdout. Once vs code is restarted the new manifest is loaded and the proxy is no longer called. Also adds an empty command that can be run to force activation of the C# extension, which will kick off debugger acquisition.
1 parent a27e4ab commit 26de0cd

File tree

6 files changed

+506
-270
lines changed

6 files changed

+506
-270
lines changed

coreclr-debug/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ bin
22
obj
33
project.lock.json
44
debugAdapters
5-
install.log
5+
install.log
6+
extension.log

package.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"github-releases": "^0.3.0",
2525
"run-in-terminal": "*",
2626
"semver": "*",
27+
"vscode-debugprotocol": "^1.6.1",
2728
"vscode-extension-telemetry": "0.0.4",
2829
"tmp": "0.0.28",
2930
"open": "*"
@@ -50,6 +51,7 @@
5051
"onCommand:o.execute-last-command",
5152
"onCommand:dotnet.restore",
5253
"onCommand:csharp.addTasksJson",
54+
"onCommand:csharp.installDebugger",
5355
"workspaceContains:project.json"
5456
],
5557
"contributes": {
@@ -105,6 +107,11 @@
105107
"command": "dotnet.restore",
106108
"title": "Restore Packages",
107109
"category": "dotnet"
110+
},
111+
{
112+
"command": "csharp.installDebugger",
113+
"title": "Install .NET Core Debugger",
114+
"category": "Debugger"
108115
}
109116
],
110117
"keybindings": [
@@ -154,10 +161,9 @@
154161
"csharp"
155162
]
156163
},
157-
"program": "./coreclr-debug/debugAdapters/OpenDebugAD7",
158-
"windows": {
159-
"program": "./coreclr-debug/debugAdapters/OpenDebugAD7.exe"
160-
},
164+
"runtime": "node",
165+
"runtimeArgs": [],
166+
"program": "./out/coreclr-debug/proxy.js",
161167
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
162168
"configurationAttributes": {
163169
"launch": {
@@ -380,4 +386,4 @@
380386
}
381387
]
382388
}
383-
}
389+
}

0 commit comments

Comments
 (0)