mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 06:11:43 +00:00
Optional source map generation (#6894)
This commit is contained in:
parent
15b73bdb8a
commit
eae59cf088
7 changed files with 117 additions and 73 deletions
|
@ -39,7 +39,7 @@ use std::fmt::{Debug, Display};
|
|||
use std::marker::PhantomData;
|
||||
|
||||
use crate::format_element::document::Document;
|
||||
use crate::printer::{Printer, PrinterOptions};
|
||||
use crate::printer::{Printer, PrinterOptions, SourceMapGeneration};
|
||||
pub use arguments::{Argument, Arguments};
|
||||
pub use buffer::{
|
||||
Buffer, BufferExtensions, BufferSnapshot, Inspect, RemoveSoftLinesBuffer, VecBuffer,
|
||||
|
@ -311,10 +311,12 @@ impl FormatOptions for SimpleFormatOptions {
|
|||
}
|
||||
|
||||
fn as_print_options(&self) -> PrinterOptions {
|
||||
PrinterOptions::default()
|
||||
.with_indent(self.indent_style)
|
||||
.with_tab_width(self.tab_width())
|
||||
.with_print_width(self.line_width.into())
|
||||
PrinterOptions {
|
||||
print_width: self.line_width.into(),
|
||||
indent_style: self.indent_style,
|
||||
source_map_generation: SourceMapGeneration::Enabled,
|
||||
..PrinterOptions::default()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue