mickeypearce / vscode-oracle-format Goto Github PK
View Code? Open in Web Editor NEWPL/SQL formatter (using SQLcl)
Home Page: https://marketplace.visualstudio.com/items?itemName=mp.vscode-oracle-format
PL/SQL formatter (using SQLcl)
Home Page: https://marketplace.visualstudio.com/items?itemName=mp.vscode-oracle-format
I'm unable to get this to work. When I hit format, VSCode Developer Tools only prints following and nothing happens:
[Extension Host] SQLcl: Release 18.2 Production on Mon Sep 10 17:03:18 2018
Copyright (c) 1982, 2018, Oracle. All rights reserved.
Formatter rules loaded
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:
SQLcl 18.2
VSCode 1.27.1
NodeJS 8.9.3
Linux 64bit
Thanks for a great idea!
I've added following to my settings.json file:
......
45 {
46 "oracle-format.sqlcl": "/usr/local/software/sqlcl/bin/sql",
47 "oracle-format.rules": "/usr/local/software/config/sql-formatter.xml"
48 }
vscode reports issue with settings.json file:
[jsonc] Property expected (45,5)
Do I have the entries correct. Looks like invalid json and I should have something like:
"propertyname" : {
"oracle-format.sqlcl": "/usr/local/software/sqlcl/bin/sql",
"oracle-format.rules": "/Users/jrarnold/config/sql-formatter.xml"
}
Command failed: "sql" /nolog @c:\Users\user.DLInternal\AppData\Roaming\Code\User\workspaceStorage\c3e16703c375dd2409f4f36c6fcfcd3c\mp.vscode-oracle-format\format.sql
Der Befehl ""sql"" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
"The path to the icon of at least 128x128 pixels (256x256 for Retina screens)." from https://code.visualstudio.com/api/references/extension-manifest
After using the formatter for a couple of times, it started to return parse error for every SQL script( even those successes before so it cannot be malformed SQL issue). My guess is it might have something to do with oracle sqlcl connection.
Some info that might help:
VS Code version: 1.44.2
Oracle sqlcl version: 19.4.0
OS version: macOS Mojave 10.14.6
Hello,
I have sqlcl included in SQL Developer.
I exported my formatting settings using SQL Developer to an .xml file.
However, when I format the plsql/sql file in VSCode, it formats to a default formatting.
How can I apply my custom formatting ?
I have also loaded the rules through sqlcl successfully, using FORMAT RULES
Here are my extension settings:
"oracle-format.sqlcl": "C:\\Program Files\\SQL Developer 4.1.5\\sqlcl\\bin\\sql.exe",
"oracle-format.rules": "C:\\Users\\xxxxx\\sql_formatting2.xml"
"oracle-format.languages": ["plsql","oraclesql"]
Any help ?
Edit: I am using SQL Developer 4.1.5 ... It seems very old, so that might be an issue.
Also, the xml file seems to contain all formatting options, how can I select one?
Thank you,
Error en FORMAT FILE c:...\AppData\Roaming\Code - Insiders\User\workspaceStorage\4331308db0be6e6dda746863ef56745d\mp.vscode-oracle-format\format_temp.sql c:\Users...\AppData\Roaming\Code - Insiders\User\workspaceStorage\4331308db0be6e6dda746863ef56745d\mp.vscode-oracle-format\format_temp.sql
Without rules it works:
[Extension Host] (echo format file "\\...\format_temp.sql" "\\...\format_temp.sql") | "C:\sqlcl\bin\sql.exe" /nolog
console.ts:136 [Extension Host]
SQLcl: Release 18.3 Production on Tue Nov 13 13:29:19 2018Copyright (c) 1982, 2018, Oracle. All rights reserved.
With rules it doesn't, text stays unformatted.
[Extension Host] (echo format rules C:\Source\oracle_format\oracle_format.xml & echo format file "\\...\format_temp.sql" "\\...\format_temp.sql") | "C:\sqlcl\bin\sql.exe" /nolog
console.ts:136 [Extension Host]
SQLcl: Release 18.3 Production on Tue Nov 13 13:31:48 2018Copyright (c) 1982, 2018, Oracle. All rights reserved.
Formatter rules loaded
Should it be &&
instead? I'm on Windows.
Hello, I keep on getting this error and I can't format any SQL files.
Command failed: "sql" /nolog @"c:\Users\fernando.vscode\extensions\mp.vscode-oracle-format-0.1.5\format.sql" '"sql"' is not recognized as an internal or external command, operable program or batch file.
Any hints for solving this?
Thanks
Hi,
I have sqlcl installed, but on save nothing happens.
I have set "oracle-format.sqlcl": "/Users/iarsov/Workspace/sqlcl/bin/sql".
On save nothing happens.
On manual format selection I get message "There is no selection formatter for 'sql'-files installed."
Any idea what might be the case?
Everytime I try formatting a document vscode shows me the message input.search is not a function
.
At the "output" tab there's an [object Object]
message
Modifying extensions.js
file I was able to find out the reason and avoid the problem. It appears that the output from the sql call is being returned as an object format instead of a string.
I Made two modifications (modified version at right):
1.
2.
With these two modifications I am no longer having issues and the output is at least readable
chinese character cant display normally if there are chinese comments in sql sourcecode.
I do see the command execute, the active editor script is copied to a temp file, that temp file gets formatted, but the contents never get put back in the editor.
I'm using the latest VSCode and latest version of this extension on Windows 10 Pro.
SQLcl: Release 20.2 Production on Сб окт 31 15:32:26 2020
Copyright (c) 1982, 2020, Oracle. All rights reserved.
SQL> host type test.sql
BEGIN
SELECT
*
FROM
dual;
END;
SQL> FORMAT RULES c:\oracle\format_setting.xml
Formatter rules loaded
SQL> FORMAT file test.sql test6.sql
SQL> host type test6.sql
BEGIN
SELECT
*
FROM
dual;
END;
No changes after formatting.
Formatting happens but not according to my rules.
It looks like the loaded rules don't affect the result.
But if you do formatting via the buffer without changing the formatting rules ...
SQL> get test.sql
1 BEGIN
2 SELECT
3 *
4 FROM
5 dual;
6* END
SQL> FORMAT buffer
1 BEGIN
2 SELECT
3 *
4 FROM
5 dual;
6* END;
В этом случае похоже правила сработали.
When I ask vscode to format the document it asks for the formatter.
In then developer tools I got this error:
extensionService.ts:800 Activating extension 'mp.vscode-oracle-format' failed: Cannot read property '0' of undefined.
_logMessageInConsole @ extensionService.ts:800
log.ts:173 ERR An unknown error occurred. Please consult the log for more details.
I have everything in stalled, but for some reason when I try to format anything it gives me this error:
Error On FORMAT FILE
/Users/treverchambersewing/.vscode/extensions/mp.vscode-oracle-format-0.1.5/format_temp.sql /Users/treverchambersewing/.vscode/extensions/mp.vscode-oracle-format-0.1.5/format_temp.sql
I checked and it looks like its there, and formatted. Permissions look okay, too.
Any ideas? I'm running macOS.
Command failed: (echo format file c:\Sviluppi\SVILDIS\src\PACKAGE_BODIES\CARICA_CURVE.sql c:\Sviluppi\SVILDIS\src\PACKAGE_BODIES\CARICA_CURVE.sql) | "sql" /nolog
""sql"" it is not recognized as an internal or external command,
an executable program or a batch file.
I request that the extension be made to work for unsaved documents. This could presumably be implemented by detecting if there are unsaved changes, and if so, copying the contents to a temporary file, having SQLcl do its thing on the temp file, then copying the formatted contents back to the document.
Hello,
environment :
OS : windows 10 Enterprise Evaluation
Vscode : 1.71.0
Oracle Developer Tools for VS Code (SQL and PLSQL) : 21.4.0
DB : OracleXE213_Win64
sqldeveloper : 22.2.0.173.2018-x64
Command failed: "sql" /nolog @"c:\Users\IEUser\AppData\Roaming\Code\User\workspaceStorage\2318c15f75b900dc72d610d822f0247a\mp.vscode-oracle-format\format.sql"
Error: Could not find or load main class oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli
Regards,
dbaid
accent mark not support, spanish language.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.