From 87a18b18eab859cbfcbaf178bc6355215dae8381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Sun, 3 May 2020 20:56:36 +0300 Subject: [PATCH] Make incremental sync opt-in --- crates/rust-analyzer/src/caps.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/rust-analyzer/src/caps.rs b/crates/rust-analyzer/src/caps.rs index 44222d8bd8..680415caca 100644 --- a/crates/rust-analyzer/src/caps.rs +++ b/crates/rust-analyzer/src/caps.rs @@ -1,4 +1,5 @@ //! Advertizes the capabilities of the LSP Server. +use std::env; use crate::semantic_tokens; @@ -16,7 +17,11 @@ pub fn server_capabilities() -> ServerCapabilities { ServerCapabilities { text_document_sync: Some(TextDocumentSyncCapability::Options(TextDocumentSyncOptions { open_close: Some(true), - change: Some(TextDocumentSyncKind::Incremental), + change: Some(if env::var("RA_PROFILE").is_ok() { + TextDocumentSyncKind::Incremental + } else { + TextDocumentSyncKind::Full + }), will_save: None, will_save_wait_until: None, save: Some(SaveOptions::default()),