Preserve position of attributes on structure items (#2247)
* Add `ext_attrs` to:
include statements
open statements
classes
type declarations
let bindings
`value_description`
type extensions
exceptions
* Fixes a bug where, in signatures,
```ocaml
type%foo t
exception%foo X
```
was formatted as-is, but
```ocaml
type t
exception X
```
resulted in
```ocaml
type t
exception X
```
This was because for the first example, the "line-break-algorithm"
(found in `Ast.Signature_item.allow_adjacent`), was making its decision
as if the code to printed was :
```ocaml
[%%foo type t]
[%%foo exception X]
```
We know have more information in our AST which allows us to make a
difference between `type%foo t` and `[%%foo type t]`.
b10d76
-
Feb 28 09:46 +00:00