codetools: identifier completion+events: fixed collecting helpers, patch #28794

git-svn-id: trunk@49982 -
This commit is contained in:
mattias 2015-10-07 22:44:05 +00:00
parent 9c1c655448
commit 7eec3d4b45

View File

@ -4986,7 +4986,7 @@ procedure TFindDeclarationTool.FindHelpersInContext(
var var
Node: TCodeTreeNode; Node: TCodeTreeNode;
begin begin
Node:=Params.StartNode; Node:=Params.ContextNode;
Params.FNeedHelpers:=false; Params.FNeedHelpers:=false;
while Node<>nil do while Node<>nil do
begin begin
@ -12193,9 +12193,16 @@ end;
function TFindDeclarationParams.GetHelpers(HelperKind: TFDHelpersListKind; function TFindDeclarationParams.GetHelpers(HelperKind: TFDHelpersListKind;
CreateIfNotExists: boolean): TFDHelpersList; CreateIfNotExists: boolean): TFDHelpersList;
var
xLastContextNode: TCodeTreeNode;
begin begin
if FNeedHelpers then if FNeedHelpers then
begin
xLastContextNode:=ContextNode;
ContextNode:=StartNode;
StartTool.FindHelpersInContext(Self); // beware: this calls GetHelpers StartTool.FindHelpersInContext(Self); // beware: this calls GetHelpers
ContextNode:=xLastContextNode;
end;
Result:=FHelpers[HelperKind]; Result:=FHelpers[HelperKind];
if (Result=nil) and CreateIfNotExists then begin if (Result=nil) and CreateIfNotExists then begin
Result:=TFDHelpersList.Create(HelperKind); Result:=TFDHelpersList.Create(HelperKind);