Switch to Rust 2024 edition (#18129)

This commit is contained in:
Micha Reiser 2025-05-16 13:25:28 +02:00 committed by GitHub
parent e67b35743a
commit 9ae698fe30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
1082 changed files with 4211 additions and 3300 deletions

View file

@ -13,11 +13,11 @@ pub(crate) use ruff_settings::RuffSettings;
use crate::edit::LanguageId;
use crate::workspace::{Workspace, Workspaces};
use crate::{
edit::{DocumentKey, DocumentVersion, NotebookDocument},
PositionEncoding, TextDocument,
edit::{DocumentKey, DocumentVersion, NotebookDocument},
};
use super::{settings::ResolvedClientSettings, ClientSettings};
use super::{ClientSettings, settings::ResolvedClientSettings};
mod ruff_settings;

View file

@ -1,17 +1,17 @@
use std::collections::BTreeMap;
use std::ops::Deref;
use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, Ordering};
use anyhow::Context;
use ignore::{WalkBuilder, WalkState};
use ruff_linter::settings::types::GlobPath;
use ruff_linter::{settings::types::FilePattern, settings::types::PreviewMode};
use ruff_workspace::Settings;
use ruff_workspace::pyproject::find_fallback_target_version;
use ruff_workspace::resolver::match_exclusion;
use ruff_workspace::Settings;
use ruff_workspace::{
configuration::{Configuration, FormatConfiguration, LintConfiguration, RuleSelection},
pyproject::{find_user_settings_toml, settings_toml},

View file

@ -6,9 +6,9 @@ use serde::Deserialize;
use serde_json::{Map, Value};
use thiserror::Error;
use ruff_linter::RuleSelector;
use ruff_linter::line_width::LineLength;
use ruff_linter::rule_selector::ParseError;
use ruff_linter::RuleSelector;
use ruff_workspace::options::Options;
/// Maps a workspace URI to its associated client settings. Used during server initialization.
@ -441,11 +441,7 @@ impl ResolvedClientSettings {
*contains_invalid_settings = true;
tracing::error!("Unknown rule selectors found in `{key}`: {unknown:?}");
}
if known.is_empty() {
None
} else {
Some(known)
}
if known.is_empty() { None } else { Some(known) }
}
/// Attempts to resolve a setting using a list of available client settings as sources.