I have some big messy SQL procedures that I'm debugging, and they tend to have a lot of heavily nested parentheses:
SELECT * FROM (SELECT F1,F2 FROM TABLE1 AS X LEFT JOIN
(SELECT F9,F8 FROM (SELECT F13,F14 FROM TABLE4) AS J INNER JOIN TABLE3 ON...) AS B
ON X.F1=B.F9) AS X1
I'm looking for an editor that can automatically mark and optionally collapse/fold each parentheses set to ease reading, e.g.
SELECT * FROM ... AS X1
SELECT * FROM (SELECT F1,F2 FROM TABLE1 AS X LEFT JOIN ... AS B ON X.F1=B.F9) AS X1
I can do this in Visual Studio by repeatedly hitting ctrl-shift-] to select a set, and then ctrl-mh to collapse it. But some of these things are hundreds of lines long and it would be nice if I had an editor that could mark up the whole document automatically.
Any suggestions?