diff --git a/client/src/engine/jobs.ts b/client/src/engine/jobs.ts index a78d3ae5..7ee014da 100644 --- a/client/src/engine/jobs.ts +++ b/client/src/engine/jobs.ts @@ -33,8 +33,6 @@ export enum Request { apiVersion = 'api/version', apiShutdown = 'api/shutdown', - cmdRunTests = 'cmd/runTests', - lspCheck = 'lsp/check', lspCodelens = 'lsp/codelens', lspHighlight = 'lsp/highlight', diff --git a/server/src/engine/jobs.ts b/server/src/engine/jobs.ts index 4c468ebb..f7f0b71b 100644 --- a/server/src/engine/jobs.ts +++ b/server/src/engine/jobs.ts @@ -33,8 +33,6 @@ export enum Request { apiVersion = 'api/version', apiShutdown = 'api/shutdown', - cmdRunTests = 'cmd/runTests', - lspCheck = 'lsp/check', lspCodelens = 'lsp/codelens', lspHighlight = 'lsp/highlight', diff --git a/server/src/handlers/handlers.ts b/server/src/handlers/handlers.ts index 88259feb..c49f7b4f 100644 --- a/server/src/handlers/handlers.ts +++ b/server/src/handlers/handlers.ts @@ -40,10 +40,6 @@ interface UriInput { uri: string } -function printHorizontalRuler() { - console.log(_.repeat(48, String.fromCodePoint(0x23e4))) -} - export function handleInitialize(_params: InitializeParams) { const result: InitializeResult = { capabilities: { @@ -293,55 +289,6 @@ export const handleInlayHints = (params: InlayHintParams): Thenable => socket.eventEmitter.once(job.id, makeDefaultResponseHandler(resolve)) }) -/** - * @function - */ -export const handleRunTests = enqueueUnlessHasErrors( - { request: jobs.Request.cmdRunTests }, - makeRunTestsResponseHandler, - hasErrorsHandlerForCommands, -) - -function prettyPrintTestResults(result: any) { - if (_.isEmpty(result)) { - // nothing to print - sendNotification(jobs.Request.internalMessage, 'No tests to run') - return - } - printHorizontalRuler() - for (const test of result) { - console.log( - test.outcome === 'success' ? String.fromCodePoint(0x2705) : String.fromCodePoint(0x274c), - test.name, - test.outcome === 'success' - ? '' - : `(at ${test.location.uri}#${test.location.range.start.line}:${test.location.range.start.character})`, - ) - } - printHorizontalRuler() - const totalTests = _.size(result) - const successfulTests = _.size(_.filter({ outcome: 'success' }, result)) - const failingTests = totalTests - successfulTests - if (failingTests > 0) { - sendNotification(jobs.Request.internalError, { - message: `Tests Failed (${failingTests}/${totalTests})`, - actions: [], - }) - } else { - sendNotification(jobs.Request.internalMessage, `Tests Passed (${successfulTests}/${totalTests})`) - } -} - -function makeRunTestsResponseHandler(promiseResolver: (result?: socket.FlixResult) => void) { - return function responseHandler(flixResponse: socket.FlixResponse) { - // the status is always 'success' when with failing tests - const { result } = flixResponse - prettyPrintTestResults(result) - promiseResolver(result) - sendNotification(jobs.Request.internalFinishedJob, flixResponse) - } -} - function hasErrorsHandlerForCommands() { sendNotification(jobs.Request.internalError, { message: 'Cannot run commands when errors are present.', diff --git a/server/src/server.ts b/server/src/server.ts index 74b2ce82..3ff4eba2 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -43,9 +43,6 @@ connection.onNotification(jobs.Request.apiRemJar, handlers.handleRemJar) // Show ast connection.onNotification(jobs.Request.lspShowAst, handlers.handleShowAst) -// cmd/* -connection.onNotification(jobs.Request.cmdRunTests, handlers.handleRunTests) - // Cleanup after exit connection.onExit(handlers.handleExit)