From 454f43cf3868698cb5004adb2a21f3ab58b51fb4 Mon Sep 17 00:00:00 2001 From: Akshita Agarwal Date: Wed, 19 Sep 2018 15:30:30 -0700 Subject: [PATCH] Remove the bom for the string and the buffer --- src/omnisharp/server.ts | 6 ++++-- typings/remove-bom-buffer.d.ts | 3 --- 2 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 typings/remove-bom-buffer.d.ts 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; -}