-
Couldn't load subscription status.
- Fork 22
Open
Description
E.g. for cases like:
# In argument
x <- matrix(
# fmt: table
c(
1, 2,
10, 200
),
ncol = 2
)I see two issues.
- In
can_have_directives(), we're checking whether the parent is an argument list, rather than an argument. - Comments get attached to argument nodes, not call nodes. Which is probably fine? But we need to acknowledge that.
Details
[crates/air_r_formatter/src/comments_ext.rs:46:9] self = Comments {
data: [
Leading {
node: 0: [email protected]
0: [email protected]
0: [email protected] "matrix" [Comments("# outer"), Newline("\n")] []
1: [email protected]
0: [email protected] "(" [] []
1: [email protected]
0: [email protected]
0: (empty)
1: [email protected]
0: [email protected]
0: [email protected] "c" [Newline("\n"), Whitespace(" "), Comments("# fmt: table"), Newline("\n"), Whitespace(" ")] []
1: [email protected]
0: [email protected] "(" [] []
1: [email protected]
0: [email protected]
0: (empty)
1: [email protected]
0: [email protected] "1" [Newline("\n"), Whitespace(" ")] []
1: [email protected] "," [] []
2: [email protected]
0: (empty)
1: [email protected]
0: [email protected] "2" [Newline("\n"), Whitespace(" ")] []
3: [email protected] "," [] []
4: [email protected]
0: (empty)
1: [email protected]
0: [email protected] "10" [Newline("\n"), Whitespace(" ")] []
5: [email protected] "," [] []
6: [email protected]
0: (empty)
1: [email protected]
0: [email protected] "200" [Newline("\n"), Whitespace(" ")] []
2: [email protected] ")" [Newline("\n"), Whitespace(" ")] []
2: [email protected] ")" [Newline("\n")] []
,
comment: SourceComment {
lines_before: 0,
lines_after: 1,
piece: SyntaxTriviaPieceComments(
Comments("# outer"),
),
kind: Line,
formatted: Cell {
value: true,
},
},
},
Leading {
node: 0: [email protected]
0: (empty)
1: [email protected]
0: [email protected]
0: [email protected] "c" [Newline("\n"), Whitespace(" "), Comments("# fmt: table"), Newline("\n"), Whitespace(" ")] []
1: [email protected]
0: [email protected] "(" [] []
1: [email protected]
0: [email protected]
0: (empty)
1: [email protected]
0: [email protected] "1" [Newline("\n"), Whitespace(" ")] []
1: [email protected] "," [] []
2: [email protected]
0: (empty)
1: [email protected]
0: [email protected] "2" [Newline("\n"), Whitespace(" ")] []
3: [email protected] "," [] []
4: [email protected]
0: (empty)
1: [email protected]
0: [email protected] "10" [Newline("\n"), Whitespace(" ")] []
5: [email protected] "," [] []
6: [email protected]
0: (empty)
1: [email protected]
0: [email protected] "200" [Newline("\n"), Whitespace(" ")] []
2: [email protected] ")" [Newline("\n"), Whitespace(" ")] []
,
comment: SourceComment {
lines_before: 1,
lines_after: 1,
piece: SyntaxTriviaPieceComments(
Comments("# fmt: table"),
),
kind: Line,
formatted: Cell {
value: true,
},
},
},
],
}
Metadata
Metadata
Assignees
Labels
No labels