From d02846cc88fc720f58e0bc99501cdaf3273702cc Mon Sep 17 00:00:00 2001 From: lazarus Date: Thu, 18 Apr 2002 07:53:08 +0000 Subject: [PATCH] MG: fixed find declaration of forward def class git-svn-id: trunk@1617 - --- components/codetools/finddeclarationtool.pas | 36 ++++- components/codetools/keywordfunclists.pas | 2 - lcl/stdctrls.pp | 131 ++++++++++--------- 3 files changed, 99 insertions(+), 70 deletions(-) diff --git a/components/codetools/finddeclarationtool.pas b/components/codetools/finddeclarationtool.pas index 342e7826a5..1ba374cab7 100644 --- a/components/codetools/finddeclarationtool.pas +++ b/components/codetools/finddeclarationtool.pas @@ -570,10 +570,25 @@ function TFindDeclarationTool.FindDeclaration(CursorPos: TCodeXYPosition; var CleanCursorPos: integer; CursorNode, ClassNode: TCodeTreeNode; Params: TFindDeclarationParams; - DirectSearch: boolean; + DirectSearch, SkipChecks, SearchForward: boolean; + + procedure CheckIfCursorOnAForwardDefinedClass; + begin + if SkipChecks then exit; + if CursorNode.Desc=ctnTypeDefinition then begin + if (CursorNode.FirstChild<>nil) and (CursorNode.FirstChild.Desc=ctnClass) + and ((CursorNode.FirstChild.SubDesc and ctnsForwardDeclaration)>0) then + begin + DirectSearch:=true; + SearchForward:=true; + SkipChecks:=true; + end; + end; + end; procedure CheckIfCursorInClassNode; begin + if SkipChecks then exit; ClassNode:=CursorNode.GetNodeOfType(ctnClass); if ClassNode<>nil then begin // cursor is in class/object definition @@ -585,6 +600,7 @@ var CleanCursorPos: integer; and (CleanCursorPos ignore proc name and search overloaded identifier DirectSearch:=true; + SkipChecks:=true; end; end; if CursorNode.Desc=ctnProcedureHead then @@ -633,17 +652,21 @@ var CleanCursorPos: integer; procedure CheckIfCursorInPropertyNode; begin + if SkipChecks then exit; if CursorNode.Desc=ctnProperty then begin MoveCursorToNodeStart(CursorNode); ReadNextAtom; // read 'property' ReadNextAtom; // read property name - if CleanCursorPos