博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

PLSQL-Developer beautifier

Posted on 2011-08-31 14:58  Snapping  阅读(1648)  评论(0编辑  收藏  举报

·          In PLSQL-Developer, Tools (menu)-Preferences (item)-User Interface(Section)-Editor(Item)-Syntax Highlighting (section) - Enable (chekced); Keywords (Bold - checked); Keyword Case (Uppercase - selected). Although it is not perfect, I have attached the Beautifier rules that I use to format the code and then clean it up a bit more from there to conform to standards. You can load it by clicking the Edit button in that item and then Load. For example, if there are more than two arguments, they should be on the next line and indented 2 spaces after the PROCEDURE name with the IS on its own line.

 

      The beautifier rule file is like the following. Save it to aa.br. Load aa.br as the PL/SQL Beautifier.

 

      Version=1
RightMargin=120
Indent=2
UseTabCharacter=FALSE
TabCharacterSize=6
AlignDeclarationGroups=TRUE
AlignAssignmentGroups=TRUE
KeywordCase=1
IdentifierCase=2
UseSpecialCase=TRUE
ItemList.Format=1
ItemList.Align=TRUE
ItemList.CommaAfter=TRUE
ItemList.AtLeftMargin=FALSE
EmptyLines=1
ThenOnNewLine=FALSE
LoopOnNewLine=FALSE
DML.LeftAlignKeywords=TRUE
DML.LeftAlignItems=FALSE
DML.OnOneLineIfPossible=FALSE
DML.WhereSplitAndOr=TRUE
DML.WhereAndOrAfterExpression=FALSE
DML.WhereAndOrUnderWhere=FALSE
DML.InsertItemList.Format=2
DML.InsertItemList.Align=FALSE
DML.InsertItemList.CommaAfter=TRUE
DML.InsertItemList.AtLeftMargin=FALSE
DML.SelectItemList.Format=1
DML.SelectItemList.Align=TRUE
DML.SelectItemList.CommaAfter=TRUE
DML.SelectItemList.AtLeftMargin=FALSE
DML.UpdateItemList.Format=1
DML.UpdateItemList.Align=TRUE
DML.UpdateItemList.CommaAfter=TRUE
DML.UpdateItemList.AtLeftMargin=FALSE
ParameterDeclarationList.Format=1
ParameterDeclarationList.Align=FALSE
ParameterDeclarationList.CommaAfter=TRUE
ParameterDeclarationList.AtLeftMargin=FALSE
RecordFieldList.Format=1
RecordFieldList.Align=TRUE
RecordFieldList.CommaAfter=TRUE
RecordFieldList.AtLeftMargin=FALSE
SplitAndOr=TRUE
AndOrAfterExpression=FALSE
[SpecialCase]