wsb-daemon 0.275.7622

wsb's daemon: the workbench, the GitHub mirror's schedule and peer continuity, for every workspace on the machine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::*;

/// TEST20100: what the daemon sends a language server to start it is the protocol's
/// `initialize`, read whole by the protocol's own types.
///
/// A server cannot act on parameters it cannot read: omni refuses the session, and the editor
/// is left without code intelligence.
#[test]
fn test20100_the_initialize_the_daemon_sends_is_the_protocols() {
    let dir = tempfile::tempdir().expect("a directory");
    let root = AnalysisRoot { dir: dir.path().to_owned(), exclude: vec!["wsb/**".to_owned()] };
    let sent = initialize_params(&root).expect("parameters");
    let read: lsp_types::InitializeParams = serde_json::from_value(sent.clone()).expect("the protocol's initialize");
    let tokens = read.capabilities.text_document.and_then(|t| t.semantic_tokens).expect("semantic tokens are asked for");
    assert!(tokens.token_types.iter().any(|t| t.as_str() == "function"), "{sent}");
    assert_eq!(sent["initializationOptions"]["exclude"], serde_json::json!(["wsb/**"]));
}