mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-23 04:35:00 +00:00
dev: borrow the document state inside of compiler (#33)
This commit is contained in:
parent
c7825c3174
commit
9d344570b4
6 changed files with 34 additions and 27 deletions
|
@ -11,10 +11,10 @@ impl CompletionRequest {
|
|||
pub fn request(
|
||||
self,
|
||||
world: &TypstSystemWorld,
|
||||
doc: Option<Arc<TypstDocument>>,
|
||||
doc: Option<VersionedDocument>,
|
||||
position_encoding: PositionEncoding,
|
||||
) -> Option<CompletionResponse> {
|
||||
let doc = doc.as_deref();
|
||||
let doc = doc.as_ref().map(|doc| doc.document.as_ref());
|
||||
let source = get_suitable_source_in_workspace(world, &self.path).ok()?;
|
||||
let cursor = lsp_to_typst::position(self.position, position_encoding, &source)?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue