aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui/lsp.rs
diff options
context:
space:
mode:
authorkyfanc2024-02-13 10:58:53 +0000
committerGitHub2024-02-13 10:58:53 +0000
commitfe869e5dc7a8cd6c2c2e3945816bd890956eef3a (patch)
treead0b899b482df976caf3cc2f079dc7d0d8a3769f /helix-term/src/ui/lsp.rs
parent7934ac77143e69068420556b043dde035255340b (diff)
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 <kyfan@email>
Diffstat (limited to 'helix-term/src/ui/lsp.rs')
-rw-r--r--helix-term/src/ui/lsp.rs9
1 files changed, 7 insertions, 2 deletions
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<syntax::Loader>,
+ config_loader: Arc<ArcSwap<syntax::Loader>>,
}
impl SignatureHelp {
pub const ID: &'static str = "signature-help";
- pub fn new(signature: String, language: String, config_loader: Arc<syntax::Loader>) -> Self {
+ pub fn new(
+ signature: String,
+ language: String,
+ config_loader: Arc<ArcSwap<syntax::Loader>>,
+ ) -> Self {
Self {
signature,
signature_doc: None,