diff --git a/components/codetools/finddeclarationtool.pas b/components/codetools/finddeclarationtool.pas index f36ea790fb..12bbd9937e 100644 --- a/components/codetools/finddeclarationtool.pas +++ b/components/codetools/finddeclarationtool.pas @@ -3233,6 +3233,9 @@ var will be searched: with ContextNode, StartContextNode do ; } + end else if ContextNode.Desc=ctnOnBlock then begin + // the ctnOnIdentifier is only valid within the ctnOnStatement + // => skip end else begin break; end;