mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 04:49:27 +02:00
codetools: added option MethodDefaultSection
git-svn-id: trunk@53166 -
This commit is contained in:
parent
db0e2f90e3
commit
feb1a73e6c
@ -402,7 +402,7 @@ type
|
||||
procedure AddNeededUnitsToMainUsesSectionForRange(
|
||||
StartPos, EndPos: integer; CompletionTool: TCodeCompletionCodeTool);
|
||||
public
|
||||
// Options
|
||||
// Options; ToDo: move to options
|
||||
property SetPropertyVariablename: string read FSetPropertyVariablename
|
||||
write SetSetPropertyVariablename;
|
||||
property SetPropertyVariableIsPrefix: Boolean
|
||||
@ -414,6 +414,7 @@ type
|
||||
property AddInheritedCodeToOverrideMethod: boolean
|
||||
read FAddInheritedCodeToOverrideMethod
|
||||
write FAddInheritedCodeToOverrideMethod;
|
||||
|
||||
property CodeCompleteClassNode: TCodeTreeNode
|
||||
read FCodeCompleteClassNode write SetCodeCompleteClassNode;
|
||||
property CodeCompleteSrcChgCache: TSourceChangeCache
|
||||
@ -1463,7 +1464,7 @@ begin
|
||||
if not ShowCodeCreationDlg(Beauty.BeautifyProc(MethodDefinition, 0, False), True, CCOptions) then
|
||||
Exit;
|
||||
end else
|
||||
CCOptions.ClassSection := icsPublic;
|
||||
CCOptions.ClassSection := Beauty.MethodDefaultSection;
|
||||
|
||||
AddClassInsertion(CleanMethodDefinition, MethodDefinition,
|
||||
AnEventName, InsertClassSectionToNewProcClassPart[CCOptions.ClassSection]);
|
||||
@ -2219,7 +2220,7 @@ begin
|
||||
|
||||
// add published method and method body and right side of assignment
|
||||
if not AddMethodCompatibleToProcType(AClassNode,FullEventName,ProcContext,
|
||||
AMethodDefinition,AMethodAttr,SourceChangeCache, Interactive)
|
||||
AMethodDefinition,AMethodAttr,SourceChangeCache,Interactive)
|
||||
then
|
||||
Exit;
|
||||
if not CompleteAssignment(FullEventName,AssignmentOperator,
|
||||
|
@ -99,6 +99,14 @@ type
|
||||
|
||||
const
|
||||
DefaultUsesInsertPolicy = uipBehindRelated;
|
||||
DefaultMethodDefaultSection = icsPrivate;
|
||||
DefaultDoNotSplitLineInFront: TAtomTypes =
|
||||
[atColon,atComma,atSemicolon,atPoint];
|
||||
DefaultDoNotSplitLineAfter: TAtomTypes = [atColon,atAt,atPoint,atKeyWord];
|
||||
DefaultDoInsertSpaceInFront: TAtomTypes = [];
|
||||
DefaultDoInsertSpaceAfter: TAtomTypes = [atColon,atComma,atSemicolon];
|
||||
DefaultDoNotInsertSpaceInFront: TAtomTypes = [];
|
||||
DefaultDoNotInsertSpaceAfter: TAtomTypes = [atDirectiveStart];
|
||||
|
||||
type
|
||||
TWordPolicyException = class
|
||||
@ -165,7 +173,8 @@ type
|
||||
ClassImplementationComments: boolean;
|
||||
ClassPartInsertPolicy: TClassPartInsertPolicy;
|
||||
MixMethodsAndProperties: boolean;
|
||||
MethodInsertPolicy: TMethodInsertPolicy;
|
||||
MethodInsertPolicy: TMethodInsertPolicy; // method body insert policy
|
||||
MethodDefaultSection: TInsertClassSection;
|
||||
PropertyReadIdentPrefix: string;
|
||||
PropertyWriteIdentPrefix: string;
|
||||
PropertyStoredIdentPostfix: string;
|
||||
@ -363,14 +372,6 @@ const
|
||||
'Alphabetically'
|
||||
);
|
||||
|
||||
DefaultDoNotSplitLineInFront: TAtomTypes =
|
||||
[atColon,atComma,atSemicolon,atPoint];
|
||||
DefaultDoNotSplitLineAfter: TAtomTypes = [atColon,atAt,atPoint,atKeyWord];
|
||||
DefaultDoInsertSpaceInFront: TAtomTypes = [];
|
||||
DefaultDoInsertSpaceAfter: TAtomTypes = [atColon,atComma,atSemicolon];
|
||||
DefaultDoNotInsertSpaceInFront: TAtomTypes = [];
|
||||
DefaultDoNotInsertSpaceAfter: TAtomTypes = [atDirectiveStart];
|
||||
|
||||
function AtomTypeNameToType(const s: string): TAtomType;
|
||||
function AtomTypesToStr(const AtomTypes: TAtomTypes): string;
|
||||
function WordPolicyNameToPolicy(const s: string): TWordPolicy;
|
||||
@ -1296,6 +1297,7 @@ begin
|
||||
UpdateOtherProcSignaturesCase:=true;
|
||||
GroupLocalVariables:=true;
|
||||
MethodInsertPolicy:=mipClassOrder;
|
||||
MethodDefaultSection:=DefaultMethodDefaultSection;
|
||||
ForwardProcBodyInsertPolicy:=fpipBehindMethods;
|
||||
KeepForwardProcOrder:=true;
|
||||
ClassHeaderComments:=true;
|
||||
|
Loading…
Reference in New Issue
Block a user