aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/rust-analyzer/src/caps.rs6
-rw-r--r--crates/rust-analyzer/src/main_loop.rs10
-rw-r--r--docs/user/readme.adoc6
3 files changed, 13 insertions, 9 deletions
diff --git a/crates/rust-analyzer/src/caps.rs b/crates/rust-analyzer/src/caps.rs
index 680415cac..110c9a442 100644
--- a/crates/rust-analyzer/src/caps.rs
+++ b/crates/rust-analyzer/src/caps.rs
@@ -17,10 +17,10 @@ pub fn server_capabilities() -> ServerCapabilities {
17 ServerCapabilities { 17 ServerCapabilities {
18 text_document_sync: Some(TextDocumentSyncCapability::Options(TextDocumentSyncOptions { 18 text_document_sync: Some(TextDocumentSyncCapability::Options(TextDocumentSyncOptions {
19 open_close: Some(true), 19 open_close: Some(true),
20 change: Some(if env::var("RA_PROFILE").is_ok() { 20 change: Some(if env::var("RA_NO_INCREMENTAL_SYNC").is_ok() {
21 TextDocumentSyncKind::Incremental
22 } else {
23 TextDocumentSyncKind::Full 21 TextDocumentSyncKind::Full
22 } else {
23 TextDocumentSyncKind::Incremental
24 }), 24 }),
25 will_save: None, 25 will_save: None,
26 will_save_wait_until: None, 26 will_save_wait_until: None,
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs
index 401fae755..b163ea848 100644
--- a/crates/rust-analyzer/src/main_loop.rs
+++ b/crates/rust-analyzer/src/main_loop.rs
@@ -676,13 +676,13 @@ fn apply_document_changes(
676 // remember the last valid line in the index and only rebuild it if needed. 676 // remember the last valid line in the index and only rebuild it if needed.
677 enum IndexValid { 677 enum IndexValid {
678 All, 678 All,
679 UpToLine(u64), 679 UpToLineExclusive(u64),
680 } 680 }
681 681
682 impl IndexValid { 682 impl IndexValid {
683 fn covers(&self, line: u64) -> bool { 683 fn covers(&self, line: u64) -> bool {
684 match *self { 684 match *self {
685 IndexValid::UpToLine(to) => to >= line, 685 IndexValid::UpToLineExclusive(to) => to > line,
686 _ => true, 686 _ => true,
687 } 687 }
688 } 688 }
@@ -692,10 +692,10 @@ fn apply_document_changes(
692 for change in content_changes { 692 for change in content_changes {
693 match change.range { 693 match change.range {
694 Some(range) => { 694 Some(range) => {
695 if !index_valid.covers(range.start.line) { 695 if !index_valid.covers(range.end.line) {
696 line_index = Cow::Owned(LineIndex::new(&old_text)); 696 line_index = Cow::Owned(LineIndex::new(&old_text));
697 } 697 }
698 index_valid = IndexValid::UpToLine(range.start.line); 698 index_valid = IndexValid::UpToLineExclusive(range.start.line);
699 let range = range.conv_with(&line_index); 699 let range = range.conv_with(&line_index);
700 let mut text = old_text.to_owned(); 700 let mut text = old_text.to_owned();
701 match std::panic::catch_unwind(move || { 701 match std::panic::catch_unwind(move || {
@@ -713,7 +713,7 @@ fn apply_document_changes(
713 } 713 }
714 None => { 714 None => {
715 *old_text = change.text; 715 *old_text = change.text;
716 index_valid = IndexValid::UpToLine(0); 716 index_valid = IndexValid::UpToLineExclusive(0);
717 } 717 }
718 } 718 }
719 } 719 }
diff --git a/docs/user/readme.adoc b/docs/user/readme.adoc
index 2c0a96a05..69f5b13d6 100644
--- a/docs/user/readme.adoc
+++ b/docs/user/readme.adoc
@@ -57,7 +57,11 @@ To disable this notification put the following to `settings.json`
57---- 57----
58==== 58====
59 59
60The server binary is stored in `~/.config/Code/User/globalStorage/matklad.rust-analyzer` (Linux) or in `~/.Library/Application Support/Code/User/globalStorage/matklad.rust-analyzer` (macOS) or in `%APPDATA%\Code\User\globalStorage` (Windows). 60The server binary is stored in:
61
62* Linux: `~/.config/Code/User/globalStorage/matklad.rust-analyzer`
63* macOS: `~/Library/Application Support/Code/User/globalStorage/matklad.rust-analyzer`
64* Windows: `%APPDATA%\Code\User\globalStorage`
61 65
62Note that we only support the latest version of VS Code. 66Note that we only support the latest version of VS Code.
63 67