mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-25 16:49:04 +02: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
|
||||
begin
|
||||
ClassSectionNode:=CodeCompleteClassNode.FirstChild;
|
||||
while (ClassSectionNode<>nil)
|
||||
and (ClassSectionNode.Desc<>ClassSectionNodeType[Visibility]) do
|
||||
while (ClassSectionNode<>nil) and (
|
||||
(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;
|
||||
end else begin
|
||||
ClassSectionNode:=CodeCompleteClassNode;
|
||||
@ -7999,8 +8003,12 @@ var
|
||||
SectionNode:=SectionNode.PriorBrother;
|
||||
end else
|
||||
SectionNode:=CodeCompleteClassNode.LastChild;
|
||||
while (SectionNode<>nil)
|
||||
and (SectionNode.Desc<>ClassSectionNodeType[Visibility]) do
|
||||
while (SectionNode<>nil) and (
|
||||
(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;
|
||||
if (SectionNode<>nil) then begin
|
||||
//DebugLn(['AddClassSection section exists for ',NodeDescriptionAsString(ClassSectionNodeType[Visibility])]);
|
||||
|
Loading…
Reference in New Issue
Block a user