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

Language server config is not updated for :lsp-restart after :config-reload #9398

Closed
kirawi opened this issue Jan 21, 2024 · 2 comments · Fixed by #9415
Closed

Language server config is not updated for :lsp-restart after :config-reload #9398

kirawi opened this issue Jan 21, 2024 · 2 comments · Fixed by #9415
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug E-easy Call for participation: Experience needed to fix: Easy / not much E-good-first-issue Call for participation: Issues suitable for new contributors

Comments

@kirawi
Copy link
Member

kirawi commented Jan 21, 2024

Summary

This behavior seems to stem from howsyn_loader is replaced rather than the interior value being replaced:

fn refresh_language_config(&mut self) -> Result<(), Error> {
let syntax_config = helix_core::config::user_syntax_loader()
.map_err(|err| anyhow::anyhow!("Failed to load language config: {}", err))?;
self.syn_loader = std::sync::Arc::new(syntax::Loader::new(syntax_config));
self.editor.syn_loader = self.syn_loader.clone();

combined with us not updating the value for Registry as well. I think we could use ArcSwap here like we do for the config.

Reproduction Steps

  1. Open the helix repo in Helix and open a document.
  2. Add a custom language config for rust-analyzer.
  3. :config-reload and :lsp-restart

Helix Version

9c56afe

@kirawi kirawi added C-bug Category: This is a bug E-easy Call for participation: Experience needed to fix: Easy / not much A-helix-term Area: Helix term improvements E-good-first-issue Call for participation: Issues suitable for new contributors labels Jan 21, 2024
@kirawi kirawi assigned kirawi and unassigned kirawi Jan 24, 2024
@rgunindi
Copy link

I had the problem that lsp reactivated many times after :lsp-restart command, so I was looking for issues.

@ferntheplant
Copy link

ferntheplant commented Mar 22, 2024

I'm still running into this issue with reloading the ltex-ls LSP server. If I update my languages.toml manually to add a new word like "asdfg" to the spellcheck dictionary. Then when I run :config-reload followed by :lsp-restart the LSP server still warns me about misspelling "asdfg". However if I quit helix and reopen the file then the spell check config is applied correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug E-easy Call for participation: Experience needed to fix: Easy / not much E-good-first-issue Call for participation: Issues suitable for new contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants