diff --git a/components/codetools/codecompletiontool.pas b/components/codetools/codecompletiontool.pas index 3d5fa688bf..1ff455be68 100644 --- a/components/codetools/codecompletiontool.pas +++ b/components/codetools/codecompletiontool.pas @@ -355,6 +355,13 @@ type out InheritedDeclContext: TFindContext; ProcName: string = '' // default is 'Assign' ): boolean; + function AddAssignMethod(ClassNode: TCodeTreeNode; MemberNodeExts: TFPList; + const ProcName, ParamName, ParamType: string; + OverrideMod, CallInherited, CallInheritedOnlyInElse: boolean; + SourceChanger: TSourceChangeCache; + out NewPos: TCodeXYPosition; out NewTopLine: integer; + LocalVarName: string = '' // default is 'aSource' + ): boolean; function AddAssignMethod(ClassNode: TCodeTreeNode; MemberNodeExts: TFPList; const ProcName, ParamName, ParamType: string; OverrideMod, CallInherited, CallInheritedOnlyInElse: boolean; @@ -6253,6 +6260,19 @@ begin NewPos,NewTopLine, BlockTopLine, BlockBottomLine); end; +function TCodeCompletionCodeTool.AddAssignMethod(ClassNode: TCodeTreeNode; + MemberNodeExts: TFPList; const ProcName, ParamName, ParamType: string; + OverrideMod, CallInherited, CallInheritedOnlyInElse: boolean; + SourceChanger: TSourceChangeCache; out NewPos: TCodeXYPosition; out + NewTopLine: integer; LocalVarName: string): boolean; +var + BlockTopLine, BlockBottomLine: integer; +begin + Result := AddAssignMethod(ClassNode, MemberNodeExts, ProcName, ParamName, ParamType, + OverrideMod, CallInherited, CallInheritedOnlyInElse, SourceChanger, NewPos, NewTopLine, + BlockTopLine, BlockBottomLine, LocalVarName); +end; + function TCodeCompletionCodeTool.GetPossibleInitsForVariable( CursorPos: TCodeXYPosition; out Statements: TStrings; out InsertPositions: TObjectList; SourceChangeCache: TSourceChangeCache): boolean; diff --git a/components/codetools/codetoolmanager.pas b/components/codetools/codetoolmanager.pas index e73ae76b5d..84a9154ca9 100644 --- a/components/codetools/codetoolmanager.pas +++ b/components/codetools/codetoolmanager.pas @@ -473,6 +473,9 @@ type out NewX, NewY, NewTopLine: integer): boolean; function FindSmartHint(Code: TCodeBuffer; X,Y: integer; Flags: TFindSmartFlags = DefaultFindSmartHintFlags): string; + function FindDeclarationInInterface(Code: TCodeBuffer; + const Identifier: string; out NewCode: TCodeBuffer; + out NewX, NewY, NewTopLine: integer): boolean; function FindDeclarationInInterface(Code: TCodeBuffer; const Identifier: string; out NewCode: TCodeBuffer; out NewX, NewY, NewTopLine, BlockTopLine, BlockBottomLine: integer): boolean; @@ -2181,6 +2184,16 @@ begin {$ENDIF} end; +function TCodeToolManager.FindDeclarationInInterface(Code: TCodeBuffer; + const Identifier: string; out NewCode: TCodeBuffer; out NewX, NewY, + NewTopLine: integer): boolean; +var + BlockTopLine, BlockBottomLine: integer; +begin + Result := FindDeclarationInInterface(Code, Identifier, NewCode, NewX, NewY, NewTopLine, + BlockTopLine, BlockBottomLine); +end; + function TCodeToolManager.FindDeclarationWithMainUsesSection(Code: TCodeBuffer; const Identifier: string; out NewCode: TCodeBuffer; out NewX, NewY, NewTopLine: integer): Boolean;