Codetools: Fix SmartHint for generic specialized types. Issue #29860.

This commit is contained in:
Juha 2022-12-23 15:24:13 +02:00
parent 425db255bd
commit 5719672f10

View File

@ -3198,11 +3198,16 @@ function TFindDeclarationTool.GetSmartHint(Node: TCodeTreeNode;
function MoveToLastIdentifierThroughDots(ExtTool: TFindDeclarationTool): Boolean; function MoveToLastIdentifierThroughDots(ExtTool: TFindDeclarationTool): Boolean;
var var
LastPos: TAtomPosition; LastPos: TAtomPosition;
HasSpecialize: Boolean;
begin begin
LastPos := ExtTool.CurPos; LastPos := ExtTool.CurPos;
ExtTool.ReadNextAtom; ExtTool.ReadNextAtom;
if ExtTool.CurPos.Flag = cafWord then if ExtTool.CurPos.Flag = cafWord then begin
HasSpecialize := ExtTool.UpAtomIs('SPECIALIZE');
ExtTool.ReadNextAtom; ExtTool.ReadNextAtom;
if HasSpecialize then
LastPos := ExtTool.CurPos; // Type starts after "specialize".
end;
while ExtTool.CurPos.Flag = cafPoint do while ExtTool.CurPos.Flag = cafPoint do
begin begin
ExtTool.ReadNextAtom; ExtTool.ReadNextAtom;