Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'lib/lsp-server/src/lib.rs')
-rw-r--r--lib/lsp-server/src/lib.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/lsp-server/src/lib.rs b/lib/lsp-server/src/lib.rs
index c8cdb86681..315cb2d5c3 100644
--- a/lib/lsp-server/src/lib.rs
+++ b/lib/lsp-server/src/lib.rs
@@ -14,7 +14,7 @@ mod socket;
mod stdio;
use std::{
- io,
+ io::{self, Stdin, Stdout},
net::{TcpListener, TcpStream, ToSocketAddrs},
};
@@ -37,8 +37,11 @@ impl Connection {
/// Create connection over standard in/standard out.
///
/// Use this to create a real language server.
- pub fn stdio() -> (Connection, IoThreads) {
- let (sender, receiver, io_threads) = stdio::stdio_transport();
+ pub fn stdio(
+ stdout: impl io::Read + io::BufRead + Sync + Send + 'static,
+ stdin: impl io::Write + Sync + Send + 'static,
+ ) -> (Connection, IoThreads) {
+ let (sender, receiver, io_threads) = stdio::stdio_transport(stdout, stdin);
(Connection { sender, receiver }, io_threads)
}