diff options
Diffstat (limited to 'crates/typst-ide/src')
| -rw-r--r-- | crates/typst-ide/src/complete.rs | 10 | ||||
| -rw-r--r-- | crates/typst-ide/src/tooltip.rs | 11 |
2 files changed, 10 insertions, 11 deletions
diff --git a/crates/typst-ide/src/complete.rs b/crates/typst-ide/src/complete.rs index fd83b8c9..71ae95db 100644 --- a/crates/typst-ide/src/complete.rs +++ b/crates/typst-ide/src/complete.rs @@ -5,9 +5,9 @@ use ecow::{eco_format, EcoString}; use if_chain::if_chain; use serde::{Deserialize, Serialize}; use typst::doc::Frame; -use typst::eval::repr::separated_list; use typst::eval::{ - format_str, AutoValue, CastInfo, Func, Library, NoneValue, Repr, Scope, Type, Value, + format_str, repr, AutoValue, CastInfo, Func, Library, NoneValue, Repr, Scope, Type, + Value, }; use typst::geom::Color; use typst::model::Label; @@ -17,8 +17,8 @@ use typst::syntax::{ use typst::World; use unscanny::Scanner; -use super::analyze::analyze_labels; -use super::{analyze_expr, analyze_import, plain_docs_sentence, summarize_font_family}; +use crate::analyze::analyze_labels; +use crate::{analyze_expr, analyze_import, plain_docs_sentence, summarize_font_family}; /// Autocomplete a cursor position in a source file. /// @@ -1089,7 +1089,7 @@ impl<'a> CompletionContext<'a> { kind: CompletionKind::Constant, label: name.into(), apply: Some(tags[0].into()), - detail: Some(separated_list(&tags, " or ").into()), + detail: Some(repr::separated_list(&tags, " or ").into()), }); } } diff --git a/crates/typst-ide/src/tooltip.rs b/crates/typst-ide/src/tooltip.rs index 09433cde..87b383d5 100644 --- a/crates/typst-ide/src/tooltip.rs +++ b/crates/typst-ide/src/tooltip.rs @@ -3,15 +3,14 @@ use std::fmt::Write; use ecow::{eco_format, EcoString}; use if_chain::if_chain; use typst::doc::Frame; -use typst::eval::repr::{pretty_comma_list, separated_list}; -use typst::eval::{CapturesVisitor, CastInfo, Repr, Tracer, Value}; +use typst::eval::{repr, CapturesVisitor, CastInfo, Repr, Tracer, Value}; use typst::geom::{round_2, Length, Numeric}; use typst::syntax::ast; use typst::syntax::{LinkedNode, Source, SyntaxKind}; use typst::World; -use super::analyze::analyze_labels; -use super::{analyze_expr, plain_docs_sentence, summarize_font_family}; +use crate::analyze::analyze_labels; +use crate::{analyze_expr, plain_docs_sentence, summarize_font_family}; /// Describe the item under the cursor. pub fn tooltip( @@ -97,7 +96,7 @@ fn expr_tooltip(world: &dyn World, leaf: &LinkedNode) -> Option<Tooltip> { pieces.push("...".into()); } - let tooltip = pretty_comma_list(&pieces, false); + let tooltip = repr::pretty_comma_list(&pieces, false); (!tooltip.is_empty()).then(|| Tooltip::Code(tooltip.into())) } @@ -128,7 +127,7 @@ fn closure_tooltip(leaf: &LinkedNode) -> Option<Tooltip> { names.sort(); - let tooltip = separated_list(&names, "and"); + let tooltip = repr::separated_list(&names, "and"); Some(Tooltip::Text(eco_format!("This closure captures {tooltip}."))) } |
