diff options
Diffstat (limited to 'crates')
-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()), |