diff options
author | Aleksey Kladov <[email protected]> | 2021-01-05 13:57:05 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-01-05 14:46:57 +0000 |
commit | 624eb1ee54e759c03d07c06e5e68dec7f36cb519 (patch) | |
tree | e7ee04b6a3cb030e4db0c3d118d723b8cf3704e0 /crates/rust-analyzer/src/to_proto.rs | |
parent | c8d3d5694be065ffb1d52bc33e098ff610693097 (diff) |
More maintainable caps config
The idea here is that we preserve client's config as is, without
changes. This gets rid of state!
Diffstat (limited to 'crates/rust-analyzer/src/to_proto.rs')
-rw-r--r-- | crates/rust-analyzer/src/to_proto.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs index 999b18351..e0413ec06 100644 --- a/crates/rust-analyzer/src/to_proto.rs +++ b/crates/rust-analyzer/src/to_proto.rs | |||
@@ -605,7 +605,7 @@ pub(crate) fn goto_definition_response( | |||
605 | src: Option<FileRange>, | 605 | src: Option<FileRange>, |
606 | targets: Vec<NavigationTarget>, | 606 | targets: Vec<NavigationTarget>, |
607 | ) -> Result<lsp_types::GotoDefinitionResponse> { | 607 | ) -> Result<lsp_types::GotoDefinitionResponse> { |
608 | if snap.config.client_caps.location_link { | 608 | if snap.config.location_link() { |
609 | let links = targets | 609 | let links = targets |
610 | .into_iter() | 610 | .into_iter() |
611 | .map(|nav| location_link(snap, src, nav)) | 611 | .map(|nav| location_link(snap, src, nav)) |
@@ -785,7 +785,7 @@ pub(crate) fn unresolved_code_action( | |||
785 | assert!(assist.source_change.is_none()); | 785 | assert!(assist.source_change.is_none()); |
786 | let res = lsp_ext::CodeAction { | 786 | let res = lsp_ext::CodeAction { |
787 | title: assist.label.to_string(), | 787 | title: assist.label.to_string(), |
788 | group: assist.group.filter(|_| snap.config.client_caps.code_action_group).map(|gr| gr.0), | 788 | group: assist.group.filter(|_| snap.config.code_action_group()).map(|gr| gr.0), |
789 | kind: Some(code_action_kind(assist.id.1)), | 789 | kind: Some(code_action_kind(assist.id.1)), |
790 | edit: None, | 790 | edit: None, |
791 | is_preferred: None, | 791 | is_preferred: None, |
@@ -805,7 +805,7 @@ pub(crate) fn resolved_code_action( | |||
805 | let res = lsp_ext::CodeAction { | 805 | let res = lsp_ext::CodeAction { |
806 | edit: Some(snippet_workspace_edit(snap, change)?), | 806 | edit: Some(snippet_workspace_edit(snap, change)?), |
807 | title: assist.label.to_string(), | 807 | title: assist.label.to_string(), |
808 | group: assist.group.filter(|_| snap.config.client_caps.code_action_group).map(|gr| gr.0), | 808 | group: assist.group.filter(|_| snap.config.code_action_group()).map(|gr| gr.0), |
809 | kind: Some(code_action_kind(assist.id.1)), | 809 | kind: Some(code_action_kind(assist.id.1)), |
810 | is_preferred: None, | 810 | is_preferred: None, |
811 | data: None, | 811 | data: None, |