From 4c6bda4a1a9afe7a1f234fd89b49df9f34ac4339 Mon Sep 17 00:00:00 2001 From: gjsjohnmurray Date: Mon, 30 Sep 2024 10:41:36 +0100 Subject: [PATCH 1/3] Add `Launch Lite Terminal` action to Explorer --- package.json | 14 ++++++++++++++ src/commands/webSocketTerminal.ts | 5 ++++- src/extension.ts | 11 +++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 3de5f8bc..0f02a80a 100644 --- a/package.json +++ b/package.json @@ -324,6 +324,10 @@ "command": "vscode-objectscript.intersystems-servermanager.webterminal", "when": "false" }, + { + "command": "vscode-objectscript.ObjectScriptExplorer.webterminal", + "when": "false" + }, { "command": "vscode-objectscript.importXMLFiles", "when": "vscode-objectscript.connectActive && workspaceFolderCount != 0" @@ -403,6 +407,11 @@ "when": "view == ObjectScriptExplorer && viewItem =~ /^serverNode.*:extra:/", "group": "inline@30" }, + { + "command": "vscode-objectscript.ObjectScriptExplorer.webterminal", + "when": "view == ObjectScriptExplorer && viewItem =~ /^serverNode/", + "group": "inline@25" + }, { "command": "vscode-objectscript.explorer.showGenerated", "when": "view == ObjectScriptExplorer && viewItem =~ /^serverNode((?!:generated:).)*$/", @@ -1170,6 +1179,11 @@ "title": "Launch Lite Terminal", "icon": "$(terminal)" }, + { + "command": "vscode-objectscript.ObjectScriptExplorer.webterminal", + "title": "Launch Lite Terminal", + "icon": "$(terminal)" + }, { "category": "ObjectScript", "command": "vscode-objectscript.importXMLFiles", diff --git a/src/commands/webSocketTerminal.ts b/src/commands/webSocketTerminal.ts index caebe3fd..491a9b93 100644 --- a/src/commands/webSocketTerminal.ts +++ b/src/commands/webSocketTerminal.ts @@ -624,7 +624,10 @@ function terminalConfigForUri( } return { - name: api.config.serverName && api.config.serverName != "" ? api.config.serverName : "iris", + name: + api.config.serverName && api.config.serverName != "" + ? api.config.serverName + : `${api.config.host}:${api.config.port}${api.config.pathPrefix}`, location: // Mimic what a built-in profile does. When it is the default and the Terminal tab is selected while empty, // a terminal is always created in the Panel. diff --git a/src/extension.ts b/src/extension.ts index 339e6cc3..282ee401 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1422,6 +1422,17 @@ export async function activate(context: vscode.ExtensionContext): Promise { launchWebSocketTerminal(targetUri); } ), + vscode.commands.registerCommand("vscode-objectscript.ObjectScriptExplorer.webterminal", (node: NodeBase) => { + const targetUri = DocumentContentProvider.getUri( + node.fullName, + node.workspaceFolder, + node.namespace, + undefined, + undefined, + true + ); + launchWebSocketTerminal(targetUri); + }), vscode.window.registerTerminalProfileProvider( "vscode-objectscript.webSocketTerminal", new WebSocketTerminalProfileProvider() From dd455925cc3567ae44e117b758f02da37207ffa4 Mon Sep 17 00:00:00 2001 From: gjsjohnmurray Date: Mon, 30 Sep 2024 12:14:15 +0100 Subject: [PATCH 2/3] package-lock.json updated by `npm i` --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index b4d3df97..2cb5caed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vscode-objectscript", - "version": "2.12.8-SNAPSHOT", + "version": "2.12.9-SNAPSHOT", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "vscode-objectscript", - "version": "2.12.8-SNAPSHOT", + "version": "2.12.9-SNAPSHOT", "hasInstallScript": true, "license": "MIT", "dependencies": { From 45ff255a8836ba6634d3a4467c2900d7be11f99d Mon Sep 17 00:00:00 2001 From: gjsjohnmurray Date: Mon, 30 Sep 2024 20:39:26 +0100 Subject: [PATCH 3/3] Revert change to terminal name --- src/commands/webSocketTerminal.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/commands/webSocketTerminal.ts b/src/commands/webSocketTerminal.ts index 491a9b93..caebe3fd 100644 --- a/src/commands/webSocketTerminal.ts +++ b/src/commands/webSocketTerminal.ts @@ -624,10 +624,7 @@ function terminalConfigForUri( } return { - name: - api.config.serverName && api.config.serverName != "" - ? api.config.serverName - : `${api.config.host}:${api.config.port}${api.config.pathPrefix}`, + name: api.config.serverName && api.config.serverName != "" ? api.config.serverName : "iris", location: // Mimic what a built-in profile does. When it is the default and the Terminal tab is selected while empty, // a terminal is always created in the Panel.