1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use lsp_types::{Diagnostic, TextDocumentIdentifier};
use serde::{Deserialize, Serialize};

use super::BuildTargetIdentifier;

#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct PublishDiagnostics {
    /** The document where the diagnostics are published. */
    text_document: TextDocumentIdentifier,

    /** The build target where the diagnostics origin.
     * It is valid for one text document to belong to multiple
     * build targets, for example sources that are compiled against multiple
     * platforms (JVM, JavaScript). */
    build_target: BuildTargetIdentifier,

    /** The request id that originated this notification. */
    origin_id: Option<String>,

    /** The diagnostics to be published by the client. */
    diagnostics: Vec<Diagnostic>,

    /** Whether the client should clear the previous diagnostics
     * mapped to the same `textDocument` and `buildTarget`. */
    reset: bool,
}