refactor: remove dead code (#5188)
* refactor: delete unused code
* refactor: move onLine to test helpers
* Revert "refactor: move onLine to test helpers"
This reverts commit 32cc27b213
.
* fixup! refactor: delete unused code
This commit is contained in:
@ -102,29 +102,6 @@ export const ensureAddress = (server: http.Server, protocol: string): URL | stri
|
||||
return addr
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles error events from the server.
|
||||
*
|
||||
* If the outlying Promise didn't resolve
|
||||
* then we reject with the error.
|
||||
*
|
||||
* Otherwise, we log the error.
|
||||
*
|
||||
* We extracted into a function so that we could
|
||||
* test this logic more easily.
|
||||
*/
|
||||
export const handleServerError = (resolved: boolean, err: Error, reject: (err: Error) => void) => {
|
||||
// Promise didn't resolve earlier so this means it's an error
|
||||
// that occurs before the server can successfully listen.
|
||||
// Possibly triggered by listening on an invalid port or socket.
|
||||
if (!resolved) {
|
||||
reject(err)
|
||||
} else {
|
||||
// Promise resolved earlier so this is an unrelated error.
|
||||
util.logError(logger, "http server error", err)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the error that occurs in the catch block
|
||||
* after we try fs.unlink(args.socket).
|
||||
|
@ -3,8 +3,6 @@ import type { JSONSchemaForNPMPackageJsonFiles } from "@schemastore/package"
|
||||
import * as os from "os"
|
||||
import * as path from "path"
|
||||
|
||||
export const WORKBENCH_WEB_CONFIG_ID = "vscode-workbench-web-configuration"
|
||||
|
||||
export function getPackageJson(relativePath: string): JSONSchemaForNPMPackageJsonFiles {
|
||||
let pkg = {}
|
||||
try {
|
||||
@ -21,7 +19,6 @@ export const vsRootPath = path.join(rootPath, "lib/vscode")
|
||||
const PACKAGE_JSON = "package.json"
|
||||
const pkg = getPackageJson(`${rootPath}/${PACKAGE_JSON}`)
|
||||
const codePkg = getPackageJson(`${vsRootPath}/${PACKAGE_JSON}`) || { version: "0.0.0" }
|
||||
export const pkgName = pkg.name || "code-server"
|
||||
export const version = pkg.version || "development"
|
||||
export const commit = pkg.commit || "development"
|
||||
export const codeVersion = codePkg.version || "development"
|
||||
|
@ -426,15 +426,6 @@ export const enumToArray = (t: any): string[] => {
|
||||
return values
|
||||
}
|
||||
|
||||
/**
|
||||
* For displaying all allowed options in an enum.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export const buildAllowedMessage = (t: any): string => {
|
||||
const values = enumToArray(t)
|
||||
return `Allowed value${values.length === 1 ? " is" : "s are"} ${values.map((t) => `'${t}'`).join(", ")}`
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a promise that resolves with whether the socket path is active.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user