mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 10:39:18 +02:00
codetools: find unused units: add support for class helpers. (e.g. in "Unused units" dialog.)
git-svn-id: trunk@52411 -
This commit is contained in:
parent
ba927319a4
commit
eda5b1fdca
@ -1782,6 +1782,21 @@ var
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function FindProceduresInHelper(Node: TCodeTreeNode): boolean;
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
Node := Node.FirstChild;
|
||||||
|
while (Node<>nil) and (Node.Desc <> ctnEndPoint) do
|
||||||
|
begin
|
||||||
|
if (Node.Desc = ctnProcedure) and (Node.FirstChild<>nil) then
|
||||||
|
begin
|
||||||
|
if IsIdentifierUsed(Node.FirstChild.StartPos) then
|
||||||
|
Exit(True);
|
||||||
|
end;
|
||||||
|
Node:=Node.Next;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
Node: TCodeTreeNode;
|
Node: TCodeTreeNode;
|
||||||
begin
|
begin
|
||||||
@ -1789,6 +1804,8 @@ var
|
|||||||
Node:=IntfNode.FirstChild;
|
Node:=IntfNode.FirstChild;
|
||||||
while Node<>nil do begin
|
while Node<>nil do begin
|
||||||
case Node.Desc of
|
case Node.Desc of
|
||||||
|
ctnTypeHelper, ctnRecordHelper, ctnClassHelper:
|
||||||
|
if FindProceduresInHelper(Node) then exit;
|
||||||
ctnEnumIdentifier:
|
ctnEnumIdentifier:
|
||||||
if IsIdentifierUsed(Node.StartPos) then exit;
|
if IsIdentifierUsed(Node.StartPos) then exit;
|
||||||
ctnVarDefinition,ctnConstDefinition,ctnTypeDefinition,ctnGenericName:
|
ctnVarDefinition,ctnConstDefinition,ctnTypeDefinition,ctnGenericName:
|
||||||
|
Loading…
Reference in New Issue
Block a user