Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: LSP initialization options #1584

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/clarity-lsp/src/common/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ pub fn process_mutating_request(
LspRequest::Initialize(params) => {
let initialization_options = params
.initialization_options
.and_then(|o| serde_json::from_str(o.as_str()?).ok())
.and_then(|o| serde_json::from_value(o).ok())
.unwrap_or(InitializationOptions::default());

match editor_state.try_write(|es| es.settings = initialization_options.clone()) {
Expand Down
2 changes: 1 addition & 1 deletion components/clarity-lsp/src/common/requests/capabilities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use lsp_types::{
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Deserialize, Serialize, Default)]
#[serde(rename_all = "camelCase")]
#[serde(rename_all = "camelCase", default)]
pub struct InitializationOptions {
completion: bool,
pub completion_smart_parenthesis_wrap: bool,
Expand Down
Loading