eclipse-che4z / che-che4z-lsp-for-cobol

COBOL Language Support provides autocomplete, highlighting and diagnostics for COBOL code and copybooks
Other
83 stars 58 forks source link

A setting to disable removal of the trailing spaces after document formatting #1623

Closed roman-kupriyanov closed 5 months ago

roman-kupriyanov commented 2 years ago

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:

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.

VitGottwald commented 2 years ago

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
    },
zimlu02 commented 5 months ago

Hi Roman, as agreed you will try to address this problem on your side first. Please reopen if needed.