chore: Fix several style lints (#17488)
It's not comprehensive enough to start linting on `style` group, but hey, it's a start. Release Notes: - N/A
This commit is contained in:
parent
93249fc82b
commit
e6c1c51b37
361 changed files with 3530 additions and 3587 deletions
|
@ -117,7 +117,7 @@ impl JsonLspAdapter {
|
|||
},
|
||||
{
|
||||
"fileMatch": [schema_file_match(paths::keymap_file())],
|
||||
"schema": KeymapFile::generate_json_schema(&action_names),
|
||||
"schema": KeymapFile::generate_json_schema(action_names),
|
||||
},
|
||||
{
|
||||
"fileMatch": [
|
||||
|
|
|
@ -249,7 +249,7 @@ impl LspAdapter for RustLspAdapter {
|
|||
static REGEX: LazyLock<Regex> = LazyLock::new(|| Regex::new("\\(…?\\)").unwrap());
|
||||
|
||||
let detail = detail.unwrap();
|
||||
const FUNCTION_PREFIXES: [&'static str; 6] = [
|
||||
const FUNCTION_PREFIXES: [&str; 6] = [
|
||||
"async fn",
|
||||
"async unsafe fn",
|
||||
"const fn",
|
||||
|
@ -421,8 +421,8 @@ impl ContextProvider for RustContextProvider {
|
|||
.is_some();
|
||||
|
||||
if is_main_function {
|
||||
if let Some((package_name, bin_name)) = local_abs_path
|
||||
.and_then(|local_abs_path| package_name_and_bin_name_from_abs_path(local_abs_path))
|
||||
if let Some((package_name, bin_name)) =
|
||||
local_abs_path.and_then(package_name_and_bin_name_from_abs_path)
|
||||
{
|
||||
return Ok(TaskVariables::from_iter([
|
||||
(RUST_PACKAGE_TASK_VARIABLE.clone(), package_name),
|
||||
|
@ -449,7 +449,7 @@ impl ContextProvider for RustContextProvider {
|
|||
file: Option<Arc<dyn language::File>>,
|
||||
cx: &AppContext,
|
||||
) -> Option<TaskTemplates> {
|
||||
const DEFAULT_RUN_NAME_STR: &'static str = "RUST_DEFAULT_PACKAGE_RUN";
|
||||
const DEFAULT_RUN_NAME_STR: &str = "RUST_DEFAULT_PACKAGE_RUN";
|
||||
let package_to_run = all_language_settings(file.as_ref(), cx)
|
||||
.language(Some("Rust"))
|
||||
.tasks
|
||||
|
|
|
@ -383,7 +383,7 @@ impl LspAdapter for EsLintLspAdapter {
|
|||
"workspaceFolder": {
|
||||
"uri": workspace_root,
|
||||
"name": workspace_root.file_name()
|
||||
.unwrap_or_else(|| workspace_root.as_os_str()),
|
||||
.unwrap_or(workspace_root.as_os_str()),
|
||||
},
|
||||
"problems": problems,
|
||||
"codeActionOnSave": code_action_on_save,
|
||||
|
|
|
@ -49,7 +49,7 @@ struct TypeScriptVersions {
|
|||
server_version: String,
|
||||
}
|
||||
|
||||
const SERVER_NAME: &'static str = "vtsls";
|
||||
const SERVER_NAME: &str = "vtsls";
|
||||
#[async_trait(?Send)]
|
||||
impl LspAdapter for VtslsLspAdapter {
|
||||
fn name(&self) -> LanguageServerName {
|
||||
|
@ -220,7 +220,7 @@ impl LspAdapter for VtslsLspAdapter {
|
|||
self: Arc<Self>,
|
||||
adapter: &Arc<dyn LspAdapterDelegate>,
|
||||
) -> Result<Option<serde_json::Value>> {
|
||||
let tsdk_path = Self::tsdk_path(&adapter).await;
|
||||
let tsdk_path = Self::tsdk_path(adapter).await;
|
||||
let config = serde_json::json!({
|
||||
"tsdk": tsdk_path,
|
||||
"suggest": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue