Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into sagerb-eliminate-thro…
Browse files Browse the repository at this point in the history
…ws-for-internal-errors
  • Loading branch information
sagerb committed Aug 21, 2024
2 parents 93a3562 + 8959587 commit 4359e7a
Show file tree
Hide file tree
Showing 17 changed files with 522 additions and 505 deletions.
1 change: 1 addition & 0 deletions extensions/vscode/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"eqeqeq": "warn",
"no-throw-literal": "error",
"semi": "off",
"require-await": "error",
"no-restricted-syntax": [
"error",
{
Expand Down
358 changes: 165 additions & 193 deletions extensions/vscode/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion extensions/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@
"dependencies": {
"@hypersphere/omnibus": "0.1.6",
"@vscode/codicons": "^0.0.36",
"axios": "^1.6.0",
"axios": "^1.7.4",
"debounce": "^2.1.0",
"eventsource": "^2.0.2",
"get-port": "5.1.1",
Expand Down
4 changes: 1 addition & 3 deletions extensions/vscode/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ export const create = async (
return [executable, [subcommand, "-vv", `--listen=${HOST}:${port}`, path]];
};

const getExecutableBinary = async (
context: ExtensionContext,
): Promise<string> => {
const getExecutableBinary = (context: ExtensionContext): string => {
return path.join(context.extensionPath, "bin", "publisher");
};
12 changes: 6 additions & 6 deletions extensions/vscode/src/dialogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,27 @@ async function confirm(
return choice === affirmativeItem;
}

export async function confirmOK(message: string): Promise<boolean> {
export function confirmOK(message: string): Promise<boolean> {
return confirm(message, okItem);
}

export async function confirmYes(message: string): Promise<boolean> {
export function confirmYes(message: string): Promise<boolean> {
return confirm(message, yesItem);
}

export async function confirmDelete(message: string): Promise<boolean> {
export function confirmDelete(message: string): Promise<boolean> {
return confirm(message, deleteItem);
}

export async function confirmForget(message: string): Promise<boolean> {
export function confirmForget(message: string): Promise<boolean> {
return confirm(message, forgetItem);
}

export async function confirmReplace(message: string): Promise<boolean> {
export function confirmReplace(message: string): Promise<boolean> {
return confirm(message, replaceItem);
}

export async function confirmOverwrite(message: string): Promise<boolean> {
export function confirmOverwrite(message: string): Promise<boolean> {
return confirm(message, overwriteItem);
}

Expand Down
2 changes: 1 addition & 1 deletion extensions/vscode/src/multiStepInputs/multiStepHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ interface InputBoxParameters {

export class MultiStepInput {
// These were templatized: static async run<T>(start: InputStep) {
static async run(start: InputStep) {
static run(start: InputStep) {
const input = new MultiStepInput();
return input.stepThrough(start);
}
Expand Down
2 changes: 1 addition & 1 deletion extensions/vscode/src/ports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

import getPort = require("get-port");

export const acquire = async (): Promise<number> => {
export const acquire = (): Promise<number> => {
return getPort();
};
10 changes: 5 additions & 5 deletions extensions/vscode/src/servers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ export class Server implements Disposable {
* @returns {Promise<boolean>} A Promise that resolves to `true` if the server is up, and rejects if all attempts fail.
* @throws {Error} Will throw an error if the connection check encounters an error or reaches the maximum number of retries.
*/
async isUp(): Promise<boolean> {
isUp(): Promise<boolean> {
const operation = retry.operation();
return new Promise(async (resolve, reject) => {
return new Promise((resolve, reject) => {
// Attempt the operation with exponential backoff
operation.attempt(async (attempt) => {
try {
Expand Down Expand Up @@ -122,9 +122,9 @@ export class Server implements Disposable {
* @returns {Promise<boolean>} A Promise that resolves to `true` if the server is down, and rejects if all attempts fail.
* @throws {Error} Will throw an error if the connection check encounters an error (excluding ECONNREFUSED) or reaches the maximum number of retries.
*/
async isDown(): Promise<boolean> {
isDown(): Promise<boolean> {
const operation = retry.operation();
return new Promise(async (resolve, reject) => {
return new Promise((resolve, reject) => {
// Attempt the operation with exponential backoff
operation.attempt(async (attempt) => {
try {
Expand Down Expand Up @@ -172,7 +172,7 @@ export class Server implements Disposable {
* @returns {Promise<boolean>} A Promise that resolves to `true` if the server is reachable within the timeout, resolves to `false` if the connection times out, and rejects if an error occurs.
* @throws {Error} Will throw an error if the connection encounters an error or is closed with an error.
*/
private async check(timeout: number = 1000): Promise<boolean> {
private check(timeout: number = 1000): Promise<boolean> {
return new Promise((resolve, reject) => {
// Create a new socket
const socket = new net.Socket();
Expand Down
4 changes: 2 additions & 2 deletions extensions/vscode/src/test/suite/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { Extension, extensions } from "vscode";

// import * as myExtension from '../../extension';

suite("Extension Test Suite", async () => {
test("extension is registered", async () => {
suite("Extension Test Suite", () => {
test("extension is registered", () => {
const extension: Extension<any> =
extensions.getExtension("posit.publisher")!;
assert.ok(extension !== undefined);
Expand Down
2 changes: 1 addition & 1 deletion extensions/vscode/src/utils/names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function contentRecordNameValidator(
contentRecordNames: string[],
currentName: string,
) {
return async (value: string) => {
return (value: string) => {
const isUnique =
value === currentName ||
uniqueContentRecordName(value, contentRecordNames);
Expand Down
2 changes: 1 addition & 1 deletion extensions/vscode/src/utils/progress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function showProgress(
title,
location: viewId ? { viewId } : ProgressLocation.Window,
},
async () => {
() => {
return until;
},
);
Expand Down
6 changes: 3 additions & 3 deletions extensions/vscode/src/views/homeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ export class HomeViewProvider implements WebviewViewProvider, Disposable {
}
}

private async onDeployMsg(msg: DeployMsg) {
this.initiateDeployment(
private onDeployMsg(msg: DeployMsg) {
return this.initiateDeployment(
msg.content.deploymentName,
msg.content.credentialName,
msg.content.configurationName,
Expand Down Expand Up @@ -734,7 +734,7 @@ export class HomeViewProvider implements WebviewViewProvider, Disposable {
}
}

private async propagateDeploymentSelection(
private propagateDeploymentSelection(
deploymentSelector: DeploymentSelector | null,
) {
// We have to break our protocol and go ahead and write this into storage,
Expand Down
Loading

0 comments on commit 4359e7a

Please sign in to comment.