Format options suggestions

Provides intelligent code completion for SQL Server editors.

Moderators: David Atkinson, Anu Deshpande, Luke Jefferson, Paul Stephenson

Format options suggestions

Postby cussuol » Thu Oct 28, 2010 10:26 pm

Hello friends,
I'd like to have my case commands formated like this:

Code: Select all
SELECT
  CASE
    WHEN 1 = 1 THEN 'A'
    WHEN 1 = 2 THEN 'B'
    ELSE 'C'
  END


So, i think the better way to get this, and a lot of another formating options is to creating word lists like these:
- List of works to break the line before
- List of works to break the line after
- List of works to indent the block before
- List of works to indent the block after
- List of works to unindent the block before
- List of works to unindent the block after
.......
cussuol
 
Posts: 10
Joined: Thu Aug 25, 2005 2:48 pm

What about the 2nd THEN?

Postby jermy » Thu Nov 11, 2010 4:38 pm

I like your idea, but it can't related to a list of words, without their context.
What I mean is that for example if you define "CASE" and "WHEN" in the
"List of works to indent the block before"
and "END" in the
"List of works to unindent the block before"
and all above + "ELSE" in the
"List of works to break the line before"
you will get the following code:
Code: Select all
SELECT
   CASE
      WHEN 1 = 1 THEN 'A'
         WHEN 1 = 2 THEN 'B'
         ELSE 'C'
      END

Because the 2nd "WHEN" don't need to be indented only the first.
So maybe it should have kind of templates for block statements with macro for indent one tab/indent to list/unindent/break line/etc. like snippets.

BTW, you wrote
"List of works..."
instead of
"List of words..."

THNX
Jermy
jermy
 
Posts: 9
Joined: Tue Mar 16, 2010 7:56 pm


Return to SQL Prompt 5 EAP

Who is online

Users browsing this forum: No registered users and 1 guest