typst-lsp icon indicating copy to clipboard operation
typst-lsp copied to clipboard

Gets stuck on the config.read() lock when invoking hover

Open lf- opened this issue 2 years ago • 0 comments

  • Component:
    • [ ] VSCode Extension
    • [ ] VSCodium Extension
    • [x] LSP (used with other editor)
  • Extension version: N/A but:
## versions

vim version: NVIM v0.9.0-dev-1092+gbc15b075d1
node version: v20.4.0
coc.nvim version: 0.0.82-master
coc.nvim directory: /home/jade/co/coc.nvim
term: alacritty
platform: linux
  • LSP version: 0.7.1 but also reproduces on main from when this was posted
  • OS version and name: Arch Linux, typst-lsp from NixOS
  • [x] I am on the latest stable version of the extension/LSP.
  • [x] I have searched the issues of this repo and believe that this is not a duplicate.

Issue

I was investigating why the hover documentation feature does not reply to the language client. It appears that it is attempting to take a tokio::sync::RwLock and getting stuck doing so. I have attempted to trace the heck out of the thing and figure out why but so far I have come up totally empty handed: As far as I can tell, the lock is not being held?

I did some printf debugging and observed that config.read pre prints but not config.read post here in src/server/mod.rs:

#[tracing::instrument(skip_all)]
async fn get_world_with_main_by_id(&self, main: SourceId) -> WorkspaceWorld {
    tracing::error!("config.read pre");
    let config = self.config.read().await;
    tracing::error!("config.read post");
    WorkspaceWorld::new(
        Arc::clone(&self.workspace).read_owned().await,
        main,
        config.root_path.clone(),
    )
}

I don't have more energy to try to figure this out and fix it myself so I am posting it.

I do wonder if this is the same bug as #194, since that one too is a request that is not responded to and possibly eventually just cancelled.

Logs

lf- avatar Jul 10 '23 16:07 lf-