Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Enable Loaded Scripts for VS Live Share#180

Merged
weinand merged 3 commits intomicrosoft:masterfrom
jramsay:dev/jasonra/EnableLoadedScriptsInVSLiveShare
Jun 8, 2018
Merged

Enable Loaded Scripts for VS Live Share#180
weinand merged 3 commits intomicrosoft:masterfrom
jramsay:dev/jasonra/EnableLoadedScriptsInVSLiveShare

Conversation

@jramsay
Copy link
Member

@jramsay jramsay commented May 8, 2018

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.

@jramsay
Copy link
Member Author

jramsay commented May 8, 2018

@roblourens, @weinand, @rodrigovaras: can you please take a look at this?

@jramsay jramsay force-pushed the dev/jasonra/EnableLoadedScriptsInVSLiveShare branch from 199f2d6 to c48a967 Compare May 8, 2018 00:16
@weinand weinand self-assigned this May 8, 2018
@weinand weinand added this to the May 2018 milestone May 8, 2018

private async isSupportedDebugType(debugType: string | undefined, session: vscode.DebugSession): Promise<boolean> {
if (debugType === 'vslsShare') {
const debugSessionInfo = session ? await session.customRequest('debugSessionInfo', {}) : undefined;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per conversation with Rodrigo will add a Try-Catch around the customRequest in case this changes in future.

@weinand
Copy link
Contributor

weinand commented May 31, 2018

I was on vacation in May, I will merge this next week.

@weinand
Copy link
Contributor

weinand commented Jun 8, 2018

This relies on the not properly documented 'setContext' API:
microsoft/vscode#10471

@weinand weinand merged commit 52723ce into microsoft:master Jun 8, 2018
@weinand
Copy link
Contributor

weinand commented Jun 8, 2018

Thanks for the PR.
It will become available on the next Insider release (Monday).

}

private async isSupportedDebugType(debugType: string | undefined, session: vscode.DebugSession): Promise<boolean> {
if (debugType === 'vslsShare') {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want to have Live Share specific logic in Debug Adaptors? This feels like a slippery slope...

Copy link
Contributor

@weinand weinand Jun 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants