dev: fix lint warnings introduced by #2062 (#2096)
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

> Hm. Sorry about the lint failures here, they slipped my attention
locally since they show up as warnings, not errors, in my editor. I'm
happy to put a PR fixing them later unless you get to it first.
>
> Not too sure how to deal with the unused DiagWorker::check method,
since it is used, just in a test-only module. We can certainly mark it
as #[cfg(test)] but that feels a little nasty.


https://github.com/Myriad-Dreamin/tinymist/pull/2062#issuecomment-3237812684

I ended up inlining the logic of `DiagWorker::check` into the test.
This commit is contained in:
Joseph Liu 2025-08-29 22:50:23 -04:00 committed by GitHub
parent 4324f8fd70
commit 731cd23ec8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 16 deletions

View file

@ -46,16 +46,8 @@ impl<'w> DiagWorker<'w> {
}
}
/// Runs code check on the given document.
pub fn check(mut self, source: &Source) -> Self {
for diag in self.ctx.lint(&source) {
self.handle(&diag);
}
self
}
/// Runs code check on the main document and all its dependencies.
pub fn full_check(mut self) -> Self {
pub fn check(mut self) -> Self {
for dep in self.ctx.world.depended_files() {
if WorkspaceResolver::is_package_file(dep) {
continue;