2024-09-13 14:54:23 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
2024-11-12 22:21:58 +00:00
|
|
|
use std::{collections::HashMap, num::NonZeroU32};
|
2024-09-13 14:54:23 +00:00
|
|
|
|
|
|
|
/// The settings for a particular language.
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
|
|
pub struct LanguageSettings {
|
|
|
|
/// How many columns a tab should occupy.
|
|
|
|
pub tab_size: NonZeroU32,
|
|
|
|
}
|
|
|
|
|
|
|
|
/// The settings for a particular language server.
|
|
|
|
#[derive(Default, Debug, Serialize, Deserialize)]
|
|
|
|
pub struct LspSettings {
|
|
|
|
/// The settings for the language server binary.
|
2024-11-12 22:21:58 +00:00
|
|
|
pub binary: Option<CommandSettings>,
|
2024-09-13 14:54:23 +00:00
|
|
|
/// The initialization options to pass to the language server.
|
|
|
|
pub initialization_options: Option<serde_json::Value>,
|
|
|
|
/// The settings to pass to language server.
|
|
|
|
pub settings: Option<serde_json::Value>,
|
|
|
|
}
|
|
|
|
|
2024-11-12 22:21:58 +00:00
|
|
|
/// The settings for a particular context server.
|
|
|
|
#[derive(Default, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
|
|
|
pub struct ContextServerSettings {
|
|
|
|
/// The settings for the context server binary.
|
|
|
|
pub command: Option<CommandSettings>,
|
|
|
|
/// The settings to pass to the context server.
|
|
|
|
pub settings: Option<serde_json::Value>,
|
|
|
|
}
|
|
|
|
|
|
|
|
/// The settings for a command.
|
|
|
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
|
|
|
|
pub struct CommandSettings {
|
|
|
|
/// The path to the command.
|
2024-09-13 14:54:23 +00:00
|
|
|
pub path: Option<String>,
|
2024-11-12 22:21:58 +00:00
|
|
|
/// The arguments to pass to the command.
|
2024-09-13 14:54:23 +00:00
|
|
|
pub arguments: Option<Vec<String>>,
|
2024-11-12 22:21:58 +00:00
|
|
|
/// The environment variables.
|
|
|
|
pub env: Option<HashMap<String, String>>,
|
2024-09-13 14:54:23 +00:00
|
|
|
}
|