mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 04:02:11 +02:00
codetools: fixed find declaration in uses sections, bug #13146
git-svn-id: trunk@19809 -
This commit is contained in:
parent
677971a20c
commit
b67b6ddaa2
@ -4439,7 +4439,7 @@ begin
|
||||
|
||||
{$IFDEF ShowTriedContexts}
|
||||
DebugLn('[TFindDeclarationTool.FindAncestorOfClass] ',
|
||||
' search ancestor class = ',GetIdentifier(@Src[AncestorStartPos]));
|
||||
' search default ancestor class');
|
||||
{$ENDIF}
|
||||
|
||||
// search ancestor
|
||||
@ -4927,18 +4927,21 @@ var
|
||||
Node: TCodeTreeNode;
|
||||
begin
|
||||
{$IFDEF CheckNodeTool}CheckNodeTool(UsesNode);{$ENDIF}
|
||||
{$IFDEF ShowTriedParentContexts}
|
||||
DebugLn(['TFindDeclarationTool.FindIdentifierInUsesSection ',MainFilename,' fdfIgnoreUsedUnits=',fdfIgnoreUsedUnits in Params.Flags]);
|
||||
{$ENDIF}
|
||||
Result:=false;
|
||||
if (Params.IdentifierTool=Self) then begin
|
||||
Node:=UsesNode.LastChild;
|
||||
while Node<>nil do begin
|
||||
Node:=Node.PriorBrother;
|
||||
if CompareSrcIdentifiers(CurPos.StartPos,Params.Identifier) then begin
|
||||
if CompareSrcIdentifiers(Node.StartPos,Params.Identifier) then begin
|
||||
// the searched identifier was a uses unitname, point to the identifier in
|
||||
// the uses section
|
||||
Result:=true;
|
||||
Params.SetResult(Self,Node,CurPos.StartPos);
|
||||
Params.SetResult(Self,Node,Node.StartPos);
|
||||
exit;
|
||||
end;
|
||||
Node:=Node.PriorBrother;
|
||||
end;
|
||||
end;
|
||||
if not (fdfIgnoreUsedUnits in Params.Flags) then begin
|
||||
@ -4961,6 +4964,9 @@ begin
|
||||
-[fdfExceptionOnNotFound];
|
||||
Result:=NewCodeTool.FindIdentifierInInterface(Self,Params);
|
||||
Params.Flags:=OldFlags;
|
||||
{$IFDEF ShowTriedParentContexts}
|
||||
DebugLn(['TFindDeclarationTool.FindIdentifierInUsesSection ',GetAtom(UnitNameAtom),' Result=',Result,' IsFinal=',Params.IsFinal]);
|
||||
{$ENDIF}
|
||||
if Result and Params.IsFinal then exit;
|
||||
Node:=Node.PriorBrother;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user