Commit 1e16c528 authored by Juha Manninen's avatar Juha Manninen
Browse files

Codetools: Add dotted unit names to uses section correctly. Optimize. Issue #32247.

git-svn-id: trunk@56028 -
parent cf2c1e8b
......@@ -1443,7 +1443,7 @@ begin
fNewMainUsesSectionUnits:=TAVLTree.Create(TListSortCompare(@CompareDottedIdentifiers));
//DebugLn(['TCodeCompletionCodeTool.AddNeededUnitToMainUsesSection AnUnitName="',AnUnitName,'"']);
if fNewMainUsesSectionUnits.Find(AnUnitName)<>nil then exit;
s:=GetIdentifier(AnUnitName);
s:=StrPas(AnUnitName);
fNewMainUsesSectionUnits.Add(Pointer(s));
Pointer(s):=nil;
end;
......@@ -8245,6 +8245,7 @@ begin
ReadNextAtom; // read name
if AtomIsChar(';') then break;
RemoveNewMainUsesSectionUnit(@Src[CurPos.StartPos]);
if fNewMainUsesSectionUnits.Count=0 then exit;
ReadNextAtom;
if UpAtomIs('IN') then begin
ReadNextAtom;
......@@ -8257,9 +8258,7 @@ begin
end;
if AtomIsChar(';') then break;
if not AtomIsChar(',') then break;
until (CurPos.StartPos>SrcLen);;
if (fNewMainUsesSectionUnits.Count=0) then exit;
until (CurPos.StartPos>SrcLen);
end;
// add units
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment