Summary
tl;dr the fix is to set "yaml.yamlVersion": "1.1" but this was not previously necessary and may impact a large number of python + YAML users.
The current extension's YAML formatter will replace 1.0e+4 with 1e+4.
In YAML 1.1, 1e+4 is not a valid float.
In YAML 1.2, it is.
The -- to my knowledge -- standard and widely-used interface between python and YAML, PyYAML, is still on YAML 1.1
As a result, exponents are interpreted as strings if they lack a .0
>>> import yaml
>>> yaml.safe_load("1.0e+4")
10000.0
>>> yaml.safe_load("1e+4")
'1e+4'
Adding more details to the formatter changelog entry ("The new formatter may perform breaking changes if yaml.yamlVersion is not set correctly, such as 1.0e+4 -> 1e+4 which are equivalent in YAML 1.2 but not YAML 1.1.") would help limit the fallout.
(PyYAML does not look likely to fix it on their side anytime soon yaml/pyyaml#173)
Summary
tl;dr the fix is to set
"yaml.yamlVersion": "1.1"but this was not previously necessary and may impact a large number of python + YAML users.The current extension's YAML formatter will replace
1.0e+4with1e+4.In YAML 1.1,
1e+4is not a valid float.In YAML 1.2, it is.
The -- to my knowledge -- standard and widely-used interface between python and YAML, PyYAML, is still on YAML 1.1
As a result, exponents are interpreted as strings if they lack a
.0Adding more details to the formatter changelog entry ("The new formatter may perform breaking changes if
yaml.yamlVersionis not set correctly, such as1.0e+4->1e+4which are equivalent in YAML 1.2 but not YAML 1.1.") would help limit the fallout.(PyYAML does not look likely to fix it on their side anytime soon yaml/pyyaml#173)