Describe the bug
In the recent 1.20.0 version, the #1179 PR came into effect, which enabled formatting for Ansible YAML files.
When the formatting is applied, the blank line before the last comment in my Ansible YAML files is removed. See the expected/current behavior.
I may be incorrect, but I believe this is due to using an old version of prettier. I found the following issue in prettier that seems to describe this behavior: prettier/prettier#10922. The issue was fixed in prettier/prettier#17843 (commit: prettier/prettier@94b9a05). This was apparently first included in the 3.7.0 release.
From what I can tell, this extension has pinned prettier at version 2.2.1, which is now over five years old.
Can the prettier version be updated to fix this issue?
Expected Behavior
The formatter makes no change to this file.
some_var: Some Value
# comment
other_var: Other Value
Current Behavior
The formatter removes the blank line(s) before the last comment.
some_var: Some Value
# comment
other_var: Other Value
Steps to Reproduce
- Install extension 1.20.0.
- Enable
yaml.format.enable setting (the default) and optionally the editor.formatOnSave in VSCode.
- Save the file, or manually perform formatting on the Ansible YAML file.
- Observe the undesired removal of blank lines before the last comment.
Environment
I only tested on Linux, not on other platforms, so I don't know if it is an issue there, but I suspect it will be.
Describe the bug
In the recent 1.20.0 version, the #1179 PR came into effect, which enabled formatting for Ansible YAML files.
When the formatting is applied, the blank line before the last comment in my Ansible YAML files is removed. See the expected/current behavior.
I may be incorrect, but I believe this is due to using an old version of
prettier. I found the following issue inprettierthat seems to describe this behavior: prettier/prettier#10922. The issue was fixed in prettier/prettier#17843 (commit: prettier/prettier@94b9a05). This was apparently first included in the 3.7.0 release.From what I can tell, this extension has pinned
prettierat version 2.2.1, which is now over five years old.Can the
prettierversion be updated to fix this issue?Expected Behavior
The formatter makes no change to this file.
Current Behavior
The formatter removes the blank line(s) before the last comment.
Steps to Reproduce
yaml.format.enablesetting (the default) and optionally theeditor.formatOnSavein VSCode.Environment
I only tested on Linux, not on other platforms, so I don't know if it is an issue there, but I suspect it will be.