mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-22 12:34:39 +00:00
feat: compile tinymist-query for wasm32 target (#1947)
- #2025 - #2026 --------- Co-authored-by: Momijiichigo <ichigomomiji436@gmail.com>
This commit is contained in:
parent
b102b42d2c
commit
79f68dc94d
12 changed files with 191 additions and 88 deletions
|
|
@ -20,9 +20,7 @@ use tinymist_std::typst::TypstDocument;
|
|||
use tinymist_world::debug_loc::DataSource;
|
||||
use tinymist_world::vfs::{PathResolution, WorkspaceResolver};
|
||||
use tinymist_world::{EntryReader, DETACHED_ENTRY};
|
||||
use typst::diag::{
|
||||
eco_format, At, FileError, FileResult, SourceDiagnostic, SourceResult, StrResult,
|
||||
};
|
||||
use typst::diag::{At, FileError, FileResult, SourceDiagnostic, SourceResult, StrResult};
|
||||
use typst::foundations::{Bytes, IntoValue, Module, StyleChain, Styles};
|
||||
use typst::introspection::Introspector;
|
||||
use typst::layout::Position;
|
||||
|
|
@ -674,6 +672,7 @@ impl SharedContext {
|
|||
}
|
||||
|
||||
/// Get the local packages and their descriptions.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub fn local_packages(&self) -> EcoVec<PackageSpec> {
|
||||
crate::package::list_package_by_namespace(&self.world.registry, eco_format!("local"))
|
||||
.into_iter()
|
||||
|
|
@ -681,6 +680,12 @@ impl SharedContext {
|
|||
.collect()
|
||||
}
|
||||
|
||||
/// Get the local packages and their descriptions.
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
pub fn local_packages(&self) -> EcoVec<PackageSpec> {
|
||||
eco_vec![]
|
||||
}
|
||||
|
||||
pub(crate) fn const_eval(rr: ast::Expr<'_>) -> Option<Value> {
|
||||
Some(match rr {
|
||||
ast::Expr::None(_) => Value::None,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue