mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-20 02:08:47 +00:00
server-ready: support debugWithEdge as well as debugWithChrome
This commit is contained in:
@@ -69,19 +69,23 @@
|
|||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"markdownDescription": "%debug.server.ready.serverReadyAction.description%",
|
"markdownDescription": "%debug.server.ready.serverReadyAction.description%",
|
||||||
"default": {
|
"default": {
|
||||||
"action": "openExternally"
|
"action": "debugWithEdge",
|
||||||
|
"pattern": "listening on port ([0-9]+)",
|
||||||
|
"uriFormat": "http://localhost:%s",
|
||||||
|
"webRoot": "${workspaceFolder}"
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
||||||
"action": {
|
"action": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
"debugWithChrome"
|
"debugWithChrome",
|
||||||
|
"debugWithEdge"
|
||||||
],
|
],
|
||||||
"enumDescriptions": [
|
"enumDescriptions": [
|
||||||
"%debug.server.ready.action.debugWithChrome.description%"
|
"%debug.server.ready.action.debugWithChrome.description%"
|
||||||
],
|
],
|
||||||
"markdownDescription": "%debug.server.ready.action.description%",
|
"markdownDescription": "%debug.server.ready.action.description%",
|
||||||
"default": "openExternally"
|
"default": "debugWithEdge"
|
||||||
},
|
},
|
||||||
"pattern": {
|
"pattern": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const WEB_ROOT = '${workspaceFolder}';
|
|||||||
|
|
||||||
interface ServerReadyAction {
|
interface ServerReadyAction {
|
||||||
pattern: string;
|
pattern: string;
|
||||||
action?: 'openExternally' | 'debugWithChrome' | 'startDebugging';
|
action?: 'openExternally' | 'debugWithChrome' | 'debugWithEdge' | 'startDebugging';
|
||||||
uriFormat?: string;
|
uriFormat?: string;
|
||||||
webRoot?: string;
|
webRoot?: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
@@ -147,13 +147,11 @@ class ServerReadyDetector extends vscode.Disposable {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'debugWithChrome':
|
case 'debugWithChrome':
|
||||||
vscode.debug.startDebugging(session.workspaceFolder, {
|
this.debugWithBrowser('pwa-chrome', session, uri);
|
||||||
type: 'pwa-chrome',
|
break;
|
||||||
name: 'Chrome Debug',
|
|
||||||
request: 'launch',
|
case 'debugWithEdge':
|
||||||
url: uri,
|
this.debugWithBrowser('pwa-msedge', session, uri);
|
||||||
webRoot: args.webRoot || WEB_ROOT
|
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'startDebugging':
|
case 'startDebugging':
|
||||||
@@ -165,6 +163,16 @@ class ServerReadyDetector extends vscode.Disposable {
|
|||||||
break;
|
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) {
|
export function activate(context: vscode.ExtensionContext) {
|
||||||
|
|||||||
Reference in New Issue
Block a user