codetools: added debugging

git-svn-id: trunk@26331 -
This commit is contained in:
mattias 2010-06-29 17:53:04 +00:00
parent 8cbbc108e0
commit c2313cc163
3 changed files with 14 additions and 9 deletions

View File

@ -2363,20 +2363,19 @@ var SrcLen: integer;
procedure DoSkipEmptyLines(var p: integer);
var
OldPos: LongInt;
r: LongInt;
begin
OldPos:=p;
r:=p;
repeat
while (p<=SrcLen) and (Source[p] in [' ',#9]) do inc(p);
if (p<=SrcLen) and (Source[p] in [#10,#13]) then begin
while (r<=SrcLen) and (Source[r] in [' ',#9]) do inc(r);
if (r<=SrcLen) and (Source[r] in [#10,#13]) then begin
// an empty line => skip
OldPos:=p;// remember position in front of new line characters
inc(p);
if (p<=SrcLen) and (Source[p] in [#10,#13]) and (Source[p]<>Source[p-1])
p:=r;// remember position in front of new line characters
inc(r);
if (r<=SrcLen) and (Source[r] in [#10,#13]) and (Source[r]<>Source[r-1])
then
inc(p);
inc(r);
end else begin
p:=OldPos;
exit;
end;
until false;

View File

@ -4930,6 +4930,9 @@ begin
// delete group
FromPos:=FindLineEndOrCodeInFrontOfPosition(FirstNodeExt.Node.StartPos,true);
ToPos:=FindLineEndOrCodeAfterPosition(LastNodeExt.Node.EndPos,true);
{$IFDEF VerboseBug16168}
debugln(['TCodeCompletionCodeTool.RemoveEmptyMethods ',dbgstr(copy(Src,FromPos,ToPos-FromPos))]);
{$ENDIF}
if AllRemoved and FirstGroup
and FindClassMethodsComment(FromPos,CommentStart,CommentEnd) then begin
// all method bodies will be removed => remove the default comment too

View File

@ -3716,6 +3716,9 @@ begin
else
Len:=aLinkSize-StartPos;
inc(StartPos,FLinks[LinkIndex].SrcPos);
{$IFDEF VerboseBug16168}
DebugLn(['[TLinkScanner.DeleteRange] Pos=',StartPos,'-',StartPos+Len,' ',dbgstr(copy(Src,StartPos,Len))]);
{$ENDIF}
FOnDeleteSource(Self,FLinks[LinkIndex].Code,StartPos,Len);
if FLinks[LinkIndex].CleanedPos<=CleanStartPos then break;
dec(LinkIndex);