4286: Make incremental sync opt-in r=matklad a=lnicola

@matklad do you want to merge this? I'd make it opt-out, but it's fine to test it more.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
This commit is contained in:
bors[bot] 2020-05-04 03:03:52 +00:00 committed by GitHub
commit 57ec813294
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()),