Skip to content

Commit

Permalink
Remove redundant message framing
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Nov 28, 2023
1 parent eda2fdc commit 6e59719
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions Sources/LanguageClient/DataChannel+LocalProcess.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions Sources/LanguageClient/DataChannel+UserScript.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6e59719

Please sign in to comment.