fix: source switch on primary node

This commit is contained in:
Myriad-Dreamin 2024-03-08 17:06:08 +08:00
parent efe07c7b4a
commit f6d473f320
3 changed files with 61 additions and 8 deletions

View file

@ -1,6 +1,7 @@
use std::{borrow::Cow, ops::Range};
use comemo::Prehashed;
use log::debug;
use tower_lsp::lsp_types::{InlayHintKind, InlayHintLabel};
use typst::{
foundations::{Args, Closure},
@ -32,7 +33,15 @@ impl InlayHintRequest {
);
let hints = inlay_hints(world, &source, range, position_encoding).ok()?;
trace!("got inlay hints {hints:?}");
debug!(
"got inlay hints on {source:?} => {hints:?}",
source = source.id(),
hints = hints.len()
);
if hints.is_empty() {
let root = LinkedNode::new(source.root());
debug!("debug root {root:#?}");
}
Some(hints)
}