mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-01 14:20:41 +02:00
codetools: added policy for uses additions
git-svn-id: trunk@19779 -
This commit is contained in:
parent
dfe1e5a3cf
commit
018eab6b38
@ -195,23 +195,23 @@ type
|
||||
read FOnSearchUsedUnit write FOnSearchUsedUnit;
|
||||
|
||||
// initializing single codetools
|
||||
function GetCodeToolForSource(Code: TCodeBuffer;
|
||||
GoToMainCode, ExceptionOnError: boolean): TCustomCodeTool;
|
||||
function FindCodeToolForSource(Code: TCodeBuffer): TCustomCodeTool;
|
||||
property CurCodeTool: TCodeTool read FCurCodeTool;
|
||||
procedure ClearCurCodeTool;
|
||||
function InitCurCodeTool(Code: TCodeBuffer): boolean;
|
||||
function InitResourceTool: boolean;
|
||||
procedure ClearPositions;
|
||||
function GetCodeToolForSource(Code: TCodeBuffer;
|
||||
GoToMainCode, ExceptionOnError: boolean): TCustomCodeTool;
|
||||
|
||||
|
||||
// initializing single compilerdirectivestrees
|
||||
function FindDirectivesToolForSource(Code: TCodeBuffer
|
||||
): TDirectivesTool;
|
||||
function GetDirectivesToolForSource(Code: TCodeBuffer;
|
||||
ExceptionOnError: boolean): TCompilerDirectivesTree;
|
||||
property CurDirectivesTool: TDirectivesTool read FCurDirectivesTool;
|
||||
procedure ClearCurDirectivesTool;
|
||||
function InitCurDirectivesTool(Code: TCodeBuffer): boolean;
|
||||
function GetDirectivesToolForSource(Code: TCodeBuffer;
|
||||
ExceptionOnError: boolean): TCompilerDirectivesTree;
|
||||
function FindDirectivesToolForSource(Code: TCodeBuffer
|
||||
): TDirectivesTool;
|
||||
|
||||
// exception handling
|
||||
procedure ClearError;
|
||||
|
@ -68,6 +68,15 @@ type
|
||||
fpipBehindMethods
|
||||
);
|
||||
|
||||
// where to add new units to a uses section
|
||||
TUsesInsertPolicy = (
|
||||
uipFirst,
|
||||
uipInFrontOfRelated, // related = shortest relative file path (#directory changes)
|
||||
uipBehindRelated,
|
||||
uipLast,
|
||||
uipAlphabetically
|
||||
);
|
||||
|
||||
TWordPolicy = (wpNone, wpLowerCase, wpUpperCase, wpLowerCaseFirstLetterUp);
|
||||
TAtomType = (atNone, atKeyword, atIdentifier, atColon, atSemicolon, atComma,
|
||||
atPoint, atAt, atNumber, atStringConstant, atNewLine,
|
||||
@ -103,12 +112,6 @@ type
|
||||
LineEnd: string; // default: #13#10
|
||||
Indent: integer;
|
||||
TabWidth: integer;
|
||||
ClassPartInsertPolicy: TClassPartInsertPolicy;
|
||||
MixMethodsAndProperties: boolean;
|
||||
MethodInsertPolicy: TMethodInsertPolicy;
|
||||
ForwardProcBodyInsertPolicy: TForwardProcBodyInsertPolicy;
|
||||
KeepForwardProcOrder: boolean;
|
||||
ClassHeaderComments: boolean;
|
||||
KeyWordPolicy: TWordPolicy;
|
||||
IdentifierPolicy: TWordPolicy;
|
||||
DoNotSplitLineInFront: TAtomTypes;
|
||||
@ -117,10 +120,21 @@ type
|
||||
DoInsertSpaceAfter: TAtomTypes;
|
||||
DoNotInsertSpaceInFront: TAtomTypes;
|
||||
DoNotInsertSpaceAfter: TAtomTypes;
|
||||
// procedures
|
||||
ForwardProcBodyInsertPolicy: TForwardProcBodyInsertPolicy;
|
||||
KeepForwardProcOrder: boolean;
|
||||
// classes, methods, properties
|
||||
ClassHeaderComments: boolean;
|
||||
ClassPartInsertPolicy: TClassPartInsertPolicy;
|
||||
MixMethodsAndProperties: boolean;
|
||||
MethodInsertPolicy: TMethodInsertPolicy;
|
||||
PropertyReadIdentPrefix: string;
|
||||
PropertyWriteIdentPrefix: string;
|
||||
PropertyStoredIdentPostfix: string;
|
||||
PrivateVariablePrefix: string;
|
||||
// uses section
|
||||
UsesInsertPolicy: TUsesInsertPolicy;
|
||||
|
||||
CurFlags: TBeautifyCodeFlags;
|
||||
|
||||
NestedComments: boolean;
|
||||
@ -971,6 +985,7 @@ begin
|
||||
PropertyWriteIdentPrefix:='Set';
|
||||
PropertyStoredIdentPostfix:='IsStored';
|
||||
PrivateVariablePrefix:='f';
|
||||
UsesInsertPolicy:=uipInFrontOfRelated;
|
||||
|
||||
NestedComments:=true;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user