sql-formatter-org / sql-formatter

A whitespace formatter for different query languages
https://sql-formatter-org.github.io/sql-formatter/
MIT License
2.23k stars 392 forks source link

[VS Code] Support for oracle_sql language files #728

Open FilipeMestreLS opened 3 months ago

FilipeMestreLS commented 3 months ago

Currently the VS Code extension only works with "sql" language files and i'd appreciate if it could also work with "oracle_sql" language files, the default for PL/SQL. Is this possible?

nene commented 3 months ago

I'm not fully sure I understand this issue. What makes these PL/SQL files not classified as SQL files?

Could you please describe how one could reproduce the problem you're having in VSCode.

I'm not really well-versed in VSCode extension development. I am the one maintaining this extension, as there isn't anybody else to do it though. Plus I don't have any experience with Oracle.

FilipeMestreLS commented 3 months ago

I've been using the "Oracle SQL Developer Extension for VSCode" available in the extension store and it creates a new language in VS Code called "oracle_sql".

image

So by installing this extension and switching the language mode from "sql" to "oracle_sql", this formatter stops working as its not programmed to work with this language.

If i try to force it in the settings to use this formatter as default, by adding this setting in VS Code user settings.json: "[oracle_sql]": { "editor.defaultFormatter": "ReneSaarsoo.sql-formatter-vsc" }

I get the following error: image

I'm not very knowledgeable about VS Code extensions but my guess is that it is not configured to work with files in the "oracle_sql" VS Code language, just "sql".

nene commented 3 months ago

Thanks for the clarification. There's more of a hope now that I'll manage to do something about it.