dev: cache expression information correctly (#736)

* dev: cache expression information correctly

* rev
This commit is contained in:
Myriad-Dreamin 2024-10-27 20:20:59 +08:00 committed by GitHub
parent 2c38695b6f
commit 1d49e110e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 430 additions and 187 deletions

View file

@ -1,3 +1,5 @@
use reflexo_typst::EntryReader;
use crate::prelude::*;
/// Stores diagnostics for files.
@ -32,7 +34,11 @@ fn convert_diagnostic(
let source = ctx.world().source(id)?;
lsp_range = diagnostic_range(&source, span, ctx.position_encoding());
} else {
uri = path_to_url(&ctx.local.root)?;
let root = ctx
.world
.workspace_root()
.ok_or_else(|| anyhow::anyhow!("no workspace root"))?;
uri = path_to_url(&root)?;
lsp_range = LspRange::default();
};