Closed Booksbaum closed 9 months ago
Ok...CI errors are because fantomas now respects .editorconfig
(was incorrect pattern match for fs-files)
-> quite a lot of files need reformatting...
I just apply new formatting too all. If that's not ok we should adjust settings in .editorconfig
Some Code Actions for number
SynConst
s:(inspired by dotnet/fsharp#3043 & dotnet/fsharp#3044)
Convert between bases/formats:
sbyte
,byte
,int16
,uint16
,int
,int32
,uint
,uint32
,nativeint
,unativeint
,int64
,uint64
) and floats (float
,float32
) in hex/oct/bin formChar.IsControl
check) (except escape sequences --\n
and co are handled)but is just uncommented (incl. tests) -> should be un-uncommented once PR (dotnet/fsharp#15898) is merged
Convert between decimal & scientific notation
for floats: not precise/too precise/not lossless with float value and I wasn't in the mood to implement conversion based on strings....Convert between float & int notation
for floats: issues with precision/rounding+
). But sometimes it's necessary to add or change the sign0b1010_0101y
->-91y
: decimal requires a minus sign0b1010_0101y
->-91y
->-0b1011011y
Replace with Named Constant (
MinValue
,MaxValue
,±infinity
,nan
,Epsilon
):Extract/Integrate Minus:
Add digit group separators:
3
)4
), bytes (2
)3
(is there a special name?)4
), bytes (8
)Pad binary with
0
s:4
,8
,16
bits4
or8
bit? (So if I have0b101
I wouldPad to next 8 bit
to get0b00000101
and then additionalPad to next 8 bit
to get0b0000000000000101
)Some Additional Notes:
To prevent errors with newly added sign I add a space when operator char immediately before:
But I'm not sure I handle all cases a new sign might lead to invalid code.
I currently check for leading
!$%&*+-./<=>?@^|~
(F# operator chars).Are there any other cases a number is valid immediately after something else but with additional sign it turns into an error?