mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 02:19:15 +02:00
Merged revision(s) 56015 #04cc3c44b2, 56028 #1e16c52819 from trunk:
Codetools: Do not chomp a procedure name with empty brackets (). Issue #31960. ........ Codetools: Add dotted unit names to uses section correctly. Optimize. Issue #32247. ........ git-svn-id: branches/fixes_1_8@56037 -
This commit is contained in:
parent
34d90a1c0a
commit
a6ebaf4900
@ -1436,7 +1436,7 @@ begin
|
|||||||
fNewMainUsesSectionUnits:=TAVLTree.Create(TListSortCompare(@CompareDottedIdentifiers));
|
fNewMainUsesSectionUnits:=TAVLTree.Create(TListSortCompare(@CompareDottedIdentifiers));
|
||||||
//DebugLn(['TCodeCompletionCodeTool.AddNeededUnitToMainUsesSection AnUnitName="',AnUnitName,'"']);
|
//DebugLn(['TCodeCompletionCodeTool.AddNeededUnitToMainUsesSection AnUnitName="',AnUnitName,'"']);
|
||||||
if fNewMainUsesSectionUnits.Find(AnUnitName)<>nil then exit;
|
if fNewMainUsesSectionUnits.Find(AnUnitName)<>nil then exit;
|
||||||
s:=GetIdentifier(AnUnitName);
|
s:=StrPas(AnUnitName);
|
||||||
fNewMainUsesSectionUnits.Add(Pointer(s));
|
fNewMainUsesSectionUnits.Add(Pointer(s));
|
||||||
Pointer(s):=nil;
|
Pointer(s):=nil;
|
||||||
end;
|
end;
|
||||||
@ -8221,6 +8221,7 @@ begin
|
|||||||
ReadNextAtom; // read name
|
ReadNextAtom; // read name
|
||||||
if AtomIsChar(';') then break;
|
if AtomIsChar(';') then break;
|
||||||
RemoveNewMainUsesSectionUnit(@Src[CurPos.StartPos]);
|
RemoveNewMainUsesSectionUnit(@Src[CurPos.StartPos]);
|
||||||
|
if fNewMainUsesSectionUnits.Count=0 then exit;
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
if UpAtomIs('IN') then begin
|
if UpAtomIs('IN') then begin
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
@ -8233,9 +8234,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
if AtomIsChar(';') then break;
|
if AtomIsChar(';') then break;
|
||||||
if not AtomIsChar(',') then break;
|
if not AtomIsChar(',') then break;
|
||||||
until (CurPos.StartPos>SrcLen);;
|
until (CurPos.StartPos>SrcLen);
|
||||||
|
|
||||||
if (fNewMainUsesSectionUnits.Count=0) then exit;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// add units
|
// add units
|
||||||
|
@ -1402,8 +1402,7 @@ begin
|
|||||||
if (CurPos.Flag in [cafRoundBracketClose,cafEdgedBracketClose])
|
if (CurPos.Flag in [cafRoundBracketClose,cafEdgedBracketClose])
|
||||||
and (Src[CurPos.StartPos] = CloseBracket)
|
and (Src[CurPos.StartPos] = CloseBracket)
|
||||||
then begin
|
then begin
|
||||||
// chomp empty brackets
|
// opening bracket was not streamed, keep ExtractMemStream intact.
|
||||||
ExtractMemStream.Position := ExtractMemStream.Position - 1;
|
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
exit(true);
|
exit(true);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user