From c7243e4a59ae5aa6c0ffdc9c4aa196071f1d3b6b Mon Sep 17 00:00:00 2001 From: kjeremy Date: Fri, 18 Sep 2020 11:39:25 -0400 Subject: Support active parameters at the per-signature level Update crates --- crates/rust-analyzer/Cargo.toml | 2 +- crates/rust-analyzer/src/to_proto.rs | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'crates') diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml index 8db0b0d72..0fbb9cb0d 100644 --- a/crates/rust-analyzer/Cargo.toml +++ b/crates/rust-analyzer/Cargo.toml @@ -21,7 +21,7 @@ env_logger = { version = "0.7.1", default-features = false } itertools = "0.9.0" jod-thread = "0.1.0" log = "0.4.8" -lsp-types = { version = "0.80.0", features = ["proposed"] } +lsp-types = { version = "0.81.0", features = ["proposed"] } parking_lot = "0.11.0" pico-args = "0.3.1" oorandom = "11.1.2" diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs index dcbf837d6..59e780b7d 100644 --- a/crates/rust-analyzer/src/to_proto.rs +++ b/crates/rust-analyzer/src/to_proto.rs @@ -285,12 +285,18 @@ pub(crate) fn signature_help( }) }; - let signature = - lsp_types::SignatureInformation { label, documentation, parameters: Some(parameters) }; + let active_parameter = call_info.active_parameter.map(|it| it as i64); + + let signature = lsp_types::SignatureInformation { + label, + documentation, + parameters: Some(parameters), + active_parameter, + }; lsp_types::SignatureHelp { signatures: vec![signature], active_signature: None, - active_parameter: call_info.active_parameter.map(|it| it as i64), + active_parameter, } } -- cgit v1.2.3