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

View File

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