aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-05-19 20:39:27 +0100
committerAleksey Kladov <[email protected]>2020-05-20 00:23:05 +0100
commit4a3a525ea93cc5761e03aa066f6703dc9563bcaa (patch)
treeec44bf47051b3bf6f78e6c144b92874f7b705e30
parent28f6b5b8493024b87f53ea9be4d517442588b7e5 (diff)
Use new format for all assists that don't change cursor positon
-rw-r--r--crates/rust-analyzer/src/to_proto.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs
index 2b1a3378f..af54f81b7 100644
--- a/crates/rust-analyzer/src/to_proto.rs
+++ b/crates/rust-analyzer/src/to_proto.rs
@@ -639,7 +639,7 @@ fn main() <fold>{
639} 639}
640 640
641pub(crate) fn code_action(world: &WorldSnapshot, assist: Assist) -> Result<lsp_ext::CodeAction> { 641pub(crate) fn code_action(world: &WorldSnapshot, assist: Assist) -> Result<lsp_ext::CodeAction> {
642 let res = if assist.source_change.is_snippet { 642 let res = if assist.source_change.cursor_position.is_none() {
643 lsp_ext::CodeAction { 643 lsp_ext::CodeAction {
644 title: assist.label, 644 title: assist.label,
645 kind: Some(String::new()), 645 kind: Some(String::new()),
@@ -647,6 +647,7 @@ pub(crate) fn code_action(world: &WorldSnapshot, assist: Assist) -> Result<lsp_e
647 command: None, 647 command: None,
648 } 648 }
649 } else { 649 } else {
650 assert!(!assist.source_change.is_snippet);
650 let source_change = source_change(&world, assist.source_change)?; 651 let source_change = source_change(&world, assist.source_change)?;
651 let arg = serde_json::to_value(source_change)?; 652 let arg = serde_json::to_value(source_change)?;
652 let title = assist.label; 653 let title = assist.label;