mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 22:31:47 +00:00
Fix(vscode): Respect line length ruff.toml configuration (#7306)
This commit is contained in:
parent
ee0f1270cf
commit
e561f5783b
2 changed files with 18 additions and 3 deletions
|
@ -73,12 +73,14 @@ pub(crate) fn format(
|
|||
return None;
|
||||
};
|
||||
|
||||
let preview = match pyproject_config.settings.lib.preview {
|
||||
let resolved_settings = resolver.resolve(path, &pyproject_config);
|
||||
|
||||
let preview = match resolved_settings.preview {
|
||||
PreviewMode::Enabled => ruff_python_formatter::PreviewMode::Enabled,
|
||||
PreviewMode::Disabled => ruff_python_formatter::PreviewMode::Disabled,
|
||||
};
|
||||
let line_length = resolved_settings.line_length;
|
||||
|
||||
let line_length = resolver.resolve(path, &pyproject_config).line_length;
|
||||
let options = PyFormatOptions::from_source_type(source_type)
|
||||
.with_line_width(LineWidth::from(NonZeroU16::from(line_length)))
|
||||
.with_preview(preview);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue