Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/commands/webSocketTerminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { AtelierAPI } from "../api";
import { connectionTarget, currentFile, getWsServerConnection, handleError, notIsfs, outputChannel } from "../utils";
import { config, iscIcon, resolveConnectionSpec } from "../extension";

const NO_ELIGIBLE_CONNECTIONS =
"Lite Terminal requires an active server connection to InterSystems IRIS version 2023.2 or above.";

const keys = {
enter: "\r",
backspace: "\x7f",
Expand Down Expand Up @@ -766,6 +769,9 @@ export async function launchWebSocketTerminal(targetUri?: vscode.Uri): Promise<v
} else {
// Determine the server connection to use
targetUri = currentFile()?.uri ?? (await getWsServerConnection("2023.2.0"));
if (targetUri === undefined) {
vscode.window.showErrorMessage(NO_ELIGIBLE_CONNECTIONS);
}
if (!targetUri) return;
}
const api = new AtelierAPI(targetUri);
Expand All @@ -791,10 +797,10 @@ export class WebSocketTerminalProfileProvider implements vscode.TerminalProfileP
// Get the terminal configuration. Will throw if there's an error.
const terminalOpts = terminalConfigForUri(new AtelierAPI(uri), uri, true);
return new vscode.TerminalProfile(terminalOpts);
} else if (uri == undefined) {
throw new Error(
"Lite Terminal requires an active server connection to InterSystems IRIS version 2023.2 or above."
);
} else if (uri === undefined) {
throw new Error(NO_ELIGIBLE_CONNECTIONS);
} else {
throw new Error("No connection was chosen.");
}
}
}