refactor: complete paths without hacking (#971)

* refactor: complete paths without hacking

* dev: move code after refactor
This commit is contained in:
Myriad-Dreamin 2024-12-10 14:29:24 +08:00 committed by GitHub
parent ab234634a9
commit 969cc6d339
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 165 additions and 181 deletions

View file

@ -333,9 +333,11 @@ 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)
.copied()
.collect()
self.completion_files(&PathPreference::Source {
allow_package: false,
})
.copied()
.collect()
})
}