mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-16 07:22:54 +02:00
codetools: find declaration of selfunit.identifier
git-svn-id: trunk@19795 -
This commit is contained in:
parent
8941c1159c
commit
fd88c3a5bd
@ -26,7 +26,7 @@
|
|||||||
<PackageName Value="CodeTools"/>
|
<PackageName Value="CodeTools"/>
|
||||||
</Item1>
|
</Item1>
|
||||||
</RequiredPackages>
|
</RequiredPackages>
|
||||||
<Units Count="2">
|
<Units Count="3">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="finddeclaration.lpr"/>
|
<Filename Value="finddeclaration.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
@ -37,6 +37,11 @@
|
|||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="SimpleUnit1"/>
|
<UnitName Value="SimpleUnit1"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
|
<Unit2>
|
||||||
|
<Filename Value="scanexamples/overloadedfunction.pas"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="OverloadedFunction"/>
|
||||||
|
</Unit2>
|
||||||
</Units>
|
</Units>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
|
@ -93,8 +93,9 @@ begin
|
|||||||
X:=5;
|
X:=5;
|
||||||
Y:=43;
|
Y:=43;
|
||||||
|
|
||||||
writeln('FPCSrcDir=',Options.FPCSrcDir);
|
writeln('FPCDIR=',Options.FPCSrcDir);
|
||||||
writeln('PP=',Options.FPCPath);
|
writeln('PP=',Options.FPCPath);
|
||||||
|
writeln('LAZARUSDIR=',Options.LazarusSrcDir);
|
||||||
writeln('TARGET=',Options.TargetOS);
|
writeln('TARGET=',Options.TargetOS);
|
||||||
writeln('TARGETCPU=',Options.TargetProcessor);
|
writeln('TARGETCPU=',Options.TargetProcessor);
|
||||||
if (ParamCount>=3) then begin
|
if (ParamCount>=3) then begin
|
||||||
|
@ -5927,6 +5927,7 @@ var
|
|||||||
Params.Flags:=Params.Flags+[fdfSearchInParentNodes,fdfIgnoreCurContextNode];
|
Params.Flags:=Params.Flags+[fdfSearchInParentNodes,fdfIgnoreCurContextNode];
|
||||||
end else begin
|
end else begin
|
||||||
// only search in special context
|
// only search in special context
|
||||||
|
Params.Flags:=Params.Flags+[fdfIgnoreUsedUnits];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// check identifier for overloaded procs
|
// check identifier for overloaded procs
|
||||||
@ -5941,7 +5942,7 @@ var
|
|||||||
// search ...
|
// search ...
|
||||||
Params.SetIdentifier(Self,@Src[CurAtom.StartPos],@CheckSrcIdentifier);
|
Params.SetIdentifier(Self,@Src[CurAtom.StartPos],@CheckSrcIdentifier);
|
||||||
{$IFDEF ShowExprEval}
|
{$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}
|
{$ENDIF}
|
||||||
if ExprType.Context.Tool.FindIdentifierInContext(Params) then begin
|
if ExprType.Context.Tool.FindIdentifierInContext(Params) then begin
|
||||||
if not Params.NewCodeTool.NodeIsConstructor(Params.NewNode) then begin
|
if not Params.NewCodeTool.NodeIsConstructor(Params.NewNode) then begin
|
||||||
@ -5979,9 +5980,10 @@ var
|
|||||||
end;
|
end;
|
||||||
if (ExprType.Context.Node.Desc in AllUsableSourceTypes) then begin
|
if (ExprType.Context.Node.Desc in AllUsableSourceTypes) then begin
|
||||||
// identifier in front of the point is a unit name
|
// identifier in front of the point is a unit name
|
||||||
if ExprType.Context.Tool<>Self then begin
|
{$IFDEF ShowExprEval}
|
||||||
ExprType.Context.Node:=ExprType.Context.Tool.GetInterfaceNode;
|
debugln(['ResolvePoint unit -> interface node']);
|
||||||
end;
|
{$ENDIF}
|
||||||
|
ExprType.Context.Node:=ExprType.Context.Tool.GetInterfaceNode;
|
||||||
end
|
end
|
||||||
else if (ExprType.Context.Node.Desc=ctnClassOfType) then begin
|
else if (ExprType.Context.Node.Desc=ctnClassOfType) then begin
|
||||||
// 'class of' plus '.' => jump to the class
|
// 'class of' plus '.' => jump to the class
|
||||||
|
Loading…
Reference in New Issue
Block a user