codetools: fixed class completion

git-svn-id: trunk@18063 -
This commit is contained in:
mattias 2009-01-02 18:56:39 +00:00
parent 9ccd6f2095
commit 912f4c0d77

View File

@ -5612,7 +5612,7 @@ var
InsertEndPos: LongInt; InsertEndPos: LongInt;
ProcCode: String; ProcCode: String;
begin begin
Result:=false; Result:=true;
BodiesWithoutDefs:=nil; BodiesWithoutDefs:=nil;
DefsWithoutBodies:=nil; DefsWithoutBodies:=nil;
try try
@ -5627,6 +5627,7 @@ var
BodyAVLNode:=ProcBodyNodes.FindSuccessor(BodyAVLNode); BodyAVLNode:=ProcBodyNodes.FindSuccessor(BodyAVLNode);
end; end;
if BodiesWithoutDefs=nil then exit; if BodiesWithoutDefs=nil then exit;
// collect all definitions without a body // collect all definitions without a body
DefAVLNode:=ClassProcs.FindLowest; DefAVLNode:=ClassProcs.FindLowest;
while DefAVLNode<>nil do begin while DefAVLNode<>nil do begin
@ -5650,10 +5651,8 @@ var
DefNodeExt.Data:=BodyNodeExt; DefNodeExt.Data:=BodyNodeExt;
end else begin end else begin
// no mapping found // no mapping found
// => warn user debugln(CleanPosToStr(ANode.FirstChild.StartPos)+' warning: procedure has no definition in the class');
ANode:=TCodeTreeNodeExtension(BodiesWithoutDefs.FindLowest.Data).Node; exit;
MoveCursorToNodeStart(ANode.FirstChild);
RaiseException('procedure has no definition in the class');
end; end;
// replace body proc head(s) with class proc head(s) // replace body proc head(s) with class proc head(s)
@ -5681,7 +5680,6 @@ var
BodiesWithoutDefs.Free; BodiesWithoutDefs.Free;
DefsWithoutBodies.Free; DefsWithoutBodies.Free;
end; end;
Result:=true;
end; end;
procedure RemoveAbstractMethods; procedure RemoveAbstractMethods;