dummy impl for is_suppressed_statement_node on ctxt

This commit is contained in:
dylwil3 2025-11-17 14:00:02 -06:00
parent ac2d07e83c
commit 8b5eb56c76
1 changed files with 10 additions and 1 deletions

View File

@ -2,11 +2,12 @@ use std::fmt::{Debug, Formatter};
use std::ops::{Deref, DerefMut};
use ruff_formatter::{Buffer, FormatContext, GroupId, IndentWidth, SourceCode};
use ruff_python_ast::AnyNodeRef;
use ruff_python_ast::str::Quote;
use ruff_python_parser::Tokens;
use crate::PyFormatOptions;
use crate::comments::Comments;
use crate::comments::{Comments, has_skip_comment};
use crate::other::interpolated_string::InterpolatedStringContext;
pub struct PyFormatContext<'a> {
@ -112,6 +113,14 @@ impl<'a> PyFormatContext<'a> {
pub(crate) const fn is_preview(&self) -> bool {
self.options.preview().is_enabled()
}
/// Returns `true` if node is a suppressed statement.
pub(crate) fn is_suppressed_statement_node(&self, node: AnyNodeRef<'_>) -> bool {
if !node.is_statement() {
return false;
}
has_skip_comment(self.comments().trailing(node), self.source())
}
}
impl FormatContext for PyFormatContext<'_> {