From 6ae9bebcfeddc7dc88e8b91857229606097f9bfe Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 2 Apr 2020 11:22:10 +0000 Subject: [PATCH] Codetools: Support Codecompletion inside "with begin end" block. May fix other cases, too. Issue #0023782 git-svn-id: branches/fixes_2_0@62854 - --- components/codetools/finddeclarationtool.pas | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/codetools/finddeclarationtool.pas b/components/codetools/finddeclarationtool.pas index e16fe6e3b3..ad38831077 100644 --- a/components/codetools/finddeclarationtool.pas +++ b/components/codetools/finddeclarationtool.pas @@ -7499,6 +7499,7 @@ function TFindDeclarationTool.FindAncestorOfClassInheritance( var InheritanceNode: TCodeTreeNode; ClassNode: TCodeTreeNode; + SpecializeNode : TCodeTreeNode; AncestorContext: TFindContext; AncestorStartPos: LongInt; ExprType: TExpressionType; @@ -7578,9 +7579,14 @@ begin if (AncestorContext.Node.Desc in [ctnTypeDefinition,ctnGenericType]) then begin Params:=TFindDeclarationParams.Create; + if IdentifierNode.Desc=ctnSpecialize then begin + SpecializeNode:=IdentifierNode; + Params.SetGenericParamValues(Self, SpecializeNode); + end; try Params.Flags:=fdfDefaultForExpressions+[fdfFindChildren]; AncestorContext:=AncestorContext.Tool.FindBaseTypeOfNode(Params,AncestorContext.Node); + ResultParams.GenParams:=Params.GenParams; finally Params.Free; end;