From fe869e5dc7a8cd6c2c2e3945816bd890956eef3a Mon Sep 17 00:00:00 2001 From: kyfanc Date: Tue, 13 Feb 2024 18:58:53 +0800 Subject: fix lsp config reload (#9415) `syn_loader` was replaced rather than interior value being replace, old value was still being referenced and not updated after `:config-refresh`. By using `ArcSwap` like for `config`, each `.load()` call will return the most updated value. Co-authored-by: kyfan --- helix-term/src/ui/lsp.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'helix-term/src/ui/lsp.rs') diff --git a/helix-term/src/ui/lsp.rs b/helix-term/src/ui/lsp.rs index 7037b155..879f963e 100644 --- a/helix-term/src/ui/lsp.rs +++ b/helix-term/src/ui/lsp.rs @@ -1,5 +1,6 @@ use std::sync::Arc; +use arc_swap::ArcSwap; use helix_core::syntax; use helix_view::graphics::{Margin, Rect, Style}; use tui::buffer::Buffer; @@ -18,13 +19,17 @@ pub struct SignatureHelp { active_param_range: Option<(usize, usize)>, language: String, - config_loader: Arc, + config_loader: Arc>, } impl SignatureHelp { pub const ID: &'static str = "signature-help"; - pub fn new(signature: String, language: String, config_loader: Arc) -> Self { + pub fn new( + signature: String, + language: String, + config_loader: Arc>, + ) -> Self { Self { signature, signature_doc: None, -- cgit v1.2.3-70-g09d2