Giter VIP home page Giter VIP logo

vscode-oracle-format's People

Contributors

mickeypearce avatar mouradelmain avatar rafael-trevisan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vscode-oracle-format's Issues

Cannot get to work (parsing error)

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!

settings.json config issue

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"
}

I am getting this error

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.

Formatter fail

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

Formatting not applied

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

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

Doesn't work with rules specified

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 2018

Copyright (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 2018

Copyright (c) 1982, 2018, Oracle. All rights reserved.

Formatter rules loaded

Should it be && instead? I'm on Windows.

Command failed

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

Cannot get it to work

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?

input.search is not a function

Everytime I try formatting a document vscode shows me the message input.search is not a function.

image

At the "output" tab there's an [object Object] message

image

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.
image
2.
image

With these two modifications I am no longer having issues and the output is at least readable

image

Format On Save doesn't appear to work

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 command FORMAT FILE not work

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;

В этом случае похоже правила сработали.

Error loading extension

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.

image

image

Error on FORMAT FILE

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 on "format document"

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.

Format unsaved documents

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.

v0.1.5 format document error

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.