mirror of
https://github.com/Microsoft/vscode
synced 2024-10-06 03:17:00 +00:00
server-ready: support debugWithEdge as well as debugWithChrome
This commit is contained in:
parent
244eccdbcc
commit
54ce4a405e
|
@ -69,19 +69,23 @@
|
|||
"additionalProperties": false,
|
||||
"markdownDescription": "%debug.server.ready.serverReadyAction.description%",
|
||||
"default": {
|
||||
"action": "openExternally"
|
||||
"action": "debugWithEdge",
|
||||
"pattern": "listening on port ([0-9]+)",
|
||||
"uriFormat": "http://localhost:%s",
|
||||
"webRoot": "${workspaceFolder}"
|
||||
},
|
||||
"properties": {
|
||||
"action": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"debugWithChrome"
|
||||
"debugWithChrome",
|
||||
"debugWithEdge"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
"%debug.server.ready.action.debugWithChrome.description%"
|
||||
],
|
||||
"markdownDescription": "%debug.server.ready.action.description%",
|
||||
"default": "openExternally"
|
||||
"default": "debugWithEdge"
|
||||
},
|
||||
"pattern": {
|
||||
"type": "string",
|
||||
|
|
|
@ -16,7 +16,7 @@ const WEB_ROOT = '${workspaceFolder}';
|
|||
|
||||
interface ServerReadyAction {
|
||||
pattern: string;
|
||||
action?: 'openExternally' | 'debugWithChrome' | 'startDebugging';
|
||||
action?: 'openExternally' | 'debugWithChrome' | 'debugWithEdge' | 'startDebugging';
|
||||
uriFormat?: string;
|
||||
webRoot?: string;
|
||||
name?: string;
|
||||
|
@ -147,13 +147,11 @@ class ServerReadyDetector extends vscode.Disposable {
|
|||
break;
|
||||
|
||||
case 'debugWithChrome':
|
||||
vscode.debug.startDebugging(session.workspaceFolder, {
|
||||
type: 'pwa-chrome',
|
||||
name: 'Chrome Debug',
|
||||
request: 'launch',
|
||||
url: uri,
|
||||
webRoot: args.webRoot || WEB_ROOT
|
||||
});
|
||||
this.debugWithBrowser('pwa-chrome', session, uri);
|
||||
break;
|
||||
|
||||
case 'debugWithEdge':
|
||||
this.debugWithBrowser('pwa-msedge', session, uri);
|
||||
break;
|
||||
|
||||
case 'startDebugging':
|
||||
|
@ -165,6 +163,16 @@ class ServerReadyDetector extends vscode.Disposable {
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private debugWithBrowser(type: string, session: vscode.DebugSession, uri: string) {
|
||||
return vscode.debug.startDebugging(session.workspaceFolder, {
|
||||
type,
|
||||
name: 'Browser Debug',
|
||||
request: 'launch',
|
||||
url: uri,
|
||||
webRoot: session.configuration.serverReadyAction.webRoot || WEB_ROOT
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export function activate(context: vscode.ExtensionContext) {
|
||||
|
|
Loading…
Reference in a new issue