mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 09:59:20 +02:00
codetools: GetPasDocComments: check if comment belongs to prior code, bug #12447
git-svn-id: trunk@21135 -
This commit is contained in:
parent
9e26c121f4
commit
85faf25c1f
@ -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
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user