fix: complete import path by syntax instead of type (#968)

* fix: complete import path by syntax instead of type

* test: add import package tests

* fix: unused item
This commit is contained in:
Myriad-Dreamin 2024-12-08 21:59:35 +08:00 committed by GitHub
parent fee46d2123
commit ab234634a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 55 additions and 14 deletions

View file

@ -285,6 +285,12 @@ impl DerefMut for LocalContext {
}
impl LocalContext {
/// Set list of packages for LSP-based completion.
#[cfg(test)]
pub fn test_package_list(&mut self, f: impl FnOnce() -> Vec<(PackageSpec, Option<EcoString>)>) {
self.world.registry.test_package_list(f);
}
/// Set the files for LSP-based completion.
#[cfg(test)]
pub fn test_completion_files(&mut self, f: impl FnOnce() -> Vec<TypstFileId>) {