mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-22 23:29:27 +01:00
CodeTools: don't break one-liner class definitions like "private const". Issue 39514
This commit is contained in:
parent
fdd5721318
commit
1dac8b96e8
@ -7732,8 +7732,12 @@ begin
|
|||||||
if CodeCompleteClassNode.Desc in AllClassObjects then
|
if CodeCompleteClassNode.Desc in AllClassObjects then
|
||||||
begin
|
begin
|
||||||
ClassSectionNode:=CodeCompleteClassNode.FirstChild;
|
ClassSectionNode:=CodeCompleteClassNode.FirstChild;
|
||||||
while (ClassSectionNode<>nil)
|
while (ClassSectionNode<>nil) and (
|
||||||
and (ClassSectionNode.Desc<>ClassSectionNodeType[Visibility]) do
|
(ClassSectionNode.Desc<>ClassSectionNodeType[Visibility])
|
||||||
|
// do not break one-liner double definitions like "private const" (const is a child node for the private section)
|
||||||
|
or ((ClassSectionNode.FirstChild<>nil)
|
||||||
|
and (ClassSectionNode.FirstChild.StartPos=ClassSectionNode.StartPos+Length(NodeDescriptionAsString(ClassSectionNode.Desc))+1))
|
||||||
|
) do
|
||||||
ClassSectionNode:=ClassSectionNode.NextBrother;
|
ClassSectionNode:=ClassSectionNode.NextBrother;
|
||||||
end else begin
|
end else begin
|
||||||
ClassSectionNode:=CodeCompleteClassNode;
|
ClassSectionNode:=CodeCompleteClassNode;
|
||||||
@ -7999,8 +8003,12 @@ var
|
|||||||
SectionNode:=SectionNode.PriorBrother;
|
SectionNode:=SectionNode.PriorBrother;
|
||||||
end else
|
end else
|
||||||
SectionNode:=CodeCompleteClassNode.LastChild;
|
SectionNode:=CodeCompleteClassNode.LastChild;
|
||||||
while (SectionNode<>nil)
|
while (SectionNode<>nil) and (
|
||||||
and (SectionNode.Desc<>ClassSectionNodeType[Visibility]) do
|
(SectionNode.Desc<>ClassSectionNodeType[Visibility])
|
||||||
|
// do not break one-liner double definitions like "private const" (const is a child node for the private section)
|
||||||
|
or ((SectionNode.FirstChild<>nil)
|
||||||
|
and (SectionNode.FirstChild.StartPos=SectionNode.StartPos+Length(NodeDescriptionAsString(SectionNode.Desc))+1))
|
||||||
|
) do
|
||||||
SectionNode:=SectionNode.PriorBrother;
|
SectionNode:=SectionNode.PriorBrother;
|
||||||
if (SectionNode<>nil) then begin
|
if (SectionNode<>nil) then begin
|
||||||
//DebugLn(['AddClassSection section exists for ',NodeDescriptionAsString(ClassSectionNodeType[Visibility])]);
|
//DebugLn(['AddClassSection section exists for ',NodeDescriptionAsString(ClassSectionNodeType[Visibility])]);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user