codetools: fixed complete forward proc

git-svn-id: branches/fixes_1_8@56045 -
This commit is contained in:
mattias 2017-10-13 11:43:20 +00:00
parent a821393264
commit 0bc78adca9
2 changed files with 10 additions and 9 deletions

View File

@ -1747,10 +1747,11 @@ begin
try
// gather all proc definitions
StartNode:=nil;
if (ProcNode.Parent.Desc=ctnImplementation)
and (ProcNode.Parent.PriorBrother<>nil)
and (ProcNode.Parent.PriorBrother.Desc=ctnInterface) then
StartNode:=ProcNode.Parent.PriorBrother.FirstChild;
if (ProcNode.Parent.Desc=ctnImplementation) then begin
StartNode:=FindInterfaceNode;
if StartNode<>nil then
StartNode:=StartNode.FirstChild;
end;
if StartNode=nil then
StartNode:=FindFirstNodeOnSameLvl(ProcNode);
//debugln(['TCodeCompletionCodeTool.CompleteForwardProcs StartNode=',StartNode.DescAsString,' at ',CleanPosToStr(StartNode.StartPos),'=',ExtractProcName(StartNode,[])]);

View File

@ -5501,11 +5501,11 @@ begin
Result:=Result.PriorBrother;
end else begin
Result:=Result.Parent;
while (Result.Desc in AllCodeSections) and (Result.PriorBrother<>nil) do
Result:=Result.PriorBrother;
while (Result<>nil) and (Result.FirstChild=nil) do
Result:=Result.NextBrother;
Result:=Result.FirstChild;
if (Result.Desc=ctnImplementation) and (Result.PriorBrother.Desc=ctnInterface)
and (Result.PriorBrother.FirstChild<>nil) then
Result:=Result.PriorBrother.FirstChild
else
Result:=Result.FirstChild;
end;
end;