From 6e5971905edd8068b30a986e7e99910381a9a748 Mon Sep 17 00:00:00 2001 From: Matt <85322+mattmassicotte@users.noreply.github.com> Date: Tue, 28 Nov 2023 12:03:16 -0500 Subject: [PATCH] Remove redundant message framing --- Sources/LanguageClient/DataChannel+LocalProcess.swift | 4 +--- Sources/LanguageClient/DataChannel+UserScript.swift | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Sources/LanguageClient/DataChannel+LocalProcess.swift b/Sources/LanguageClient/DataChannel+LocalProcess.swift index 10c8279..95b43e1 100644 --- a/Sources/LanguageClient/DataChannel+LocalProcess.swift +++ b/Sources/LanguageClient/DataChannel+LocalProcess.swift @@ -53,9 +53,7 @@ extension DataChannel { // to prevent it from being deallocated _ = process - let data = MessageFraming.frame($0) - - try stdinPipe.fileHandleForWriting.write(contentsOf: data) + try stdinPipe.fileHandleForWriting.write(contentsOf: $0) } return DataChannel(writeHandler: handler, dataSequence: stream) diff --git a/Sources/LanguageClient/DataChannel+UserScript.swift b/Sources/LanguageClient/DataChannel+UserScript.swift index 10d866c..2576418 100644 --- a/Sources/LanguageClient/DataChannel+UserScript.swift +++ b/Sources/LanguageClient/DataChannel+UserScript.swift @@ -76,9 +76,7 @@ extension DataChannel { // Forward messages from the data channel into stdin let handler: DataChannel.WriteHandler = { - let data = MessageFraming.frame($0) - - try stdinPipe.fileHandleForWriting.write(contentsOf: data) + try stdinPipe.fileHandleForWriting.write(contentsOf: $0) } return DataChannel(writeHandler: handler, dataSequence: stream)