diff --git a/src/omnisharp/server.ts b/src/omnisharp/server.ts index 8a209b4b77..4dbcfcdfd3 100644 --- a/src/omnisharp/server.ts +++ b/src/omnisharp/server.ts @@ -29,7 +29,8 @@ import CompositeDisposable from '../CompositeDisposable'; import Disposable from '../Disposable'; import OptionProvider from '../observers/OptionProvider'; import { IMonoResolver } from '../constants/IMonoResolver'; -import * as removeBom from "remove-bom-buffer"; +const removeBomBuffer = require("remove-bom-buffer"); +const removeBomString = require("strip-bom"); enum ServerState { Starting, @@ -517,7 +518,7 @@ export class OmniSharpServer { private async _doConnect(options: Options): Promise { this._serverProcess.stderr.on('data', (data: Buffer) => { - let trimData = removeBom.remove(data); + let trimData = removeBomBuffer(data); if (trimData.length > 0) { this._fireEvent(Events.StdErr, trimData.toString()); } @@ -567,6 +568,7 @@ export class OmniSharpServer { } private _onLineReceived(line: string) { + line = removeBomString(line); line = line.trim(); if (line[0] !== '{') { diff --git a/typings/remove-bom-buffer.d.ts b/typings/remove-bom-buffer.d.ts deleted file mode 100644 index 5dd7cfdde7..0000000000 --- a/typings/remove-bom-buffer.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare module 'remove-bom-buffer' { - export function remove(buffer: Buffer): Buffer; -}