mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-03 15:15:33 +00:00
Reduce extensive use of snapshot.query
(#11596)
This commit is contained in:
parent
204c59e353
commit
163c374242
8 changed files with 38 additions and 74 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue