Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'src/text/inlay.rs')
-rw-r--r--src/text/inlay.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/text/inlay.rs b/src/text/inlay.rs
index 37b98cf..049aad7 100644
--- a/src/text/inlay.rs
+++ b/src/text/inlay.rs
@@ -1,5 +1,5 @@
use Default::default;
-use lsp_types::{InlayHint, InlayHintLabel, Location};
+use lsp_types::{InlayHint, Label, Location};
use serde_derive::{Deserialize, Serialize};
use crate::text::{RopeExt, TextArea};
@@ -37,11 +37,11 @@ impl TextArea {
pub fn set_inlay(&mut self, inlay: &[InlayHint]) {
self.inlays = inlay
.iter()
- .map(|i| {
+ .filter_map(|i| {
let mut label = match &i.label {
- InlayHintLabel::String(x) =>
+ Label::String(x) =>
x.chars().map(|x| (x, None)).collect::<Vec<_>>(),
- InlayHintLabel::LabelParts(v) => v
+ Label::InlayHintLabelPartList(v) => v
.iter()
.flat_map(|x| {
x.value
@@ -56,8 +56,8 @@ impl TextArea {
if i.padding_right == Some(true) {
label.push((' ', None));
}
- let position = self.l_position(i.position).unwrap() as _;
- Marking { position, data: label.into() }
+ let position = self.l_position(i.position)? as _;
+ Some(Marking { position, data: label.into() })
})
.collect();
}