diff options
| author | Laurenz <laurmaedje@gmail.com> | 2024-12-02 13:37:33 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2024-12-04 10:12:07 +0100 |
| commit | f8f2ba6a5f8c8ca7dbb85cf17b73332a0c301c60 (patch) | |
| tree | b3bc754509fb3ab4c74493848fe96f116b7907ed /crates/typst-ide/src/complete.rs | |
| parent | 76c24ee6e35715cd14bb892d7b6b8d775c680bf7 (diff) | |
Rename `Document` to `PagedDocument`
Diffstat (limited to 'crates/typst-ide/src/complete.rs')
| -rw-r--r-- | crates/typst-ide/src/complete.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/crates/typst-ide/src/complete.rs b/crates/typst-ide/src/complete.rs index 510db54c..5c2b500a 100644 --- a/crates/typst-ide/src/complete.rs +++ b/crates/typst-ide/src/complete.rs @@ -9,8 +9,7 @@ use typst::foundations::{ fields_on, repr, AutoValue, CastInfo, Func, Label, NoneValue, ParamInfo, Repr, StyleChain, Styles, Type, Value, }; -use typst::layout::{Alignment, Dir}; -use typst::model::Document; +use typst::layout::{Alignment, Dir, PagedDocument}; use typst::syntax::ast::AstNode; use typst::syntax::{ ast, is_id_continue, is_id_start, is_ident, FileId, LinkedNode, Side, Source, @@ -38,7 +37,7 @@ use crate::{analyze_expr, analyze_import, analyze_labels, named_items, IdeWorld} /// when the document is available. pub fn autocomplete( world: &dyn IdeWorld, - document: Option<&Document>, + document: Option<&PagedDocument>, source: &Source, cursor: usize, explicit: bool, @@ -1063,7 +1062,7 @@ fn code_completions(ctx: &mut CompletionContext, hash: bool) { /// Context for autocompletion. struct CompletionContext<'a> { world: &'a (dyn IdeWorld + 'a), - document: Option<&'a Document>, + document: Option<&'a PagedDocument>, text: &'a str, before: &'a str, after: &'a str, @@ -1079,7 +1078,7 @@ impl<'a> CompletionContext<'a> { /// Create a new autocompletion context. fn new( world: &'a (dyn IdeWorld + 'a), - document: Option<&'a Document>, + document: Option<&'a PagedDocument>, source: &'a Source, leaf: &'a LinkedNode<'a>, cursor: usize, @@ -1507,7 +1506,7 @@ impl BracketMode { mod tests { use std::collections::BTreeSet; - use typst::model::Document; + use typst::layout::PagedDocument; use typst::syntax::{FileId, Source, VirtualPath}; use typst::World; @@ -1607,7 +1606,7 @@ mod tests { fn test_full( world: &TestWorld, source: &Source, - doc: Option<&Document>, + doc: Option<&PagedDocument>, cursor: isize, ) -> Response { autocomplete(world, doc, source, source.cursor(cursor), true) |
