Page 1 of 1

SQL folding question

Posted: 02 May 2019 09:04
by akari
Hi,
I'm trying to add some logic to SQL syntax for oracle SQL.
I wish to fold the if else statement.

if
xx;
elsif
xx;
elsif
xx;
else
xx;
end if;

I try to write the fold syntax like:
1_Id=if
1_Begin=if
1_End=end if;
1_EndBefore=elsif
2_Id=elsif
2_Begin=elsif
2_End=elsif
2_EndBefore=elsif

it only can fold those if to elsif and elsif to elsif:

I try to refer the php one.
1_EndBefore=} elseif|} else
but seem like is not working.

by the way, i notice php syntax cant fold else statement, if the else statement the same line with the close bracket.

Re: SQL folding question

Posted: 03 May 2019 13:19
by Rickard Johansson
Does this work better?

Code: Select all

1_Id=if
1_Begin=
1_End=end if
1_EndBefore=elseif|else
1_Section=
1_NoParentOfId=0
1_NotAlwaysEnded=0
1_ListItem=
2_Id=elseif
2_Begin=
2_End=end if
2_EndBefore=elseif|else
2_Section=
2_NoParentOfId=0
2_NotAlwaysEnded=0
2_ListItem=
3_Id=else
3_Begin=
3_End=end if
3_EndBefore=
3_Section=
3_NoParentOfId=0
3_NotAlwaysEnded=0
3_ListItem=

Re: SQL folding question

Posted: 09 Jul 2019 02:13
by akari
sorry that time I was busy and forget this case,
After I test still the same.
result
result
result.png (4.01 KiB) Viewed 3761 times
It is correct I put under the last line in the syx file?
sql syx file
sql syx file
syx file.png (37.53 KiB) Viewed 3761 times

Re: SQL folding question

Posted: 13 Jul 2019 14:54
by Rickard Johansson
Try this instead:

Code: Select all

[Fold]
1_Id=if
1_Begin=
1_End=end if
1_EndBefore=\in|elsif|else
1_Section=
1_NoParentOfId=0
1_NotAlwaysEnded=0
1_ListItem=
2_Id=elsif
2_Begin=
2_End=end if
2_EndBefore=\in|elsif|else
2_Section=
2_NoParentOfId=0
2_NotAlwaysEnded=0
2_ListItem=
3_Id=else
3_Begin=
3_End=end if
3_EndBefore=\in
3_Section=
3_NoParentOfId=0
3_NotAlwaysEnded=0
3_ListItem=