SublimeFormatSQL icon indicating copy to clipboard operation
SublimeFormatSQL copied to clipboard

selection 》 Format 》Format SQL Statement is disabled?

Open kntao opened this issue 11 years ago • 18 comments

on windows platform, why ”Format SQL Statement“ button is disabled?

kntao avatar Jan 02 '14 06:01 kntao

Same for Mac OS X 10.9.1, Sublime Text 2.

grantmcconnaughey avatar Jan 08 '14 19:01 grantmcconnaughey

Windows 7, Sublime 2.0.2, same thing

bsiamionau avatar Jan 11 '14 09:01 bsiamionau

Same for Mac OS X 10.9.1, ST3

jonwhittlestone avatar Jan 28 '14 10:01 jonwhittlestone

Got same the same issue on Win 7, Sublime Text 2, v 2.0.2, Build: 2221

DBD80 avatar Feb 12 '14 15:02 DBD80

In case anyone is interested, I created a fork that works with Sublime 2: https://github.com/bani/SublimeFormatSQL If you are using the package manager you can add this repository.

bani avatar Feb 12 '14 15:02 bani

Me too, Mac OSX 10.9.1 / ST2.0.2 but bani's repository is worked! thanks bani.

iies avatar Feb 19 '14 07:02 iies

How do you install Bani's version using the package manager?

adworacz avatar Mar 27 '14 21:03 adworacz

@bani Your fork works perfect in ST2! When will ST3 be supported?

@adworacz This is explained on the Package Control website: https://sublime.wbond.net/docs/usage

osscca avatar Apr 27 '14 20:04 osscca

@osscca Apparently supporting both versions is tricky. I don't use ST3, so it's not in my plans. The last work done for ST3 support seems to be https://github.com/freewizard/SublimeFormatSQL/pull/12 by @kgantsov

bani avatar Apr 27 '14 21:04 bani

Thanks @bani. I've done some additional testing and apparently this version works correct in ST3 on Windows, but not on OS X.

osscca avatar Apr 29 '14 09:04 osscca

Got same the same issue on OS X Maviercks, Sublime Text 2, v 2.0.2, Build: 2221

rstackhouse avatar May 07 '14 13:05 rstackhouse

mac os 10.9.3 sublime 3 Traceback (most recent call last): File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 73, in reload_plugin m = importlib.import_module(modulename) File "X/importlib/init.py", line 88, in import_module File "", line 1577, in _gcd_import File "", line 1558, in _find_and_load File "", line 1525, in _find_and_load_unlocked File "", line 586, in _check_name_wrapper File "", line 1023, in load_module File "", line 1004, in load_module File "", line 562, in module_for_loader_wrapper File "", line 869, in _load_module File "", line 313, in _call_with_frames_removed File "/Users/Travel/Library/Application Support/Sublime Text 3/Packages/SublimeFormatSQL/FormatSQL.py", line 6, in from .sqlparse import format File "/Users/Travel/Library/Application Support/Sublime Text 3/Packages/SublimeFormatSQL/sqlparse/init.py", line 13, in from sqlparse import engine ImportError: No module named 'sqlparse' plugins loaded

travelliu avatar Jun 04 '14 09:06 travelliu

Read the README for this project. It specifically says to have the python sqlparse library installed. This will fix your issue.

adworacz avatar Jun 04 '14 16:06 adworacz

Don't even worry and switch to SQLBeautifier. Works for ST2/3 and doesn't force you to install python. Cheers ;)

dialex avatar Jul 19 '14 11:07 dialex

@dialex The docs disagree with you.

This is a SQL formatter plugin using python-sqlparse for both Sublime 2 and 3.

I have had much better luck with SQLBeautifier though. sqlparse is just a pip install python away though.

rstackhouse avatar Jul 24 '14 01:07 rstackhouse

@bani thank you very much!

taeseong avatar Oct 06 '14 08:10 taeseong

@bani seems to crash on ST2 .. if i press Command+S twice on a selection.

manyata avatar Jan 16 '15 08:01 manyata

Thanks @bani plugging work very well.

icalderond avatar Feb 22 '16 16:02 icalderond