docs: document all public items in rust codebase (#2058)
Some checks failed
tinymist::auto_tag / auto-tag (push) Has been cancelled
tinymist::ci / Duplicate Actions Detection (push) Has been cancelled
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Has been cancelled
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Has been cancelled
tinymist::ci / prepare-build (push) Has been cancelled
tinymist::gh_pages / build-gh-pages (push) Has been cancelled
tinymist::ci / announce (push) Has been cancelled
tinymist::ci / build (push) Has been cancelled

This commit is contained in:
Myriad-Dreamin 2025-08-21 12:50:03 +08:00 committed by GitHub
parent 4ce0a59862
commit 532f25abe9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
75 changed files with 1429 additions and 533 deletions

View file

@ -33,7 +33,7 @@ use super::{LspQuerySnapshot, TypeEnv};
use crate::adt::revision::{RevisionLock, RevisionManager, RevisionManagerLike, RevisionSlot};
use crate::analysis::prelude::*;
use crate::analysis::{
AnalysisStats, BibInfo, CompletionFeat, Definition, PathPreference, QueryStatGuard,
AnalysisStats, BibInfo, CompletionFeat, Definition, PathKind, QueryStatGuard,
SemanticTokenCache, SemanticTokenContext, SemanticTokens, Signature, SignatureTarget, Ty,
TypeInfo, analyze_signature, bib_info, definition, post_type_check,
};
@ -339,16 +339,13 @@ impl LocalContext {
}
/// Get all the source files in the workspace.
pub(crate) fn completion_files(
&self,
pref: &PathPreference,
) -> impl Iterator<Item = &TypstFileId> {
pub(crate) fn completion_files(&self, pref: &PathKind) -> impl Iterator<Item = &TypstFileId> {
let regexes = pref.ext_matcher();
self.caches
.completion_files
.get_or_init(|| {
if let Some(root) = self.world.entry_state().workspace_root() {
scan_workspace_files(&root, PathPreference::Special.ext_matcher(), |path| {
scan_workspace_files(&root, PathKind::Special.ext_matcher(), |path| {
WorkspaceResolver::workspace_file(Some(&root), VirtualPath::new(path))
})
} else {
@ -368,7 +365,7 @@ impl LocalContext {
/// Get all the source files in the workspace.
pub fn source_files(&self) -> &Vec<TypstFileId> {
self.caches.root_files.get_or_init(|| {
self.completion_files(&PathPreference::Source {
self.completion_files(&PathKind::Source {
allow_package: false,
})
.copied()
@ -391,7 +388,7 @@ impl LocalContext {
/// Get all depended files in the workspace, inclusively.
pub fn depended_source_files(&self) -> EcoVec<TypstFileId> {
let mut ids = self.depended_files();
let preference = PathPreference::Source {
let preference = PathKind::Source {
allow_package: false,
};
ids.retain(|id| preference.is_match(id.vpath().as_rooted_path()));