diff --git a/src/api/addServer.ts b/src/api/addServer.ts index c931104..9721309 100644 --- a/src/api/addServer.ts +++ b/src/api/addServer.ts @@ -10,7 +10,7 @@ export async function addServer( return await vscode.window .showInputBox({ ignoreFocusOut: true, - placeHolder: "Name of new server definition", + title: "Enter name of new server definition", validateInput: (value) => { if (value === "") { return "Required"; @@ -29,7 +29,7 @@ export async function addServer( if (name) { const description = await vscode.window.showInputBox({ ignoreFocusOut: true, - placeHolder: "Optional description", + title: "Optionally enter a description", }); if (typeof description !== "undefined") { if (description) { @@ -37,7 +37,7 @@ export async function addServer( } const host = await vscode.window.showInputBox({ ignoreFocusOut: true, - placeHolder: "Hostname or IP address of web server", + title: "Enter the hostname or IP address of the web server", validateInput: (value) => { return value.trim().length ? undefined : "Required"; }, @@ -46,7 +46,7 @@ export async function addServer( spec.webServer.host = host.trim(); const portString = await vscode.window.showInputBox({ ignoreFocusOut: true, - placeHolder: "Port of web server", + title: "Enter the port of the web server", validateInput: (value) => { const port = +value; return value.match(/\d+/) && @@ -61,23 +61,26 @@ export async function addServer( spec.webServer.port = +portString; const prefix = await vscode.window.showInputBox({ ignoreFocusOut: true, - placeHolder: - "Optional path prefix of instance", + title: + "Optionally enter the path prefix of the instance", }); if (typeof prefix !== "undefined") { if (prefix) { var pathPrefix = prefix.trim(); - if (pathPrefix.charAt(0) !== "/") { + if (!pathPrefix.startsWith("/")) { pathPrefix = "/" + pathPrefix; } + if (pathPrefix.endsWith("/")) { + pathPrefix = pathPrefix.slice(0, -1); + } spec.webServer.pathPrefix = pathPrefix; } } const username = await vscode.window.showInputBox({ ignoreFocusOut: true, - placeHolder: - "Username", + title: + "Enter the username", prompt: "Leave empty to be prompted when connecting.", }); @@ -89,7 +92,7 @@ export async function addServer( const scheme = await new Promise((resolve) => { let result: string; const quickPick = vscode.window.createQuickPick(); - quickPick.placeholder = "Confirm connection type, then the definition will be stored in your User Settings. 'Escape' to cancel."; + quickPick.title = "Confirm the connection type, then the definition will be stored in your User Settings. 'Escape' to cancel."; quickPick.ignoreFocusOut = true; quickPick.items = [{ label: "http" }, { label: "https" }]; quickPick.activeItems = [quickPick.items[spec.webServer.port == 443 ? 1 : 0]]; diff --git a/src/api/pickServer.ts b/src/api/pickServer.ts index e6c52c8..48c9287 100644 --- a/src/api/pickServer.ts +++ b/src/api/pickServer.ts @@ -26,7 +26,7 @@ export async function pickServer( let result: string; let resolveOnHide = true; const quickPick = vscode.window.createQuickPick(); - quickPick.title = "Choose server or use '+' to add one"; + quickPick.title = "Pick a server or use '+' to add one"; quickPick.placeholder = options.placeHolder; quickPick.matchOnDescription = options.matchOnDescription || true; quickPick.matchOnDetail = options.matchOnDetail || false; diff --git a/src/commands/importFromRegistry.ts b/src/commands/importFromRegistry.ts index 3223768..92c8bef 100644 --- a/src/commands/importFromRegistry.ts +++ b/src/commands/importFromRegistry.ts @@ -152,7 +152,7 @@ async function promptForUsernames(serverDefinitions: any, serversMissingUsername let serverName = serversMissingUsernames.splice(0, 1)[0]; let username = await vscode.window.showInputBox({ ignoreFocusOut: true, - placeHolder: "Enter a username. Leave empty to be prompted at connect time.", + title: "Enter a username. Leave empty to be prompted at connect time.", prompt: `Username for server '${serverName}'`, }); if (username === undefined) { @@ -175,7 +175,7 @@ async function promptForUsernames(serverDefinitions: any, serversMissingUsername const result = await vscode.window.showQuickPick(items, { canPickMany: false, ignoreFocusOut: true, - placeHolder: `${serversMissingUsernames.length} more servers lack a username. What do you want to do?`, + title: `${serversMissingUsernames.length} more servers lack a username. What do you want to do?`, }); if (result === undefined || result.label === items[2].label) { return false; @@ -219,7 +219,7 @@ async function promptForPasswords(secretStorage: vscode.SecretStorage, serverDef password = await vscode.window.showInputBox({ ignoreFocusOut: true, password: true, - placeHolder: "Enter password to store in keychain. Leave empty to be prompted at connect time.", + title: "Enter the password to store in keychain. Leave empty to be prompted at connect time.", prompt: `Password for connection to InterSystems server '${serverName}' as ${serverDefinitions[serverName].username}`, }); @@ -234,7 +234,7 @@ async function promptForPasswords(secretStorage: vscode.SecretStorage, serverDef } if ((reusePassword === undefined) && (promptServerNames.length > 1)) { - const placeHolder = (password === undefined) ? `Enter password later for remaining ${promptServerNames.length - 1} server(s)?` : `Store the same password for remaining ${promptServerNames.length - 1} server(s)?`; + const title = (password === undefined) ? `Enter password later for remaining ${promptServerNames.length - 1} server(s)?` : `Store the same password for remaining ${promptServerNames.length - 1} server(s)?`; const items = [ `No`, `Yes`, @@ -244,7 +244,7 @@ async function promptForPasswords(secretStorage: vscode.SecretStorage, serverDef const result = await vscode.window.showQuickPick(items, { canPickMany: false, ignoreFocusOut: true, - placeHolder, + title, }); if (result === undefined || result.label === items[2].label) { return; diff --git a/src/commonActivate.ts b/src/commonActivate.ts index 378299d..e7f5603 100644 --- a/src/commonActivate.ts +++ b/src/commonActivate.ts @@ -44,12 +44,12 @@ export function commonActivate(context: vscode.ExtensionContext, view: ServerMan if (!isfsExtension.isActive) { await isfsExtension.activate(); if (!isfsExtension.isActive) { - vscode.window.showErrorMessage(`${OBJECTSCRIPT_EXTENSIONID} could not be activated.`, "Close"); + vscode.window.showErrorMessage(`${OBJECTSCRIPT_EXTENSIONID} could not be activated.`, "Dismiss"); return; } } } else { - vscode.window.showErrorMessage(`${OBJECTSCRIPT_EXTENSIONID} is not installed.`, "Close"); + vscode.window.showErrorMessage(`${OBJECTSCRIPT_EXTENSIONID} is not installed.`, "Dismiss"); return; } @@ -66,7 +66,7 @@ export function commonActivate(context: vscode.ExtensionContext, view: ServerMan if (added) { await view.addToRecents(serverName); } else { - vscode.window.showErrorMessage(`Folder ${uri.toString()} could not be added.`, "Close"); + vscode.window.showErrorMessage(`Folder ${uri.toString()} could not be added.`, "Dismiss"); } } // Switch to Explorer view and focus on the folder