du-song / SublimeFormatSQL

Sublime Text 2 command to format long SQL statement to a more readable form (also available via Package Control)
Other
112 stars 42 forks source link

selection 》 Format 》Format SQL Statement is disabled? #16

Open kntao opened 10 years ago

kntao commented 10 years ago

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

grantmcconnaughey commented 10 years ago

Same for Mac OS X 10.9.1, Sublime Text 2.

bsiamionau commented 10 years ago

Windows 7, Sublime 2.0.2, same thing

jonwhittlestone commented 10 years ago

Same for Mac OS X 10.9.1, ST3

DBD80 commented 10 years ago

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

bani commented 10 years ago

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.

iies commented 10 years ago

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

adworacz commented 10 years ago

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

osscca commented 10 years ago

@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

bani commented 10 years ago

@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

osscca commented 10 years ago

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

rstackhouse commented 10 years ago

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

travelliu commented 10 years ago

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

adworacz commented 10 years ago

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

dialex commented 10 years ago

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

rstackhouse commented 10 years ago

@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.

taeseong commented 9 years ago

@bani thank you very much!

manyata commented 9 years ago

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

icalderond commented 8 years ago

Thanks @bani plugging work very well.