diff options
Diffstat (limited to 'crates/server')
-rw-r--r-- | crates/server/src/main.rs | 9 |
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 | ||
32 | fn main_inner() -> Result<()> { | 32 | fn 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 | )?; |