|
|
@ -578,20 +578,26 @@ mod tests {
|
|
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
#[test]
|
|
|
|
fn test_tag_support_deserialization() {
|
|
|
|
fn test_tag_support_deserialization() {
|
|
|
|
let mut empty = CompletionItemCapability::default();
|
|
|
|
let empty = CompletionItemCapability {
|
|
|
|
empty.tag_support = None;
|
|
|
|
tag_support: None,
|
|
|
|
|
|
|
|
..CompletionItemCapability::default()
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
test_deserialization(r#"{}"#, &empty);
|
|
|
|
test_deserialization(r#"{}"#, &empty);
|
|
|
|
test_deserialization(r#"{"tagSupport": false}"#, &empty);
|
|
|
|
test_deserialization(r#"{"tagSupport": false}"#, &empty);
|
|
|
|
|
|
|
|
|
|
|
|
let mut t = CompletionItemCapability::default();
|
|
|
|
let t = CompletionItemCapability {
|
|
|
|
t.tag_support = Some(TagSupport { value_set: vec![] });
|
|
|
|
tag_support: Some(TagSupport { value_set: vec![] }),
|
|
|
|
|
|
|
|
..CompletionItemCapability::default()
|
|
|
|
|
|
|
|
};
|
|
|
|
test_deserialization(r#"{"tagSupport": true}"#, &t);
|
|
|
|
test_deserialization(r#"{"tagSupport": true}"#, &t);
|
|
|
|
|
|
|
|
|
|
|
|
let mut t = CompletionItemCapability::default();
|
|
|
|
let t = CompletionItemCapability {
|
|
|
|
t.tag_support = Some(TagSupport {
|
|
|
|
tag_support: Some(TagSupport {
|
|
|
|
value_set: vec![CompletionItemTag::DEPRECATED],
|
|
|
|
value_set: vec![CompletionItemTag::DEPRECATED],
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
|
|
|
|
..CompletionItemCapability::default()
|
|
|
|
|
|
|
|
};
|
|
|
|
test_deserialization(r#"{"tagSupport": {"valueSet": [1]}}"#, &t);
|
|
|
|
test_deserialization(r#"{"tagSupport": {"valueSet": [1]}}"#, &t);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|