diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/rust-analyzer/src/to_proto.rs | 3 |
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 | ||
641 | pub(crate) fn code_action(world: &WorldSnapshot, assist: Assist) -> Result<lsp_ext::CodeAction> { | 641 | pub(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; |