Skip to content

Commit d89c04f

Browse files
Merge branch 'master' into adopt-SM187v2
2 parents 9bf0346 + c084a5e commit d89c04f

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@
297297
},
298298
{
299299
"command": "vscode-objectscript.modifyWsFolder",
300-
"when": "vscode-objectscript.connectActive && workspaceFolderCount != 0"
300+
"when": "workspaceFolderCount != 0"
301301
},
302302
{
303303
"command": "vscode-objectscript.openErrorLocation",
@@ -606,7 +606,7 @@
606606
},
607607
{
608608
"command": "vscode-objectscript.modifyWsFolder",
609-
"when": "vscode-objectscript.connectActive && resourceScheme =~ /^isfs(-readonly)?$/ && explorerResourceIsRoot && !listMultiSelection",
609+
"when": "(!resourceScheme || resourceScheme =~ /^isfs(-readonly)?$/) && explorerResourceIsRoot && !listMultiSelection",
610610
"group": "objectscript_modify@3"
611611
},
612612
{

src/commands/addServerNamespaceToWorkspace.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -397,20 +397,20 @@ export async function modifyWsFolder(wsFolderUri?: vscode.Uri): Promise<void> {
397397
if (!wsFolder) {
398398
return;
399399
}
400-
if (notIsfs(wsFolder.uri)) {
401-
vscode.window.showErrorMessage(
402-
`Workspace folder '${wsFolder.name}' does not have scheme 'isfs' or 'isfs-readonly'.`,
403-
"Dismiss"
404-
);
405-
return;
406-
}
407400
} else {
408401
// Find the workspace folder for this uri
409402
wsFolder = vscode.workspace.getWorkspaceFolder(wsFolderUri);
410403
if (!wsFolder) {
411404
return;
412405
}
413406
}
407+
if (notIsfs(wsFolder.uri)) {
408+
vscode.window.showErrorMessage(
409+
`Workspace folder '${wsFolder.name}' does not have scheme 'isfs' or 'isfs-readonly'.`,
410+
"Dismiss"
411+
);
412+
return;
413+
}
414414

415415
// Prompt the user to modify the uri
416416
const newUri = await modifyWsFolderUri(wsFolder.uri);

src/commands/webSocketTerminal.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import { AtelierAPI } from "../api";
55
import { connectionTarget, currentFile, getWsServerConnection, handleError, notIsfs, outputChannel } from "../utils";
66
import { config, iscIcon, resolveConnectionSpec } from "../extension";
77

8+
const NO_ELIGIBLE_CONNECTIONS =
9+
"Lite Terminal requires an active server connection to InterSystems IRIS version 2023.2 or above.";
10+
811
const keys = {
912
enter: "\r",
1013
backspace: "\x7f",
@@ -766,6 +769,9 @@ export async function launchWebSocketTerminal(targetUri?: vscode.Uri): Promise<v
766769
} else {
767770
// Determine the server connection to use
768771
targetUri = currentFile()?.uri ?? (await getWsServerConnection("2023.2.0"));
772+
if (targetUri === undefined) {
773+
vscode.window.showErrorMessage(NO_ELIGIBLE_CONNECTIONS);
774+
}
769775
if (!targetUri) return;
770776
}
771777
const api = new AtelierAPI(targetUri);
@@ -791,10 +797,10 @@ export class WebSocketTerminalProfileProvider implements vscode.TerminalProfileP
791797
// Get the terminal configuration. Will throw if there's an error.
792798
const terminalOpts = terminalConfigForUri(new AtelierAPI(uri), uri, true);
793799
return new vscode.TerminalProfile(terminalOpts);
794-
} else if (uri == undefined) {
795-
throw new Error(
796-
"Lite Terminal requires an active server connection to InterSystems IRIS version 2023.2 or above."
797-
);
800+
} else if (uri === undefined) {
801+
throw new Error(NO_ELIGIBLE_CONNECTIONS);
802+
} else {
803+
throw new Error("No connection was chosen.");
798804
}
799805
}
800806
}

0 commit comments

Comments
 (0)