Reduce extensive use of snapshot.query (#11596)

This commit is contained in:
Micha Reiser 2024-05-29 10:11:46 +02:00 committed by GitHub
parent 204c59e353
commit 163c374242
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 38 additions and 74 deletions

View file

@ -8,12 +8,8 @@ use super::LSPResult;
pub(super) fn generate_diagnostics(snapshot: &DocumentSnapshot) -> Diagnostics {
if snapshot.client_settings().lint() {
crate::lint::check(
snapshot.query(),
snapshot.query().settings().file_resolver(),
snapshot.query().settings().linter(),
snapshot.encoding(),
)
let document = snapshot.query();
crate::lint::check(document, snapshot.encoding())
} else {
Diagnostics::default()
}