Skip to content

Commit

Permalink
Allow LSP to start with partial config (FuelLabs#3736)
Browse files Browse the repository at this point in the history
Closes FuelLabs/sway.vim#6

Makes it so the LSP will use partial config when provided, and defaults
otherwise.

Confirmed it's working using partial config:
```
       init_options = {
         logging = { level = 'trace' },
         --inlayHints = { maxLength = 25, renderColons = true, typeHints = true },
         -- trace = {},
         --trace = { extension = true, server = 'messages' },
         -- debug = { showCollectedTokensAsWarnings = 'off' }
       },
```
  • Loading branch information
sdankel authored Jan 10, 2023
1 parent 564a5e7 commit f9c1e4c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sway-lsp/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ use tracing::metadata::LevelFilter;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct Config {
#[serde(default)]
pub debug: DebugConfig,
#[serde(default)]
pub logging: LoggingConfig,
#[serde(default)]
pub inlay_hints: InlayHintsConfig,
#[serde(skip_serializing)]
#[serde(default, skip_serializing)]
trace: TraceConfig,
}

Expand Down

0 comments on commit f9c1e4c

Please sign in to comment.