mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-13 07:08:03 +00:00
ruff_python_formatter: copy and inline shared traits (#8656)
It seems as though using `include!(...)` to avoid the source code copy breaks rust-analzer. Namely, it treats the included file as unlinked, and so any part of analysis (e.g., goto-definition) that needs that file to reason about the code ends up failing. <!-- Thank you for contributing to Ruff! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary <!-- What's the purpose of the change? What does it do, and why? --> ## Test Plan <!-- How was it tested? -->
This commit is contained in:
parent
6a6de53722
commit
8984072df2
2 changed files with 115 additions and 2 deletions
|
@ -16,6 +16,7 @@ use crate::comments::{
|
|||
};
|
||||
pub use crate::context::PyFormatContext;
|
||||
pub use crate::options::{MagicTrailingComma, PreviewMode, PyFormatOptions, QuoteStyle};
|
||||
pub use crate::shared_traits::{AsFormat, FormattedIter, FormattedIterExt, IntoFormat};
|
||||
use crate::verbatim::suppressed_node;
|
||||
|
||||
pub(crate) mod builders;
|
||||
|
@ -29,12 +30,11 @@ mod options;
|
|||
pub(crate) mod other;
|
||||
pub(crate) mod pattern;
|
||||
mod prelude;
|
||||
mod shared_traits;
|
||||
pub(crate) mod statement;
|
||||
pub(crate) mod type_param;
|
||||
mod verbatim;
|
||||
|
||||
include!("../../ruff_formatter/shared_traits.rs");
|
||||
|
||||
/// 'ast is the lifetime of the source code (input), 'buf is the lifetime of the buffer (output)
|
||||
pub(crate) type PyFormatter<'ast, 'buf> = Formatter<'buf, PyFormatContext<'ast>>;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue