aboutsummaryrefslogtreecommitdiff
path: root/crates/server/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-09-05 19:38:43 +0100
committerAleksey Kladov <[email protected]>2018-09-05 19:38:43 +0100
commit47e8b80e9b67d5012fbc860a7763975e99fdf28d (patch)
treec7ed6488dd900c7d949cc0861c97c53b58e7becf /crates/server/src
parent529ebd5840b9f94c3105df3b2dc5419ff4d2a533 (diff)
use correct workdir for the server
Diffstat (limited to 'crates/server/src')
-rw-r--r--crates/server/src/main.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/server/src/main.rs b/crates/server/src/main.rs
index 5c0166a61..baabde629 100644
--- a/crates/server/src/main.rs
+++ b/crates/server/src/main.rs
@@ -31,10 +31,15 @@ fn main() -> Result<()> {
31 31
32fn main_inner() -> Result<()> { 32fn main_inner() -> Result<()> {
33 let (receiver, sender, threads) = stdio_transport(); 33 let (receiver, sender, threads) = stdio_transport();
34 let root = ::std::env::current_dir()?; 34 let cwd = ::std::env::current_dir()?;
35 run_server( 35 run_server(
36 m::server_capabilities(), 36 m::server_capabilities(),
37 |r, s| m::main_loop(false, root, r, s), 37 |params, r, s| {
38 let root = params.root_uri
39 .and_then(|it| it.to_file_path().ok())
40 .unwrap_or(cwd);
41 m::main_loop(false, root, r, s)
42 },
38 receiver, 43 receiver,
39 sender, 44 sender,
40 )?; 45 )?;