From fd88c3a5bd088b58002a1785a2fbf9a56f63ebed Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 4 May 2009 10:10:07 +0000 Subject: [PATCH] codetools: find declaration of selfunit.identifier git-svn-id: trunk@19795 - --- components/codetools/examples/finddeclaration.lpi | 7 ++++++- components/codetools/examples/finddeclaration.lpr | 3 ++- components/codetools/finddeclarationtool.pas | 10 ++++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/components/codetools/examples/finddeclaration.lpi b/components/codetools/examples/finddeclaration.lpi index c298f7e10e..2008fded09 100644 --- a/components/codetools/examples/finddeclaration.lpi +++ b/components/codetools/examples/finddeclaration.lpi @@ -26,7 +26,7 @@ - + @@ -37,6 +37,11 @@ + + + + + diff --git a/components/codetools/examples/finddeclaration.lpr b/components/codetools/examples/finddeclaration.lpr index c14b4e3a36..cd12ea2cf9 100644 --- a/components/codetools/examples/finddeclaration.lpr +++ b/components/codetools/examples/finddeclaration.lpr @@ -93,8 +93,9 @@ begin X:=5; Y:=43; - writeln('FPCSrcDir=',Options.FPCSrcDir); + writeln('FPCDIR=',Options.FPCSrcDir); writeln('PP=',Options.FPCPath); + writeln('LAZARUSDIR=',Options.LazarusSrcDir); writeln('TARGET=',Options.TargetOS); writeln('TARGETCPU=',Options.TargetProcessor); if (ParamCount>=3) then begin diff --git a/components/codetools/finddeclarationtool.pas b/components/codetools/finddeclarationtool.pas index a4e4281b03..2550db613b 100644 --- a/components/codetools/finddeclarationtool.pas +++ b/components/codetools/finddeclarationtool.pas @@ -5927,6 +5927,7 @@ var Params.Flags:=Params.Flags+[fdfSearchInParentNodes,fdfIgnoreCurContextNode]; end else begin // only search in special context + Params.Flags:=Params.Flags+[fdfIgnoreUsedUnits]; end; // check identifier for overloaded procs @@ -5941,7 +5942,7 @@ var // search ... Params.SetIdentifier(Self,@Src[CurAtom.StartPos],@CheckSrcIdentifier); {$IFDEF ShowExprEval} - DebugLn(' ResolveIdentifier Ident="',GetIdentifier(Params.Identifier),'" ',Params.ContextNode.DescAsString,' ',dbgstr(copy(ExprType.Context.Tool.Src,Params.ContextNode.StartPos,15))); + DebugLn(' ResolveIdentifier Ident="',GetIdentifier(Params.Identifier),'" ContextNode=',Params.ContextNode.DescAsString,' ',dbgstr(copy(ExprType.Context.Tool.Src,Params.ContextNode.StartPos,15))); {$ENDIF} if ExprType.Context.Tool.FindIdentifierInContext(Params) then begin if not Params.NewCodeTool.NodeIsConstructor(Params.NewNode) then begin @@ -5979,9 +5980,10 @@ var end; if (ExprType.Context.Node.Desc in AllUsableSourceTypes) then begin // identifier in front of the point is a unit name - if ExprType.Context.Tool<>Self then begin - ExprType.Context.Node:=ExprType.Context.Tool.GetInterfaceNode; - end; + {$IFDEF ShowExprEval} + debugln(['ResolvePoint unit -> interface node']); + {$ENDIF} + ExprType.Context.Node:=ExprType.Context.Tool.GetInterfaceNode; end else if (ExprType.Context.Node.Desc=ctnClassOfType) then begin // 'class of' plus '.' => jump to the class