build: bump typst.ts to v0.5.0-rc7 (#554)

* dev: sync typ_server code

* build: bump typst.ts to v0.5.0-rc7
This commit is contained in:
Myriad-Dreamin 2024-08-25 17:43:54 +08:00 committed by GitHub
parent b67cec2918
commit fbd22d2601
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 270 additions and 370 deletions

250
Cargo.lock generated
View file

@ -134,12 +134,6 @@ version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
[[package]]
name = "append-only-vec"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a6cf1d5134ae83736dc3f4dc3e6107870b29cc2a9f8f7948630c133c6fdb6ba1"
[[package]]
name = "approx"
version = "0.5.1"
@ -233,16 +227,6 @@ version = "0.22.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]]
name = "base64-serde"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba368df5de76a5bea49aaf0cf1b39ccfbbef176924d1ba5db3e4135216cbe3c7"
dependencies = [
"base64 0.21.7",
"serde",
]
[[package]]
name = "biblatex"
version = "0.9.3"
@ -950,15 +934,6 @@ version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
[[package]]
name = "elsa"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d98e71ae4df57d214182a2e5cb90230c0192c6ddfcaa05c36453d46a54713e10"
dependencies = [
"stable_deref_trait",
]
[[package]]
name = "embedded-io"
version = "0.4.0"
@ -1175,12 +1150,6 @@ dependencies = [
"libc",
]
[[package]]
name = "fst"
version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ab85b9b05e3978cc9a9cf8fea7f01b494e1a09ed3037e16ba39edc7a29eb61a"
[[package]]
name = "funty"
version = "2.0.0"
@ -2709,9 +2678,9 @@ dependencies = [
[[package]]
name = "reflexo"
version = "0.5.0-rc5"
version = "0.5.0-rc7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ae5af71dba0ab175d7e790ef57f64310c645dc300e88794bd22457d531fbc23"
checksum = "2803fc3e89d63fe9b5201726f5c4490a3d4d415facdad9581082a5e7e647db52"
dependencies = [
"base64 0.22.1",
"bitvec",
@ -2720,11 +2689,10 @@ dependencies = [
"ecow 0.2.2",
"fxhash",
"instant",
"once_cell",
"parking_lot",
"path-clean",
"rkyv",
"rustc-hash 1.1.0",
"rustc-hash 2.0.0",
"serde",
"serde_json",
"serde_repr",
@ -2734,56 +2702,115 @@ dependencies = [
]
[[package]]
name = "reflexo-vfs"
version = "0.5.0-rc5"
name = "reflexo-typst"
version = "0.5.0-rc7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "acc80c7f1483dfc8ef7f413a2158181d7c8ecd18d22241c533ec2cd493d1bc0f"
checksum = "6ac7cb43d90c023f5cbeedfb24b2022c550b1e29952fc0014bac947bf69d6647"
dependencies = [
"codespan-reporting",
"comemo 0.4.0",
"ecow 0.2.2",
"futures",
"fxhash",
"indexmap 2.2.6",
"log",
"nohash-hasher",
"notify",
"parking_lot",
"pathdiff",
"rayon",
"reflexo",
"reflexo-typst2vec",
"reflexo-vfs",
"reflexo-world",
"serde",
"serde_json",
"tar",
"tokio",
"typst",
]
[[package]]
name = "reflexo-typst2vec"
version = "0.5.0-rc7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "104405c4eb839fecea0c88443961d1f10c7f533c13083d1b8355d83f01b1bbd1"
dependencies = [
"bitvec",
"comemo 0.4.0",
"crossbeam-queue",
"dashmap",
"flate2",
"log",
"parking_lot",
"rayon",
"reflexo",
"rustc-hash 2.0.0",
"serde",
"serde_json",
"svgtypes",
"tiny-skia",
"tiny-skia-path",
"ttf-parser",
"typst",
"xmlparser",
]
[[package]]
name = "reflexo-vec2svg"
version = "0.5.0-rc7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e79d065724764ff3c5cb9a6203eede0472290b8b387b2df55f6740618661d59"
dependencies = [
"base64 0.22.1",
"comemo 0.4.0",
"log",
"reflexo",
"reflexo-typst2vec",
"typst",
]
[[package]]
name = "reflexo-vfs"
version = "0.5.0-rc7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ea592d6cfc00420d0719170a6c0dd71580b1cea6682a5f543b3b683991ec3f6"
dependencies = [
"append-only-vec",
"indexmap 2.2.6",
"log",
"nohash-hasher",
"once_cell",
"parking_lot",
"reflexo",
"rpds",
"rustc-hash 1.1.0",
"typst",
]
[[package]]
name = "reflexo-world"
version = "0.5.0-rc5"
version = "0.5.0-rc7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68eb0f8f91035cbe75c17f42542be883aed8738e39b79a28c9a532b141127c5f"
checksum = "1ec0d950f4a5087dcbf875b686dd4b67d82c436c10895f98bb5cc027b1aea9e2"
dependencies = [
"append-only-vec",
"chrono",
"codespan-reporting",
"comemo 0.4.0",
"dashmap",
"dirs",
"ecow 0.2.2",
"flate2",
"fontdb",
"hex",
"indexmap 2.2.6",
"log",
"nohash-hasher",
"notify",
"once_cell",
"parking_lot",
"reflexo",
"reflexo-vfs",
"reqwest",
"rustc-hash 1.1.0",
"serde",
"serde_json",
"serde_with",
"sha2",
"strum 0.25.0",
"tar",
"typst",
"typst-ts-core",
"walkdir",
]
[[package]]
@ -3775,11 +3802,13 @@ dependencies = [
"pin-project-lite",
"rayon",
"reflexo",
"reflexo-typst",
"reflexo-vec2svg",
"serde",
"serde_json",
"serde_yaml",
"sync-lsp",
"tinymist-assets 0.11.19 (registry+https://github.com/rust-lang/crates.io-index)",
"tinymist-assets",
"tinymist-query",
"tinymist-render",
"tinymist-world",
@ -3797,9 +3826,6 @@ dependencies = [
"typst-render",
"typst-svg",
"typst-timing",
"typst-ts-compiler",
"typst-ts-core",
"typst-ts-svg-exporter",
"typstfmt_lib",
"typstyle",
"unicode-script",
@ -3811,12 +3837,6 @@ dependencies = [
name = "tinymist-assets"
version = "0.11.19"
[[package]]
name = "tinymist-assets"
version = "0.11.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85be1e87f7b44cafd3fa5195af352c8ea5f8e747aefff207b76986174f1085ea"
[[package]]
name = "tinymist-query"
version = "0.11.19"
@ -3841,6 +3861,7 @@ dependencies = [
"pathdiff",
"percent-encoding",
"reflexo",
"reflexo-typst",
"regex",
"rust_iso3166",
"rust_iso639",
@ -3856,8 +3877,6 @@ dependencies = [
"ttf-parser",
"typst",
"typst-assets",
"typst-ts-compiler",
"typst-ts-core",
"unscanny",
"walkdir",
"yaml-rust2",
@ -3869,9 +3888,9 @@ version = "0.11.19"
dependencies = [
"base64 0.22.1",
"log",
"reflexo-vec2svg",
"serde",
"tinymist-query",
"typst-ts-svg-exporter",
]
[[package]]
@ -3883,12 +3902,11 @@ dependencies = [
"clap",
"comemo 0.4.0",
"log",
"reflexo-typst",
"serde",
"serde_json",
"tinymist-assets 0.11.19 (registry+https://github.com/rust-lang/crates.io-index)",
"tinymist-assets",
"typst-assets",
"typst-ts-compiler",
"typst-ts-core",
]
[[package]]
@ -4309,16 +4327,15 @@ dependencies = [
"indexmap 2.2.6",
"log",
"once_cell",
"reflexo-typst",
"reflexo-vec2svg",
"serde",
"serde_json",
"tinymist-assets 0.11.19 (registry+https://github.com/rust-lang/crates.io-index)",
"tinymist-assets",
"tokio",
"tokio-tungstenite",
"typst",
"typst-assets",
"typst-ts-compiler",
"typst-ts-core",
"typst-ts-svg-exporter",
]
[[package]]
@ -4401,95 +4418,6 @@ dependencies = [
"typst-syntax 0.11.1",
]
[[package]]
name = "typst-ts-compiler"
version = "0.5.0-rc5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd3f3a4d7b1c28314b2d664e321e8d5252fc5ad09091930b951557e386e20fcd"
dependencies = [
"base64 0.22.1",
"codespan-reporting",
"comemo 0.4.0",
"flate2",
"fst",
"indexmap 2.2.6",
"log",
"nohash-hasher",
"notify",
"once_cell",
"parking_lot",
"pathdiff",
"rayon",
"reflexo",
"reflexo-vfs",
"reflexo-world",
"rustc-hash 1.1.0",
"serde",
"serde_json",
"tar",
"tokio",
"typst",
"typst-ts-core",
"typst-ts-svg-exporter",
]
[[package]]
name = "typst-ts-core"
version = "0.5.0-rc5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81026f9d356bb4d15d612a2e76274fc64379a98c356c2115c45add6565153262"
dependencies = [
"base64 0.22.1",
"base64-serde",
"bitvec",
"byteorder",
"comemo 0.4.0",
"crossbeam-queue",
"dashmap",
"ecow 0.2.2",
"elsa",
"flate2",
"fxhash",
"hex",
"log",
"once_cell",
"parking_lot",
"path-clean",
"rayon",
"reflexo",
"rustc-hash 1.1.0",
"serde",
"serde_json",
"serde_repr",
"serde_with",
"sha2",
"siphasher 1.0.1",
"svgtypes",
"tiny-skia",
"tiny-skia-path",
"ttf-parser",
"typst",
"xmlparser",
]
[[package]]
name = "typst-ts-svg-exporter"
version = "0.5.0-rc5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6425d6586ba1bdf3d1da75aea61717dca9774f0a3ab969e799b067010522f318"
dependencies = [
"base64 0.22.1",
"comemo 0.4.0",
"log",
"once_cell",
"rayon",
"reflexo",
"siphasher 1.0.1",
"tiny-skia",
"typst",
"typst-ts-core",
]
[[package]]
name = "typstfmt_lib"
version = "0.2.7"

View file

@ -89,10 +89,14 @@ env_logger = "0.11.3"
log = "0.4"
# Typst
reflexo = { version = "0.5.0-rc5", default-features = false, features = [
reflexo = { version = "0.5.0-rc7", default-features = false, features = [
"flat-vector",
] }
reflexo-world = { version = "0.5.0-rc5", features = ["system"] }
reflexo-world = { version = "0.5.0-rc7", features = ["system"] }
reflexo-typst = { version = "0.5.0-rc7", features = [
"system",
], default-features = false }
reflexo-vec2svg = { version = "0.5.0-rc7" }
typst = "0.11.1"
typst-timing = "0.11.1"
typst-pdf = "0.11.1"
@ -100,9 +104,6 @@ typst-svg = "0.11.1"
typst-render = "0.11.1"
typst-assets = "0.11.1"
typst-syntax = "0.11.1"
typst-ts-core = { version = "0.5.0-rc5", default-features = false }
typst-ts-compiler = { version = "0.5.0-rc5" }
typst-ts-svg-exporter = { version = "0.5.0-rc5" }
typstfmt_lib = { git = "https://github.com/astrale-sharp/typstfmt", tag = "0.2.7" }
typstyle = { version = "0.11.32", default-features = false }
typlite = { path = "./crates/typlite" }
@ -167,7 +168,7 @@ undocumented_unsafe_blocks = "warn"
[patch.crates-io]
# tinymist-assets = { path = "./crates/tinymist-assets/" }
tinymist-assets = { path = "./crates/tinymist-assets/" }
typst = { git = "https://github.com/Myriad-Dreamin/typst.git", tag = "tinymist-v0.11.1-2" }
typst-timing = { git = "https://github.com/Myriad-Dreamin/typst.git", tag = "tinymist-v0.11.1-2" }

View file

@ -56,12 +56,7 @@ insta.workspace = true
serde.workspace = true
serde_json.workspace = true
typst-assets = { workspace = true, features = ["fonts"] }
typst-ts-core = { workspace = true, default-features = false, features = [
"flat-vector",
"vector-bbox",
"no-content-hint",
] }
typst-ts-compiler.workspace = true
reflexo-typst.workspace = true
sha2 = { version = "0.10" }
hex = { version = "0.4" }

View file

@ -196,8 +196,7 @@ impl BibWorker {
mod tests {
use std::path::Path;
use typst::syntax::VirtualPath;
use typst_ts_core::TypstFileId;
use typst::syntax::{FileId, VirtualPath};
#[test]
fn yaml_bib_test() {
@ -211,7 +210,7 @@ Euclid2:
"#;
let yaml = super::YamlBib::from_content(
content,
TypstFileId::new_fake(VirtualPath::new(Path::new("test.yml"))),
FileId::new_fake(VirtualPath::new(Path::new("test.yml"))),
);
assert_eq!(yaml.entries.len(), 2);
assert_eq!(yaml.entries[0].0, "Euclid");
@ -228,7 +227,7 @@ Euclid3
"#;
super::YamlBib::from_content(
content,
TypstFileId::new_fake(VirtualPath::new(Path::new("test.yml"))),
FileId::new_fake(VirtualPath::new(Path::new("test.yml"))),
);
}
}

View file

@ -175,7 +175,7 @@ impl<'a, 'w> ReferencesWorker<'a, 'w> {
#[cfg(test)]
mod tests {
use typst_ts_core::path::unix_slash;
use reflexo::path::unix_slash;
use super::*;
use crate::syntax::find_module_level_docs;

View file

@ -8,24 +8,20 @@ use std::{
};
use once_cell::sync::Lazy;
pub use serde::Serialize;
use serde_json::{ser::PrettyFormatter, Serializer, Value};
use typst::syntax::{
ast::{self, AstNode},
FileId as TypstFileId, LinkedNode, Source, SyntaxKind, VirtualPath,
};
use typst::{diag::PackageError, foundations::Bytes};
use typst_ts_compiler::{
use reflexo_typst::config::CompileOpts;
use reflexo_typst::package::{PackageRegistry, PackageSpec};
use reflexo_typst::world::{EntryOpts, EntryState};
use reflexo_typst::{
CompileDriver, EntryManager, EntryReader, ShadowApi, TypstSystemUniverse, WorldDeps,
};
use typst_ts_core::{
config::compiler::{EntryOpts, EntryState},
package::Registry,
};
use typst_ts_core::{config::CompileOpts, package::PackageSpec};
use serde_json::{ser::PrettyFormatter, Serializer, Value};
use typst::syntax::ast::{self, AstNode};
use typst::syntax::{FileId as TypstFileId, LinkedNode, Source, SyntaxKind, VirtualPath};
use typst::{diag::PackageError, foundations::Bytes};
pub use insta::assert_snapshot;
pub use typst_ts_compiler::TypstSystemWorld;
pub use reflexo_typst::TypstSystemWorld;
pub use serde::Serialize;
use crate::{
analysis::{Analysis, AnalysisResources},

View file

@ -14,7 +14,7 @@ repository.workspace = true
serde.workspace = true
tinymist-query.workspace = true
typst-ts-svg-exporter.workspace = true
reflexo-vec2svg.workspace = true
base64.workspace = true
log.workspace = true

View file

@ -8,8 +8,8 @@
use core::fmt;
use base64::Engine;
use reflexo_vec2svg::{ExportFeature, SvgExporter, SvgText};
use tinymist_query::{AnalysisContext, FramePosition, VersionedDocument};
use typst_ts_svg_exporter::{ExportFeature, SvgExporter, SvgText};
struct PeriscopeExportFeature {}

View file

@ -20,11 +20,7 @@ serde_json.workspace = true
anyhow.workspace = true
log.workspace = true
typst-ts-core = { workspace = true, default-features = false, features = [
"flat-vector",
"vector-bbox",
] }
typst-ts-compiler.workspace = true
reflexo-typst.workspace = true
tinymist-assets = { workspace = true }
typst-assets = { workspace = true, features = ["fonts"] }

View file

@ -1,29 +1,25 @@
//! World implementation of typst for tinymist.
use anyhow::Context;
pub use typst_ts_compiler::world as base;
pub use typst_ts_compiler::{entry::*, EntryOpts, EntryState};
pub use typst_ts_compiler::{font, vfs};
pub use typst_ts_core::config::CompileFontOpts;
pub use typst_ts_core::error::prelude;
pub use typst_ts_core::font::FontResolverImpl;
use typst_ts_core::foundations::{Str, Value};
pub use reflexo_typst::config::CompileFontOpts;
pub use reflexo_typst::error::prelude;
pub use reflexo_typst::font::FontResolverImpl;
pub use reflexo_typst::world as base;
pub use reflexo_typst::{entry::*, font, vfs, EntryOpts, EntryState};
use std::path::Path;
use std::{borrow::Cow, path::PathBuf, sync::Arc};
use anyhow::Context;
use chrono::{DateTime, Utc};
use clap::{builder::ValueParser, ArgAction, Parser};
use comemo::Prehashed;
use reflexo_typst::error::prelude::*;
use reflexo_typst::font::system::SystemFontSearcher;
use reflexo_typst::foundations::{Str, Value};
use reflexo_typst::package::http::HttpRegistry;
use reflexo_typst::vfs::{system::SystemAccessModel, Vfs};
use reflexo_typst::{SystemCompilerFeat, TypstDict, TypstSystemUniverse, TypstSystemWorld};
use serde::{Deserialize, Serialize};
use typst_ts_core::{config::CompileFontOpts as FontOptsInner, error::prelude::*, TypstDict};
use typst_ts_compiler::{
font::system::SystemFontSearcher,
package::http::HttpRegistry,
vfs::{system::SystemAccessModel, Vfs},
SystemCompilerFeat, TypstSystemUniverse, TypstSystemWorld,
};
const ENV_PATH_SEP: char = if cfg!(windows) { ';' } else { ':' };
@ -171,7 +167,7 @@ impl LspUniverseBuilder {
/// Resolve fonts from given options.
pub fn resolve_fonts(args: CompileFontArgs) -> ZResult<FontResolverImpl> {
let mut searcher = SystemFontSearcher::new();
searcher.resolve_opts(FontOptsInner {
searcher.resolve_opts(CompileFontOpts {
font_profile_cache_path: Default::default(),
font_paths: args.font_paths,
no_system_fonts: args.ignore_system_fonts,

View file

@ -53,13 +53,9 @@ typstyle.workspace = true
typstfmt_lib.workspace = true
reflexo.workspace = true
typst-ts-core = { workspace = true, default-features = false, features = [
"flat-vector",
"vector-bbox",
] }
typst-ts-svg-exporter.workspace = true
reflexo-typst.workspace = true
reflexo-vec2svg.workspace = true
codespan-reporting.workspace = true
typst-ts-compiler.workspace = true
toml.workspace = true
walkdir.workspace = true
typst-preview = { workspace = true, optional = true }
@ -95,7 +91,7 @@ embed-fonts = ["typst-assets/fonts"]
# Disable the default content hint.
# This requires modifying typst.
no-content-hint = ["typst-ts-core/no-content-hint"]
no-content-hint = ["reflexo-typst/no-content-hint"]
preview = [
"typst-preview",

View file

@ -9,23 +9,20 @@ pub mod typ_server;
use std::sync::Arc;
use reflexo::ImmutPath;
use reflexo_typst::vfs::notify::{FileChangeSet, MemoryEvent};
use reflexo_typst::world::EntryState;
use tinymist_query::analysis::Analysis;
use tinymist_query::ExportKind;
use tinymist_render::PeriscopeRenderer;
use tokio::sync::mpsc;
use typ_server::CompileServerOpts;
use typst_ts_compiler::vfs::notify::{FileChangeSet, MemoryEvent};
use typst_ts_core::config::compiler::EntryState;
use self::{
typ_client::{CompileClientActor, CompileHandler},
typ_server::CompileServerActor,
};
use crate::{
task::{ExportConfig, ExportTask, ExportUserConfig},
world::{ImmutDict, LspUniverseBuilder},
LanguageState,
};
use typ_client::{CompileClientActor, CompileHandler};
use typ_server::{CompileServerActor, CompileServerOpts};
impl LanguageState {
/// Restart the primary server.
@ -120,7 +117,7 @@ impl LanguageState {
let font_resolver = self.compile_config().determine_fonts();
let entry_ = entry.clone();
let handle_ = handle.clone();
let compile_handle = handle.clone();
let cache = self.cache.clone();
self.client.handle.spawn_blocking(move || {
@ -135,11 +132,12 @@ impl LanguageState {
intr_tx,
intr_rx,
CompileServerOpts {
compile_handle,
cache,
..Default::default()
},
)
.with_watch(Some(handle_));
.with_watch(true);
tokio::spawn(server.run());
});

View file

@ -31,6 +31,10 @@ use std::{
use anyhow::{anyhow, bail};
use log::{error, info, trace};
use reflexo_typst::{
debug_loc::DataSource, error::prelude::*, typst::prelude::EcoVec, vfs::notify::MemoryEvent,
world::EntryState, CompileReport, EntryReader, Error, ImmutPath, TaskInputs, TypstFont,
};
use sync_lsp::{just_future, QueryFuture};
use tinymist_query::{
analysis::{Analysis, AnalysisContext, AnalysisResources},
@ -45,11 +49,6 @@ use typst::{
syntax::package::PackageSpec,
World as TypstWorld,
};
use typst_ts_compiler::{vfs::notify::MemoryEvent, CompileReport, EntryReader, TaskInputs};
use typst_ts_core::{
config::compiler::EntryState, debug_loc::DataSource, error::prelude::*, typst::prelude::EcoVec,
Error, ImmutPath, TypstFont,
};
use super::{
editor::{DocVersion, EditorRequest, TinymistCompileStatusEnum},
@ -212,12 +211,12 @@ impl CompileHandler {
}
fn resolve(&self, spec: &PackageSpec) -> Result<Arc<Path>, PackageError> {
use typst_ts_compiler::package::Registry;
use reflexo_typst::world::package::PackageRegistry;
self.0.registry.resolve(spec)
}
fn iter_dependencies(&self, f: &mut dyn FnMut(ImmutPath)) {
use typst_ts_compiler::WorldDeps;
use reflexo_typst::WorldDeps;
self.0.iter_dependencies(f)
}

View file

@ -9,24 +9,22 @@ use std::{
sync::{Arc, OnceLock},
};
use once_cell::sync::OnceCell;
use tokio::sync::{mpsc, oneshot};
use typst::{diag::SourceResult, util::Deferred};
use typst_ts_compiler::{
use reflexo_typst::{
features::{FeatureSet, WITH_COMPILING_STATUS_FEATURE},
vfs::notify::{FilesystemEvent, MemoryEvent, NotifyMessage, UpstreamUpdateEvent},
watch_deps,
world::{CompilerFeat, CompilerUniverse, CompilerWorld},
CompileEnv, CompileReport, Compiler, ConsoleDiagReporter, EntryReader, Revising, TaskInputs,
WorldDeps,
CompileEnv, CompileReport, Compiler, ConsoleDiagReporter, EntryReader, GenericExporter,
Revising, TaskInputs, TypstDocument, WorldDeps,
};
use typst_ts_core::{exporter_builtins::GroupExporter, Exporter, GenericExporter, TypstDocument};
use typst::{diag::SourceResult, util::Deferred};
use crate::task::CacheTask;
type CompileRawResult = Deferred<(SourceResult<Arc<TypstDocument>>, CompileEnv)>;
type DocState = once_cell::sync::OnceCell<CompileRawResult>;
type DocState = std::sync::OnceLock<CompileRawResult>;
/// A signal that possibly triggers an export.
///
@ -86,7 +84,7 @@ impl<F: CompilerFeat + 'static> CompileSnapshot<F> {
};
self.world = Arc::new(self.world.task(inputs));
self.doc_state = Arc::new(OnceCell::new());
self.doc_state = Arc::new(OnceLock::new());
self
}
@ -266,7 +264,7 @@ struct TaggedMemoryEvent {
}
pub struct CompileServerOpts<F: CompilerFeat> {
pub exporter: GroupExporter<CompileSnapshot<F>>,
pub compile_handle: Arc<dyn CompilationHandle<F>>,
pub feature_set: FeatureSet,
pub cache: CacheTask,
}
@ -274,9 +272,9 @@ pub struct CompileServerOpts<F: CompilerFeat> {
impl<F: CompilerFeat + Send + Sync + 'static> Default for CompileServerOpts<F> {
fn default() -> Self {
Self {
exporter: GroupExporter::new(vec![]),
feature_set: FeatureSet::default(),
cache: CacheTask::new(Default::default()),
compile_handle: Arc::new(std::marker::PhantomData),
feature_set: Default::default(),
cache: Default::default(),
}
}
}
@ -285,10 +283,8 @@ impl<F: CompilerFeat + Send + Sync + 'static> Default for CompileServerOpts<F> {
pub struct CompileServerActor<F: CompilerFeat> {
/// The underlying universe.
pub verse: CompilerUniverse<F>,
/// The exporter for the compiled document.
pub exporter: GroupExporter<CompileSnapshot<F>>,
/// The compilation handle.
pub watch_handle: Arc<dyn CompilationHandle<F>>,
pub compile_handle: Arc<dyn CompilationHandle<F>>,
/// Whether to enable file system watching.
pub enable_watch: bool,
@ -329,7 +325,7 @@ impl<F: CompilerFeat + Send + Sync + 'static> CompileServerActor<F> {
intr_tx: mpsc::UnboundedSender<Interrupt<F>>,
intr_rx: mpsc::UnboundedReceiver<Interrupt<F>>,
CompileServerOpts {
exporter,
compile_handle,
feature_set,
cache: cache_evict,
}: CompileServerOpts<F>,
@ -337,11 +333,10 @@ impl<F: CompilerFeat + Send + Sync + 'static> CompileServerActor<F> {
let entry = verse.entry_state();
Self {
exporter,
verse,
logical_tick: 1,
watch_handle: Arc::new(std::marker::PhantomData),
compile_handle,
enable_watch: false,
dirty_shadow_logical_tick: 0,
@ -374,12 +369,8 @@ impl<F: CompilerFeat + Send + Sync + 'static> CompileServerActor<F> {
Self::new_with(verse, intr_tx, intr_rx, CompileServerOpts::default())
}
pub fn with_watch(mut self, watch: Option<Arc<dyn CompilationHandle<F>>>) -> Self {
self.enable_watch = watch.is_some();
match watch {
Some(watch) => self.watch_handle = watch,
None => self.watch_handle = Arc::new(std::marker::PhantomData),
}
pub fn with_watch(mut self, watch: bool) -> Self {
self.enable_watch = watch;
self
}
@ -400,7 +391,7 @@ impl<F: CompilerFeat + Send + Sync + 'static> CompileServerActor<F> {
log::debug!("CompileServerActor: initialized");
// Trigger the first compilation (if active)
self.watch_compile(reason_by_entry_change(), &mut curr_reads);
self.run_compile(reason_by_entry_change(), &mut curr_reads, false);
// Spawn file system watcher.
let fs_tx = self.intr_tx.clone();
@ -442,7 +433,7 @@ impl<F: CompilerFeat + Send + Sync + 'static> CompileServerActor<F> {
// Either we have a reason to compile or we have events that want to have any
// compilation.
if comp_reason.any() || !curr_reads.is_empty() {
self.watch_compile(comp_reason, &mut curr_reads);
self.run_compile(comp_reason, &mut curr_reads, false);
}
}
@ -469,34 +460,29 @@ impl<F: CompilerFeat + Send + Sync + 'static> CompileServerActor<F> {
by_mem_events: reason.by_memory_events,
by_fs_events: reason.by_fs_events,
},
doc_state: Arc::new(OnceCell::new()),
doc_state: Arc::new(OnceLock::new()),
success_doc: self.latest_success_doc.clone(),
}
}
/// Compile the document once.
pub async fn compile_once(&mut self) -> CompiledArtifact<F> {
let e = Arc::new(self.snapshot(true, reason_by_fs()));
let err = self.exporter.export(e.world.deref(), e.clone());
if let Err(err) = err {
// todo: ExportError
log::error!("CompileServerActor: export error: {err:?}");
}
e.compile()
self.run_compile(reason_by_entry_change(), &mut vec![], true)
.unwrap()
}
/// Watch and compile the document once.
fn watch_compile(
/// Compile the document once.
fn run_compile(
&mut self,
reason: CompileReasons,
curr_reads: &mut Vec<oneshot::Sender<SucceededArtifact<F>>>,
) {
is_once: bool,
) -> Option<CompiledArtifact<F>> {
self.suspended_reason.see(reason);
let reason = std::mem::take(&mut self.suspended_reason);
let start = reflexo::time::now();
let compiling = self.snapshot(false, reason);
let compiling = self.snapshot(is_once, reason);
self.watch_snap = OnceLock::new();
self.watch_snap.get_or_init(|| compiling.clone());
@ -506,17 +492,17 @@ impl<F: CompilerFeat + Send + Sync + 'static> CompileServerActor<F> {
for reader in curr_reads.drain(..) {
let _ = reader.send(SucceededArtifact::Suspend(compiling.clone()));
}
return;
return None;
}
if self.compiling {
self.suspended_reason.see(reason);
return;
return None;
}
self.compiling = true;
let h = self.watch_handle.clone();
let h = self.compile_handle.clone();
let curr_reads = std::mem::take(curr_reads);
// todo unwrap main id
@ -559,10 +545,16 @@ impl<F: CompilerFeat + Send + Sync + 'static> CompileServerActor<F> {
compiled
};
let intr_tx = self.intr_tx.clone();
tokio::task::spawn_blocking(move || {
log_send_error("compiled", intr_tx.send(Interrupt::Compiled(compile())));
});
if is_once {
Some(compile())
} else {
let intr_tx = self.intr_tx.clone();
tokio::task::spawn_blocking(move || {
log_send_error("compiled", intr_tx.send(Interrupt::Compiled(compile())));
});
None
}
}
fn process_compile(&mut self, artifact: CompiledArtifact<F>, send: impl Fn(CompilerResponse)) {
@ -647,7 +639,7 @@ impl<F: CompilerFeat + Send + Sync + 'static> CompileServerActor<F> {
self.suspended = entry.is_inactive();
if self.suspended {
log::info!("CompileServerActor: removing diag");
self.watch_handle
self.compile_handle
.status(self.verse.revision.get_mut().get(), CompileReport::Suspend);
}

View file

@ -5,6 +5,7 @@ use std::path::PathBuf;
use lsp_server::RequestId;
use lsp_types::*;
use reflexo_typst::error::prelude::*;
use serde::{Deserialize, Serialize};
use serde_json::Value as JsonValue;
use task::TraceParams;
@ -12,7 +13,6 @@ use tinymist_assets::TYPST_PREVIEW_HTML;
use tinymist_query::{ExportKind, PageSelection};
use typst::diag::StrResult;
use typst::syntax::package::{PackageSpec, VersionlessPackageSpec};
use typst_ts_core::error::prelude::*;
use super::server::*;
use super::*;

View file

@ -8,6 +8,9 @@ use itertools::Itertools;
use lsp_types::*;
use once_cell::sync::{Lazy, OnceCell};
use reflexo::path::PathClean;
use reflexo_typst::font::FontResolverImpl;
use reflexo_typst::world::EntryState;
use reflexo_typst::{ImmutPath, TypstDict};
use serde::{Deserialize, Serialize};
use serde_json::{json, Map, Value as JsonValue};
use task::FormatUserConfig;
@ -16,9 +19,6 @@ use tinymist_render::PeriscopeArgs;
use typst::foundations::IntoValue;
use typst::syntax::{FileId, VirtualPath};
use typst::util::Deferred;
use typst_ts_core::config::compiler::EntryState;
use typst_ts_core::font::FontResolverImpl;
use typst_ts_core::{ImmutPath, TypstDict};
// todo: svelte-language-server responds to a Goto Definition request with
// LocationLink[] even if the client does not report the

View file

@ -12,13 +12,11 @@ use comemo::Prehashed;
use futures::future::MaybeDone;
use lsp_server::RequestId;
use once_cell::sync::Lazy;
use reflexo_typst::{typst::prelude::EcoVec, CompileEnv, Compiler, TaskInputs, TypstDict};
use serde_json::Value as JsonValue;
use sync_lsp::{transport::with_stdio_transport, LspBuilder, LspClientRoot};
use tinymist::{CompileConfig, Config, LanguageState, LspWorld, RegularInit, SuperInit};
use typst::World;
use typst::{eval::Tracer, foundations::IntoValue, syntax::Span};
use typst_ts_compiler::{CompileEnv, Compiler, TaskInputs};
use typst_ts_core::{typst::prelude::EcoVec, TypstDict};
use typst::{eval::Tracer, foundations::IntoValue, syntax::Span, World};
use crate::args::*;

View file

@ -5,14 +5,14 @@ mod prelude {
pub use std::collections::HashMap;
pub use once_cell::sync::Lazy;
pub use reflexo_typst::error::prelude::*;
pub use reflexo_typst::Compiler;
pub use reflexo_vec2svg::ir::{GlyphItem, GlyphRef};
pub use reflexo_vec2svg::{DefaultExportFeature, SvgTask, SvgText};
pub use serde::{Deserialize, Serialize};
pub use serde_json::Value as JsonValue;
pub use typst::foundations::{Scope, Value};
pub use typst::symbols::Symbol;
pub use typst_ts_compiler::Compiler;
pub use typst_ts_core::error::prelude::*;
pub use typst_ts_svg_exporter::ir::{GlyphItem, GlyphRef};
pub use typst_ts_svg_exporter::{DefaultExportFeature, SvgTask, SvgText};
pub use crate::LanguageState;

View file

@ -1,8 +1,10 @@
use std::{collections::BTreeMap, path::Path, sync::Arc};
// use reflexo_typst::font::GlyphId;
use reflexo_typst::{
vector::font::GlyphId, world::EntryState, ShadowApi, TaskInputs, TypstDocument, TypstFont,
};
use sync_lsp::LspResult;
use typst_ts_compiler::{ShadowApi, TaskInputs};
use typst_ts_core::{config::compiler::EntryState, font::GlyphId, TypstDocument, TypstFont};
use crate::{actor::typ_client::QuerySnap, z_internal_error};
@ -221,9 +223,9 @@ impl LanguageState {
let mut collected_fonts = None;
if let Some(glyph_mapping) = font.clone() {
let glyph_provider = typst_ts_core::font::GlyphProvider::default();
let glyph_provider = reflexo_vec2svg::GlyphProvider::default();
let glyph_pass =
typst_ts_core::vector::pass::ConvertInnerImpl::new(glyph_provider, false);
reflexo_typst::vector::pass::ConvertInnerImpl::new(glyph_provider, false);
let mut glyph_renderer = Svg::default();
let mut glyphs = vec![];

View file

@ -12,6 +12,11 @@ use lsp_server::RequestId;
use lsp_types::request::{GotoDeclarationParams, WorkspaceConfiguration};
use lsp_types::*;
use once_cell::sync::OnceCell;
use reflexo_typst::{
error::prelude::*,
vfs::notify::{FileChangeSet, MemoryEvent},
Bytes, Error, ImmutPath, TaskInputs, Time,
};
use serde::{Deserialize, Serialize};
use serde_json::{Map, Value as JsonValue};
use sync_lsp::*;
@ -26,12 +31,6 @@ use tinymist_query::{
};
use tokio::sync::mpsc;
use typst::{diag::FileResult, syntax::Source};
use typst_ts_compiler::TaskInputs;
use typst_ts_compiler::{
vfs::notify::{FileChangeSet, MemoryEvent},
Time,
};
use typst_ts_core::{error::prelude::*, Bytes, Error, ImmutPath};
use super::{init::*, *};
use crate::actor::editor::EditorRequest;
@ -1049,8 +1048,8 @@ impl lsp_types::request::Request for OnEnter {
#[test]
fn test_as_path() {
use reflexo::path::PathClean;
use std::path::Path;
use typst_ts_core::path::PathClean;
let uri = Url::parse("untitled:/path/to/file").unwrap();
assert_eq!(as_path_(uri), Path::new("/untitled/path/to/file").clean());

View file

@ -6,18 +6,16 @@ use std::{path::PathBuf, sync::Arc};
use anyhow::{bail, Context};
use once_cell::sync::Lazy;
use reflexo_typst::{EntryReader, EntryState, TaskInputs, TypstDatetime};
use tinymist_query::{ExportKind, PageSelection};
use tokio::sync::mpsc;
use typlite::Typlite;
use typst::foundations::IntoValue;
use typst::foundations::{IntoValue, Smart};
use typst::{
foundations::Smart,
layout::{Abs, Frame},
syntax::{ast, SyntaxNode},
visualize::Color,
};
use typst_ts_compiler::{EntryReader, EntryState, TaskInputs};
use typst_ts_core::TypstDatetime;
use crate::tool::text::FullTextDigest;
use crate::{
@ -172,6 +170,7 @@ impl ExportConfig {
kind: &ExportKind,
artifact: CompiledArtifact<LspCompilerFeat>,
) -> anyhow::Result<Option<PathBuf>> {
use reflexo_vec2svg::DefaultExportFeature;
use ExportKind::*;
use PageSelection::*;
@ -224,7 +223,7 @@ impl ExportConfig {
pretty,
} => {
let elements =
typst_ts_compiler::query::retrieve(artifact.world.deref(), &selector, doc)
reflexo_typst::query::retrieve(artifact.world.deref(), &selector, doc)
.map_err(|e| anyhow::anyhow!("failed to retrieve: {e}"))?;
if one && elements.len() != 1 {
bail!("expected exactly one element, found {}", elements.len());
@ -247,7 +246,9 @@ impl ExportConfig {
serialize(&mapped, &format, strict, pretty).map(String::into_bytes)?
}
}
Html {} => typst_ts_svg_exporter::render_svg_html(doc).into_bytes(),
Html {} => {
reflexo_vec2svg::render_svg_html::<DefaultExportFeature>(doc).into_bytes()
}
Text {} => format!("{}", FullTextDigest(doc.clone())).into_bytes(),
Markdown {} => {
let conv = Typlite::new(artifact.world)

View file

@ -4,9 +4,9 @@ use std::path::PathBuf;
use anyhow::bail;
use base64::Engine;
use reflexo_typst::TypstDict;
use serde::{Deserialize, Serialize};
use sync_lsp::{just_future, SchedulableResponse};
use typst_ts_core::TypstDict;
use crate::internal_error;

View file

@ -3,11 +3,11 @@
use std::io::Write;
use std::path::{Path, PathBuf};
use reflexo_typst::{Bytes, ImmutPath, TypstFileId};
use typst::diag::{bail, eco_format, FileError, FileResult, StrResult};
use typst::syntax::package::{PackageManifest, PackageSpec, TemplateInfo};
use typst::syntax::VirtualPath;
use typst::World;
use typst_ts_core::{Bytes, ImmutPath, TypstFileId};
use crate::world::LspWorld;

View file

@ -1,8 +1,8 @@
//! Package management tools.
use reflexo_typst::package::PackageRegistry;
use typst::diag::{eco_format, StrResult};
use typst::syntax::package::{PackageVersion, VersionlessPackageSpec};
use typst_ts_compiler::package::Registry;
use crate::LspWorld;

View file

@ -3,9 +3,12 @@
use std::num::NonZeroUsize;
use std::{collections::HashMap, net::SocketAddr, path::Path, sync::Arc};
use actor::typ_server::SucceededArtifact;
use actor::typ_server::{CompileServerOpts, SucceededArtifact};
use hyper::service::{make_service_fn, service_fn};
use lsp_types::notification::Notification;
use reflexo_typst::debug_loc::SourceSpanOffset;
use reflexo_typst::vfs::notify::{FileChangeSet, MemoryEvent};
use reflexo_typst::{EntryReader, Error, TypstDocument, TypstFileId};
use serde::Serialize;
use serde_json::Value as JsonValue;
use sync_lsp::just_ok;
@ -21,10 +24,6 @@ use typst_preview::{
Location, LspControlPlaneRx, LspControlPlaneTx, MemoryFiles, MemoryFilesShort, PreviewArgs,
PreviewBuilder, PreviewMode, Previewer, SourceFileServer,
};
use typst_ts_compiler::vfs::notify::{FileChangeSet, MemoryEvent};
use typst_ts_compiler::EntryReader;
use typst_ts_core::debug_loc::SourceSpanOffset;
use typst_ts_core::{Error, TypstDocument, TypstFileId};
use crate::world::{LspCompilerFeat, LspWorld};
use crate::*;
@ -439,8 +438,16 @@ pub async fn preview_main(args: PreviewCliArgs) -> anyhow::Result<()> {
// Consume editor_rx
tokio::spawn(async move { while editor_rx.recv().await.is_some() {} });
let service =
CompileServerActor::new(verse, intr_tx, intr_rx).with_watch(Some(handle.clone()));
let service = CompileServerActor::new_with(
verse,
intr_tx,
intr_rx,
CompileServerOpts {
compile_handle: handle.clone(),
..Default::default()
},
)
.with_watch(true);
(service, handle)
};

View file

@ -3,7 +3,7 @@
use core::fmt;
use std::sync::Arc;
use typst_ts_core::TypstDocument;
use reflexo_typst::TypstDocument;
/// A full text digest of a document.
pub struct FullTextDigest(pub Arc<TypstDocument>);

View file

@ -4,9 +4,9 @@ use std::io::{self, Write};
use std::ops::Range;
use std::sync::Arc;
use reflexo_typst::{debug_loc::SourceSpanOffset, exporter_utils::map_err};
use serde::{Deserialize, Serialize};
use typst::{model::Document, syntax::Span, text::TextItem};
use typst_ts_core::{debug_loc::SourceSpanOffset, exporter_utils::map_err};
use unicode_script::{Script, UnicodeScript};
/// Words count for a document.

View file

@ -47,7 +47,7 @@ macro_rules! get_arg_or_default {
}
pub(crate) use get_arg_or_default;
pub fn z_internal_error(msg: typst_ts_core::Error) -> ResponseError {
pub fn z_internal_error(msg: reflexo::Error) -> ResponseError {
ResponseError {
code: ErrorCode::InternalError as i32,
message: format!("internal: {msg:?}"),

View file

@ -15,12 +15,8 @@ tinymist-assets.workspace = true
typst-assets.workspace = true
comemo.workspace = true
typst-ts-svg-exporter.workspace = true
typst-ts-core = { workspace = true, default-features = false, features = [
"flat-vector",
"vector-bbox",
] }
typst-ts-compiler.workspace = true
reflexo-vec2svg.workspace = true
reflexo-typst.workspace = true
once_cell.workspace = true
tokio.workspace = true
tokio-tungstenite.workspace = true
@ -39,4 +35,4 @@ default = ["no-content-hint"]
# Disable the default content hint.
# This requires modifying typst.
no-content-hint = ["typst-ts-core/no-content-hint"]
no-content-hint = ["reflexo-typst/no-content-hint"]

View file

@ -1,10 +1,10 @@
use futures::{SinkExt, StreamExt};
use log::{debug, info, trace, warn};
use reflexo_typst::debug_loc::DocumentPosition;
use serde::{Deserialize, Serialize};
use tokio::sync::mpsc;
use tokio::{net::TcpStream, sync::broadcast};
use tokio_tungstenite::{tungstenite::Message, WebSocketStream};
use typst_ts_core::debug_loc::DocumentPosition;
use crate::debug_loc::{InternQuery, SpanInterner};
use crate::outline::Outline;

View file

@ -1,11 +1,11 @@
use std::sync::Arc;
use log::{debug, info, trace};
use reflexo_typst::debug_loc::{ElementPoint, SourceSpanOffset};
use reflexo_typst::TypstDocument;
use reflexo_vec2svg::IncrSvgDocServer;
use tokio::sync::{broadcast, mpsc};
use typst::model::Document;
use typst_ts_core::debug_loc::{ElementPoint, SourceSpanOffset};
use typst_ts_core::TypstDocument;
use typst_ts_svg_exporter::IncrSvgDocServer;
use crate::{debug_loc::SpanInterner, outline::Outline};

View file

@ -1,9 +1,9 @@
use std::sync::Arc;
use log::{debug, error, info};
use reflexo_typst::debug_loc::{CharPosition, DocumentPosition, SourceLocation, SourceSpanOffset};
use tokio::sync::{broadcast, mpsc};
use typst::syntax::Span;
use typst_ts_core::debug_loc::{CharPosition, DocumentPosition, SourceLocation, SourceSpanOffset};
use crate::{
ChangeCursorPositionRequest, EditorServer, MemoryFiles, MemoryFilesShort, SourceFileServer,
@ -253,7 +253,7 @@ impl<T: SourceFileServer + EditorServer> TypstActor<T> {
}
}
fn handle_error<T>(loc: &'static str, m: Result<T, typst_ts_core::Error>) -> Option<T> {
fn handle_error<T>(loc: &'static str, m: Result<T, reflexo_typst::Error>) -> Option<T> {
if let Err(err) = &m {
error!("TypstActor: failed to {loc}: {err:#}");
}

View file

@ -1,11 +1,11 @@
use futures::{SinkExt, StreamExt};
use log::{info, trace};
use reflexo_typst::debug_loc::{DocumentPosition, ElementPoint};
use tokio::{
net::TcpStream,
sync::{broadcast, mpsc},
};
use tokio_tungstenite::{tungstenite::Message, WebSocketStream};
use typst_ts_core::debug_loc::{DocumentPosition, ElementPoint};
use crate::actor::{editor::DocToSrcJumpResolveRequest, render::ResolveSpanRequest};

View file

@ -1,8 +1,8 @@
use std::{ops::DerefMut, sync::Arc};
use indexmap::IndexSet;
use reflexo_typst::debug_loc::SourceSpan;
use tokio::sync::RwLock;
use typst_ts_core::debug_loc::SourceSpan;
#[derive(Debug)]
pub enum InternQuery<T> {
@ -45,8 +45,9 @@ impl InternId {
/// Span interner
///
/// Interns spans and returns an intern id. Intern id can be converted to a span.
/// Clone of the interner is cheap, and the clone shares the same interned spans.
/// Interns spans and returns an intern id. Intern id can be converted to a
/// span. Clone of the interner is cheap, and the clone shares the same interned
/// spans.
#[derive(Clone, Default)]
pub struct SpanInterner {
inner: Arc<RwLock<SpanInternerImpl>>,

View file

@ -6,32 +6,32 @@ mod outline;
pub use actor::editor::{
CompileStatus, ControlPlaneMessage, ControlPlaneResponse, LspControlPlaneRx, LspControlPlaneTx,
};
use actor::webview::WebviewActorRequest;
pub use args::*;
use once_cell::sync::OnceCell;
pub use outline::Outline;
use std::pin::Pin;
use std::time::Duration;
use std::{collections::HashMap, future::Future, path::PathBuf, sync::Arc};
use debug_loc::SpanInterner;
use futures::SinkExt;
use log::info;
use once_cell::sync::OnceCell;
use reflexo_typst::debug_loc::SourceSpanOffset;
use reflexo_typst::Error;
use reflexo_typst::TypstDocument as Document;
use serde::{Deserialize, Serialize};
use tokio::net::{TcpListener, TcpStream};
use tokio::sync::{broadcast, mpsc, oneshot};
use tokio_tungstenite::tungstenite::Message;
use tokio_tungstenite::WebSocketStream;
use typst::{layout::Position, syntax::Span};
use typst_ts_core::debug_loc::SourceSpanOffset;
use typst_ts_core::Error;
use typst_ts_core::TypstDocument as Document;
use crate::actor::editor::EditorActorRequest;
use crate::actor::render::RenderActorRequest;
use actor::editor::{EditorActor, EditorConnection};
use actor::typst::{TypstActor, TypstActorRequest};
use actor::webview::WebviewActorRequest;
use debug_loc::SpanInterner;
type StopFuture = Pin<Box<dyn Future<Output = ()> + Send + Sync>>;
@ -335,7 +335,7 @@ impl PreviewBuilder {
}
}
pub type SourceLocation = typst_ts_core::debug_loc::SourceLocation;
pub type SourceLocation = reflexo_typst::debug_loc::SourceLocation;
pub enum Location {
Src(SourceLocation),

View file

@ -1,12 +1,12 @@
use std::num::NonZeroUsize;
use reflexo_typst::debug_loc::DocumentPosition;
use reflexo_typst::TypstDocument;
use serde::{Deserialize, Serialize};
use typst::foundations::{Content, NativeElement, Packed, StyleChain};
use typst::introspection::Introspector;
use typst::model::HeadingElem;
use typst::syntax::Span;
use typst_ts_core::debug_loc::DocumentPosition;
use typst_ts_core::TypstDocument;
use crate::debug_loc::SpanInternerImpl;

View file

@ -13,16 +13,16 @@
"unlink:local": "yarn unlink @myriaddreamin/typst.ts @myriaddreamin/typst-ts-renderer"
},
"peerDependencies": {
"@myriaddreamin/typst-ts-renderer": "0.5.0-rc5",
"@myriaddreamin/typst.ts": "0.5.0-rc5"
"@myriaddreamin/typst-ts-renderer": "0.5.0-rc7",
"@myriaddreamin/typst.ts": "0.5.0-rc7"
},
"devDependencies": {
"@myriaddreamin/typst-ts-renderer": "0.5.0-rc5",
"@myriaddreamin/typst.ts": "0.5.0-rc5",
"@myriaddreamin/typst-ts-renderer": "0.5.0-rc7",
"@myriaddreamin/typst.ts": "0.5.0-rc7",
"typescript": "^5.0.2"
},
"exports": {
".": "./src/index.mts",
"./*": "./src/*"
}
}
}

View file

@ -13,9 +13,9 @@
"unlink:local": "yarn unlink @myriaddreamin/typst.ts @myriaddreamin/typst-ts-renderer"
},
"dependencies": {
"@myriaddreamin/typst-ts-renderer": "0.5.0-rc5",
"@myriaddreamin/typst.ts": "0.5.0-rc5",
"@myriaddreamin/typst-ts-renderer": "0.5.0-rc7",
"@myriaddreamin/typst.ts": "0.5.0-rc7",
"typst-dom": "link:../typst-dom",
"rxjs": "^7.8.1"
}
}
}

View file

@ -307,15 +307,15 @@
resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32"
integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==
"@myriaddreamin/typst-ts-renderer@0.5.0-rc5":
version "0.5.0-rc5"
resolved "https://registry.yarnpkg.com/@myriaddreamin/typst-ts-renderer/-/typst-ts-renderer-0.5.0-rc5.tgz#7168340613b2b0f0b7f11622f8d3dcacc0e175e5"
integrity sha512-aGll5OgHdZhBqhnOMPvGP0Ewevl9IzycdnKUj0W7bDzTL7eEmzphtlAbkm8e4vKxIvvwu6oos8gZhB7Iwl/3Xw==
"@myriaddreamin/typst-ts-renderer@0.5.0-rc7":
version "0.5.0-rc7"
resolved "https://registry.yarnpkg.com/@myriaddreamin/typst-ts-renderer/-/typst-ts-renderer-0.5.0-rc7.tgz#eb3a816b6159f5607c54ece3b5cc2351b4934eb0"
integrity sha512-QavrR0TnkCh31bS+Rk54Uf13MOI703LmDwaizikQ99BfHorUikCpkPm8IxUFHXqM3NEbkcSeKUPDHC+NS03P7g==
"@myriaddreamin/typst.ts@0.5.0-rc5":
version "0.5.0-rc5"
resolved "https://registry.yarnpkg.com/@myriaddreamin/typst.ts/-/typst.ts-0.5.0-rc5.tgz#947e283c1af11df16a84d2543852e419d97f040b"
integrity sha512-uBVa6uIUBIT31szTNn8IMPQQPc9dDMx4SxmCjTNwdMkpRhpQay9PLlBs07ynZslC37pucN/WSPSzBuPlaKRe4g==
"@myriaddreamin/typst.ts@0.5.0-rc7":
version "0.5.0-rc7"
resolved "https://registry.yarnpkg.com/@myriaddreamin/typst.ts/-/typst.ts-0.5.0-rc7.tgz#76c327998c0bfffb4a04960aaf35ceb448f98060"
integrity sha512-4Oc8zUb2reQ5wbtn+YnPzSpOAe0dE+To7d1YzLTCy8VVtxM8hBoKmWKZPJUiW0NW7E0rpwvnvXeRrhvPG6LxRg==
dependencies:
idb "^7.1.1"