From 385a2ba1806bb54b0281d396fb3b4fd5401bc904 Mon Sep 17 00:00:00 2001 From: Brad Cornes Date: Thu, 6 May 2021 15:18:25 +0100 Subject: [PATCH] reinstate console.log overrides --- src/server.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/server.ts b/src/server.ts index 88f9bf0..a6b4660 100644 --- a/src/server.ts +++ b/src/server.ts @@ -26,7 +26,7 @@ import { } from 'vscode-languageserver/node' import { TextDocument } from 'vscode-languageserver-textdocument' import { URI } from 'vscode-uri' -import { showError, SilentError } from './util/error' +import { formatError, showError, SilentError } from './util/error' import glob from 'fast-glob' import normalizePath from 'normalize-path' import * as path from 'path' @@ -94,12 +94,12 @@ declare var __non_webpack_require__: typeof require const connection = process.argv.length <= 2 ? createConnection(process.stdin, process.stdout) : createConnection() -// console.log = connection.console.log.bind(connection.console) -// console.error = connection.console.error.bind(connection.console) +console.log = connection.console.log.bind(connection.console) +console.error = connection.console.error.bind(connection.console) -// process.on('unhandledRejection', (e: any) => { -// connection.console.error(formatError(`Unhandled exception`, e)) -// }) +process.on('unhandledRejection', (e: any) => { + connection.console.error(formatError(`Unhandled exception`, e)) +}) function normalizeFileNameToFsPath(fileName: string) { return URI.file(fileName).fsPath