settings.rs

 1use serde::{Deserialize, Serialize};
 2use std::num::NonZeroU32;
 3
 4/// The settings for a particular language.
 5#[derive(Debug, Serialize, Deserialize)]
 6pub struct LanguageSettings {
 7    /// How many columns a tab should occupy.
 8    pub tab_size: NonZeroU32,
 9}
10
11/// The settings for a particular language server.
12#[derive(Default, Debug, Serialize, Deserialize)]
13pub struct LspSettings {
14    /// The settings for the language server binary.
15    pub binary: Option<BinarySettings>,
16    /// The initialization options to pass to the language server.
17    pub initialization_options: Option<serde_json::Value>,
18    /// The settings to pass to language server.
19    pub settings: Option<serde_json::Value>,
20}
21
22/// The settings for a language server binary.
23#[derive(Debug, Serialize, Deserialize)]
24pub struct BinarySettings {
25    /// The path to the binary.
26    pub path: Option<String>,
27    /// The arguments to pass to the binary.
28    pub arguments: Option<Vec<String>>,
29}