mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 16:38:02 +02:00
codetools: fixed TFindDeclarationTool.FindUnitReferences search in uses section, bug #38559
git-svn-id: trunk@64704 -
This commit is contained in:
parent
c9b1c44830
commit
341a3f7a74
@ -6759,23 +6759,24 @@ var
|
||||
var
|
||||
ReferencePos: TCodeXYPosition;
|
||||
UnitNamePos, UnitInFilePos: TAtomPosition;
|
||||
UnitNameP: PChar;
|
||||
begin
|
||||
Result:=false;
|
||||
if UsesNode=nil then exit;
|
||||
//DebugLn(['CheckUsesSection ']);
|
||||
//DebugLn(['CheckUsesSection ',UsesNode.DescAsString]);
|
||||
MoveCursorToNodeStart(UsesNode);
|
||||
if (UsesNode.Desc=ctnUsesSection) then begin
|
||||
ReadNextAtom;
|
||||
if not UpAtomIs('USES') then
|
||||
RaiseUsesExpected(20170421200509);
|
||||
end;
|
||||
UnitNameP:=PChar(UpperUnitName);
|
||||
repeat
|
||||
ReadNextAtom; // read name
|
||||
ReadNextUsedUnit(UnitNamePos,UnitInFilePos); // read dotted name + IN file
|
||||
if CurPos.StartPos>SrcLen then break;
|
||||
if AtomIsChar(';') then break;
|
||||
if UpAtomIs(UpperUnitName) then begin // compare case insensitive
|
||||
if CleanPosToCaret(CurPos.StartPos,ReferencePos) then begin
|
||||
if CompareSrcIdentifiers(UnitNamePos.StartPos,UnitNameP) then begin // compare case insensitive
|
||||
if CleanPosToCaret(UnitNamePos.StartPos,ReferencePos) then begin
|
||||
//DebugLn(['CheckUsesSection found in uses section: ',Dbgs(ReferencePos)]);
|
||||
Result:=true;
|
||||
AddCodePosition(ListOfPCodeXYPosition,ReferencePos);
|
||||
|
Loading…
Reference in New Issue
Block a user