Forum Stats

  • 3,757,144 Users
  • 2,251,201 Discussions
  • 7,869,743 Comments

Discussions

Enhancement Request for SQLDev: Don't format code with parse errors

Philipp Salvisberg
Philipp Salvisberg Member Posts: 145 Silver Badge

The formatter in SQLDev formats the code even if errors are found. The result is sometimes ok and in other cases it is fatal. Granted, you can always press Ctrl-Z to undo the formatting. But to do that, you have to recognize that something has gone wrong. With larger files, you may not see it right away. Undoing the formatting result may not be as easy later.

A case of fatal formatting result is documented here: https://github.com/Trivadis/plsql-formatter-settings/issues/98 (reproducible with default formatter settings).

Why not provide an additional option? Something like "Format code on error? (Yes/No)". You can keep the current default of "Yes". 

There are for sure some developers (like me) who would like to change the default to "No".

adrian.boangiu

Best Answer

  • Vadim Tropashko-Oracle
    Vadim Tropashko-Oracle Posts: 1,239 Employee
    edited Mar 12, 2021 9:46PM Accepted Answer

    I understand that as soon as such option becomes avaliable, you'll set it to a certain value in the Trivadis custom preferences file. Then, it doesn't have to appear as a dedicated checkbox on the sqldev format options page, but you still can manually edit it in the preferences.xml.

    SqlDev can certainly have such a checkbox, but I would prefer to have the options panel to be less cluterred. To the other readers of the thread: if you absolutely want such a checkbox, then please vote (=like) in favor of Philipp's proposal. If you are fine with the formatter as it is, or don't mind editing preferences.xml, or simply don't care, then please vote here.

    Philipp Salvisberg

Answers

  • Vadim Tropashko-Oracle
    Vadim Tropashko-Oracle Posts: 1,239 Employee
    edited Mar 12, 2021 9:46PM Accepted Answer

    I understand that as soon as such option becomes avaliable, you'll set it to a certain value in the Trivadis custom preferences file. Then, it doesn't have to appear as a dedicated checkbox on the sqldev format options page, but you still can manually edit it in the preferences.xml.

    SqlDev can certainly have such a checkbox, but I would prefer to have the options panel to be less cluterred. To the other readers of the thread: if you absolutely want such a checkbox, then please vote (=like) in favor of Philipp's proposal. If you are fine with the formatter as it is, or don't mind editing preferences.xml, or simply don't care, then please vote here.

    Philipp Salvisberg
  • Philipp Salvisberg
    Philipp Salvisberg Member Posts: 145 Silver Badge

    An additional option in the XML preferences is good enough for me. I do not need a checkbox in the UI.

    Vadim Tropashko-Oracle