diff options
author | Laurențiu Nicola <[email protected]> | 2020-05-03 18:56:36 +0100 |
---|---|---|
committer | Laurențiu Nicola <[email protected]> | 2020-05-03 18:58:07 +0100 |
commit | 87a18b18eab859cbfcbaf178bc6355215dae8381 (patch) | |
tree | 8cfb6bb55eec6ac8a2b0f4ae5c4000a7acbd368c | |
parent | 76c2f4ef49d8fe89c1199899f9fe6289ddd95b6b (diff) |
Make incremental sync opt-in
-rw-r--r-- | crates/rust-analyzer/src/caps.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/caps.rs b/crates/rust-analyzer/src/caps.rs index 44222d8bd..680415cac 100644 --- a/crates/rust-analyzer/src/caps.rs +++ b/crates/rust-analyzer/src/caps.rs | |||
@@ -1,4 +1,5 @@ | |||
1 | //! Advertizes the capabilities of the LSP Server. | 1 | //! Advertizes the capabilities of the LSP Server. |
2 | use std::env; | ||
2 | 3 | ||
3 | use crate::semantic_tokens; | 4 | use crate::semantic_tokens; |
4 | 5 | ||
@@ -16,7 +17,11 @@ pub fn server_capabilities() -> ServerCapabilities { | |||
16 | ServerCapabilities { | 17 | ServerCapabilities { |
17 | text_document_sync: Some(TextDocumentSyncCapability::Options(TextDocumentSyncOptions { | 18 | text_document_sync: Some(TextDocumentSyncCapability::Options(TextDocumentSyncOptions { |
18 | open_close: Some(true), | 19 | open_close: Some(true), |
19 | change: Some(TextDocumentSyncKind::Incremental), | 20 | change: Some(if env::var("RA_PROFILE").is_ok() { |
21 | TextDocumentSyncKind::Incremental | ||
22 | } else { | ||
23 | TextDocumentSyncKind::Full | ||
24 | }), | ||
20 | will_save: None, | 25 | will_save: None, |
21 | will_save_wait_until: None, | 26 | will_save_wait_until: None, |
22 | save: Some(SaveOptions::default()), | 27 | save: Some(SaveOptions::default()), |