pub trait LspWorldExt {
// Required methods
fn file_id_by_path(&self, path: &Path) -> FileResult<FileId>;
fn source_by_path(&self, path: &Path) -> FileResult<Source>;
fn uri_for_id(&self, fid: FileId) -> FileResult<Url>;
fn depended_files(&self) -> EcoVec<FileId>;
fn depended_fs_paths(&self) -> EcoVec<ImmutPath>;
}
Expand description
Extension trait for typst::World
.
Required Methods§
Sourcefn file_id_by_path(&self, path: &Path) -> FileResult<FileId>
fn file_id_by_path(&self, path: &Path) -> FileResult<FileId>
Get file’s id by its path
Sourcefn source_by_path(&self, path: &Path) -> FileResult<Source>
fn source_by_path(&self, path: &Path) -> FileResult<Source>
Get the source of a file by file path.
Sourcefn uri_for_id(&self, fid: FileId) -> FileResult<Url>
fn uri_for_id(&self, fid: FileId) -> FileResult<Url>
Resolve the uri for a file id.
Sourcefn depended_files(&self) -> EcoVec<FileId>
fn depended_files(&self) -> EcoVec<FileId>
Get all depended file ids of a compilation, inclusively. Note: must be called after compilation.
Sourcefn depended_fs_paths(&self) -> EcoVec<ImmutPath>
fn depended_fs_paths(&self) -> EcoVec<ImmutPath>
Get all depended paths in file system of a compilation, inclusively. Note: must be called after compilation.