Codetools: Support Codecompletion inside "with begin end" block. May fix other cases, too. Issue #0023782

git-svn-id: branches/fixes_2_0@62854 -
This commit is contained in:
mattias 2020-04-02 11:22:10 +00:00
parent 9f79c56107
commit 6ae9bebcfe

View File

@ -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;