From 5719672f10190551b9af7dd7f1761aae1c280297 Mon Sep 17 00:00:00 2001 From: Juha Date: Fri, 23 Dec 2022 15:24:13 +0200 Subject: [PATCH] Codetools: Fix SmartHint for generic specialized types. Issue #29860. --- components/codetools/finddeclarationtool.pas | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/codetools/finddeclarationtool.pas b/components/codetools/finddeclarationtool.pas index 18580ab0db..e2d281a663 100644 --- a/components/codetools/finddeclarationtool.pas +++ b/components/codetools/finddeclarationtool.pas @@ -3198,11 +3198,16 @@ function TFindDeclarationTool.GetSmartHint(Node: TCodeTreeNode; function MoveToLastIdentifierThroughDots(ExtTool: TFindDeclarationTool): Boolean; var LastPos: TAtomPosition; + HasSpecialize: Boolean; begin LastPos := ExtTool.CurPos; ExtTool.ReadNextAtom; - if ExtTool.CurPos.Flag = cafWord then + if ExtTool.CurPos.Flag = cafWord then begin + HasSpecialize := ExtTool.UpAtomIs('SPECIALIZE'); ExtTool.ReadNextAtom; + if HasSpecialize then + LastPos := ExtTool.CurPos; // Type starts after "specialize". + end; while ExtTool.CurPos.Flag = cafPoint do begin ExtTool.ReadNextAtom;