diff --git a/components/codetools/finddeclarationtool.pas b/components/codetools/finddeclarationtool.pas index 3adcd65874..3a19132275 100644 --- a/components/codetools/finddeclarationtool.pas +++ b/components/codetools/finddeclarationtool.pas @@ -1504,6 +1504,15 @@ begin else NewNode:=CursorNode; end; + if (CursorNode.Desc=ctnProcedureHead) + and (NodeIsMethodBody(CursorNode.Parent)) then begin + // if this is a procedure body, try to find the corresponding declaration + NewNode:=FindCorrespondingProcNode(CursorNode.Parent); + if (NewNode<>nil) and (NewNode.StartPos