Enable Loaded Scripts for VS Live Share#180
Conversation
|
@roblourens, @weinand, @rodrigovaras: can you please take a look at this? |
199f2d6 to
c48a967
Compare
src/node/extension/loadedScripts.ts
Outdated
|
|
||
| private async isSupportedDebugType(debugType: string | undefined, session: vscode.DebugSession): Promise<boolean> { | ||
| if (debugType === 'vslsShare') { | ||
| const debugSessionInfo = session ? await session.customRequest('debugSessionInfo', {}) : undefined; |
There was a problem hiding this comment.
As per conversation with Rodrigo will add a Try-Catch around the customRequest in case this changes in future.
|
I was on vacation in May, I will merge this next week. |
…nstead of from the configurationProperties
|
This relies on the not properly documented 'setContext' API: |
|
Thanks for the PR. |
| } | ||
|
|
||
| private async isSupportedDebugType(debugType: string | undefined, session: vscode.DebugSession): Promise<boolean> { | ||
| if (debugType === 'vslsShare') { |
There was a problem hiding this comment.
Do we really want to have Live Share specific logic in Debug Adaptors? This feels like a slippery slope...
There was a problem hiding this comment.
This is a temporary measure while the LoadedScript explorer still lives in node-debug and provides a service to other well-known DAs.
Moving the LoadedScript explorer into VS Code core is on our 6 month roadmap and will make this code unnecessary.
The previous code from node-debug suffers from a similar problem:
{
"id": "extension.node-debug.loadedScriptsExplorer",
"name": "%loaded.scripts.view.name%",
"when": "inDebugMode && debugType =~ /^(node|node2|extensionHost|chrome)$/"
}
It refers to the Chrome Debugger extension (which is not built-in).
Enable Loaded Scripts for VS Live Share
Issue: When VS LiveShare is installed the Loaded Scripts pane no longer shows up when the host is debugging, irrespective of if they are sharing or not. This is because the debugType is 'vslsShare' instead of one of the known supported types.
Fix: When the debug type is 'vslsShare' attempt to retrieve the real debug type from the custom debugSessionInfo's configurationProperties.