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