Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'src/sig.rs')
-rw-r--r--src/sig.rs19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/sig.rs b/src/sig.rs
index e1e0cfd..884fbac 100644
--- a/src/sig.rs
+++ b/src/sig.rs
@@ -3,8 +3,8 @@ use std::iter::repeat_n;
use dsb::Cell;
use dsb::cell::Style;
use lsp_types::{
- MarkupContent, ParameterInformation, SignatureHelp,
- SignatureInformation,
+ MarkupContent, ParameterInformation, ParameterInformationLabel,
+ SignatureHelp, SignatureInformation,
};
use crate::FG;
@@ -16,9 +16,14 @@ pub fn active(
let y = &sig.signatures.get(sig.active_signature? as usize)?;
Some((
y,
- sig.active_parameter
- .zip(y.parameters.as_ref())
- .and_then(|(i, x)| x.get(i as usize)),
+ sig.active_parameter.zip(y.parameters.as_ref()).and_then(
+ |(i, x)| {
+ x.get(match i {
+ lsp_types::ActiveParameter::Int(n) => n as usize,
+ lsp_types::ActiveParameter::Null => return None,
+ })
+ },
+ ),
))
}
@@ -32,8 +37,8 @@ pub fn sig(
let sig = y.label.chars().zip(0..).map(|(x, i)| {
let mut a = ds.basic(x);
if p.is_some_and(|x| match x.label {
- lsp_types::ParameterLabel::Simple(_) => false,
- lsp_types::ParameterLabel::LabelOffsets([a, b]) =>
+ ParameterInformationLabel::String(_) => false,
+ ParameterInformationLabel::Tuple((a, b)) =>
(a..b).contains(&i),
}) {
a.style |= (Style::BOLD, color_("#ffcc66"));