Adding a comment next to the last item of a list appears to influence the formatting rules of that list (more like a simple list?).
Pre-formatting:
type TestType = object
fieldWithSomeName1: string
fieldWithSomeName2: int
fieldWithSomeName3: bool
fieldWithSomeName4: int
let test = TestType(
fieldWithSomeName1: "test",
fieldWithSomeName2: 1,
fieldWithSomeName3: true,
fieldWithSomeName4: 2, # great comment here
)
const test2 = [
1000.uint64(),
2000.uint64(),
3000,
4000,
5000,
6000,
7000,
8000,
9000,
10000,
20000,
30000, # yikes!
]
Post-formatting:
type TestType = object
fieldWithSomeName1: string
fieldWithSomeName2: int
fieldWithSomeName3: bool
fieldWithSomeName4: int
let test = TestType(
fieldWithSomeName1: "test", fieldWithSomeName2: 1, fieldWithSomeName3: true, fieldWithSomeName4:
2 # great comment here
)
const test2 = [
1000.uint64(), 2000.uint64(), 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 20000, 30000
# yikes!
]
Note that adding no comments results in what I would expect:
type TestType = object
fieldWithSomeName1: string
fieldWithSomeName2: int
fieldWithSomeName3: bool
fieldWithSomeName4: int
let test = TestType(
fieldWithSomeName1: "test",
fieldWithSomeName2: 1,
fieldWithSomeName3: true,
fieldWithSomeName4: 2,
)
const test2 = [
1000.uint64(),
2000.uint64(),
3000,
4000,
5000,
6000,
7000,
8000,
9000,
10000,
20000,
30000,
]
Also when adding multiple comments the formatting is as expected:
type TestType = object
fieldWithSomeName1: string
fieldWithSomeName2: int
fieldWithSomeName3: bool
fieldWithSomeName4: int
let test = TestType(
fieldWithSomeName1: "test",
fieldWithSomeName2: 1,
fieldWithSomeName3: true, # awesome bool
fieldWithSomeName4: 2, # great comment here
)
Adding a comment next to the last item of a list appears to influence the formatting rules of that list (more like a simple list?).
Pre-formatting:
Post-formatting:
Note that adding no comments results in what I would expect:
Also when adding multiple comments the formatting is as expected: