Closed Archinowsk closed 5 years ago
Hej @Archinowsk ! What happens if you try with default formatter (remove or comment out rules xml from settings)?
If that works maybe you should downgrade SQLcl to 18.1 as 18.2 has a problem (bug?) with piping several commands: https://community.oracle.com/thread/4164273
The same thing with the default formatter.
Unfortunately it wasn't tested on Linux. 🤔
Could you please try executing from command line (bash?).
(echo format file ${file} ${file}) | sql /nolog
Where ${file} is the path to a file you try to format.
Thanks for your help.
Seems to work. The file test.sql
is formatted.
(echo format file test.sql test2.sql) | sql /nolog
SQLcl: Release 18.2 Production on Tue Sep 11 09:19:32 2018
Copyright (c) 1982, 2018, Oracle. All rights reserved.
Can you please post console ouput from VSCode Developer Tools when you format document with default formater (without "oracle-format.rules" setting).
I was able to get it to work. The issue was an invalid SQL file that I thought was ok. The extension just failed silently. Failure notification could be useful. The extension now works with default rules and custom rules. Sorry for the trouble and thanks!
Developer Tools prints the same with default and custom rules:
[Extension Host] SQLcl: Release 18.2 Production on Wed Sep 12 12:39:44 2018
Copyright (c) 1982, 2018, Oracle. All rights reserved.
Formatter rules loaded
No problem! Unfortunatelly SQLcl doesn't return an error code when loading or formatting fails...
Well, I could search output for parsing error string and raise the error to UI... :thinking:
Sqlcl Output:
Skipped formatting ...\format_temp.sql -- parse error
I'm unable to get this to work. When I hit format, VSCode Developer Tools only prints following and nothing happens:
I tried with the default settings and with the default XML exported from SQL Developer. I'm able to use the formatter with SQLcl.
My specs:
Thanks for a great idea!