che-che4z-lsp-for-cobol
che-che4z-lsp-for-cobol copied to clipboard
A setting to disable removal of the trailing spaces after document formatting
Is your feature request related to a problem?
The request is related to formatting capabilities of the COBOL LS extension. It automatically removes trailing spaces from the file and since I often use Format on Save function in VSC, it makes it difficult to track what exactly changed in the file because a saved file becomes fully changed from SCM point of view.
Describe the solution you'd like
Is it possible to introduce a setting for COBOL LS to disable the trailing spaces removal during the formatting? Or to select a strategy of the formatting:
- Remove the trailing whitespaces
- Correct an amount of spaces to fill up all the lines up to 80 column (or selected number) after formatting everything else
- Leave trailing whitespaces as is
- Possible other scenarios..
Describe alternatives you've considered
Alternatively, it can be ignoring the whitespaces for the diffs or disabling the Format on Save for the specific workspace, but it is not that convenient.
Additional information
No any.
Thank you for raising this issue @roman-kupriyanov ! I agree that we need to take a look at how better support editing record oriented source code.
We may introduce options for the formatting in the future. However, right now we are focusing on other priority items like proper dialect support and a clear interface for the internal parser.
For now you can use VSCode setting for disabling format on save for cobol like this
"[cobol]": {
"editor.formatOnSave": false
},
Hi Roman, as agreed you will try to address this problem on your side first. Please reopen if needed.