Skip to content

Commit c26aa04

Browse files
fmt
1 parent fbc4330 commit c26aa04

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

pyrefly/lib/commands/infer.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ use crate::commands::files::FilesArgs;
2424
use crate::commands::files::get_project_config_for_current_dir;
2525
use crate::commands::util::CommandExitStatus;
2626
use crate::config::error_kind::ErrorKind;
27-
use crate::state::ide::insert_import_edit_with_forced_import_format;
2827
use crate::state::ide::ImportEdit;
28+
use crate::state::ide::insert_import_edit_with_forced_import_format;
2929
use crate::state::lsp::AnnotationKind;
3030
use crate::state::lsp::ParameterAnnotation;
3131
use crate::state::require::Require;
@@ -335,10 +335,7 @@ impl InferArgs {
335335
fs_anyhow::write(file_path, result)
336336
}
337337

338-
fn add_imports_to_file(
339-
file_path: &Path,
340-
imports: Vec<ImportEdit>,
341-
) -> anyhow::Result<()> {
338+
fn add_imports_to_file(file_path: &Path, imports: Vec<ImportEdit>) -> anyhow::Result<()> {
342339
let file_content = fs_anyhow::read_to_string(file_path)?;
343340
let mut result = file_content;
344341
for import_edit in imports {

pyrefly/lib/state/ide.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ use pyrefly_python::symbol_kind::SymbolKind;
1414
use pyrefly_util::gas::Gas;
1515
use ruff_python_ast::Expr;
1616
use ruff_python_ast::ModModule;
17-
use ruff_python_ast::helpers::is_docstring_stmt;
18-
use ruff_python_ast::name::Name;
1917
use ruff_python_ast::Stmt;
2018
use ruff_python_ast::StmtImportFrom;
19+
use ruff_python_ast::helpers::is_docstring_stmt;
20+
use ruff_python_ast::name::Name;
2121
use ruff_text_size::Ranged;
2222
use ruff_text_size::TextRange;
2323
use ruff_text_size::TextSize;

pyrefly/lib/state/lsp.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,8 +1868,7 @@ impl<'a> Transaction<'a> {
18681868
import_format,
18691869
);
18701870
let range = TextRange::at(import_edit.position, TextSize::new(0));
1871-
let title =
1872-
format!("Insert import: `{}`", import_edit.display_text);
1871+
let title = format!("Insert import: `{}`", import_edit.display_text);
18731872
code_actions.push((
18741873
title,
18751874
module_info.dupe(),
@@ -2407,10 +2406,8 @@ impl<'a> Transaction<'a> {
24072406
import_format,
24082407
);
24092408
let import_text_edit = TextEdit {
2410-
range: module_info.to_lsp_range(TextRange::at(
2411-
import_edit.position,
2412-
TextSize::new(0),
2413-
)),
2409+
range: module_info
2410+
.to_lsp_range(TextRange::at(import_edit.position, TextSize::new(0))),
24142411
new_text: import_edit.insert_text.clone(),
24152412
};
24162413
(Some(import_edit.display_text), Some(vec![import_text_edit]))

0 commit comments

Comments
 (0)