codetools: GetPasDocComments: check if comment belongs to prior code, bug #12447

git-svn-id: trunk@21135 -
This commit is contained in:
mattias 2009-08-07 12:46:20 +00:00
parent 9e26c121f4
commit 85faf25c1f
2 changed files with 4 additions and 6 deletions

View File

@ -4184,6 +4184,7 @@ function TStandardCodeTool.GetPasDocComments(const StartPos: TCodeXYPosition;
var var
p: Integer; p: Integer;
begin begin
//DebugLn(['CommentBelongsToPrior Comment=',dbgstr(copy(Src,CommentStart,20))]);
if (CommentStart<SrcLen) and (Src[CommentStart]='{') if (CommentStart<SrcLen) and (Src[CommentStart]='{')
and (Src[CommentStart+1]='<') then and (Src[CommentStart+1]='<') then
Result:=true Result:=true
@ -4196,6 +4197,7 @@ function TStandardCodeTool.GetPasDocComments(const StartPos: TCodeXYPosition;
else begin else begin
p:=CommentStart-1; p:=CommentStart-1;
while (p>=1) and (Src[p] in [' ',#9]) do dec(p); while (p>=1) and (Src[p] in [' ',#9]) do dec(p);
//DebugLn(['CommentBelongsToPrior Code in front: ',dbgstr(copy(Src,p,20))]);
if (p<1) or (Src[p] in [#10,#13]) then if (p<1) or (Src[p] in [#10,#13]) then
Result:=false Result:=false
else else
@ -4227,10 +4229,7 @@ function TStandardCodeTool.GetPasDocComments(const StartPos: TCodeXYPosition;
if not CommentBelongsToPrior(p) then if not CommentBelongsToPrior(p) then
Add(p); Add(p);
end else if (p<EndPos) then begin end else if (p<EndPos) then begin
// comment in the middle // comment in the middle or behind
Add(p);
end else begin
// comment behind
if CommentBelongsToPrior(p) then if CommentBelongsToPrior(p) then
Add(p); Add(p);
end; end;
@ -4271,7 +4270,7 @@ begin
EndPos:=ANode.EndPos; EndPos:=ANode.EndPos;
// scan range for comments // scan range for comments
if not Scan(Anode.StartPos,EndPos) then exit; if not Scan(ANode.StartPos,EndPos) then exit;
if ANode.Desc in AllIdentifierDefinitions then begin if ANode.Desc in AllIdentifierDefinitions then begin
// scan behind type // scan behind type

View File

@ -10830,7 +10830,6 @@ begin
end; end;
FCheckFilesOnDiskNeeded:=false; FCheckFilesOnDiskNeeded:=false;
//debugln('TMainIDE.DoCheckFilesOnDisk');
FCheckingFilesOnDisk:=true; FCheckingFilesOnDisk:=true;
AnUnitList:=nil; AnUnitList:=nil;
APackageList:=nil; APackageList:=nil;