Generic "comment to node" association logic (#4642)

This commit is contained in:
Micha Reiser 2023-05-30 11:28:01 +02:00 committed by GitHub
parent 84a5584888
commit 0cd453bdf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 1574 additions and 65 deletions

View file

@ -0,0 +1,13 @@
use crate::comments::visitor::{CommentPlacement, DecoratedComment};
use crate::comments::{CommentTextPosition, SourceComment};
use ruff_formatter::{SourceCode, SourceCodeSlice};
use ruff_python_ast::node::AnyNodeRef;
use std::cell::Cell;
/// Implements the custom comment placement logic.
pub(super) fn place_comment<'a>(
comment: DecoratedComment<'a>,
_source_code: SourceCode,
) -> CommentPlacement<'a> {
CommentPlacement::Default(comment)
}