From ac7b48486837a3ac263f712b1a6e6f96c1ecccf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=BE=D0=BD=D0=B4=D0=B0=D1=80=D0=B5=D0=B2=20=D0=98?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD?= Date: Wed, 30 Jan 2019 20:34:13 +0100 Subject: [PATCH] fix #1669 --- CodeCompletion/CodeFormatter.cs | 4 ++++ TestSuite/formatter_tests/input/property6.pas | 19 +++++++++++++++++++ .../formatter_tests/should/property6.pas | 19 +++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 TestSuite/formatter_tests/input/property6.pas create mode 100644 TestSuite/formatter_tests/should/property6.pas diff --git a/CodeCompletion/CodeFormatter.cs b/CodeCompletion/CodeFormatter.cs index 3879a7fe5..0afba28b4 100644 --- a/CodeCompletion/CodeFormatter.cs +++ b/CodeCompletion/CodeFormatter.cs @@ -648,6 +648,10 @@ namespace CodeFormatters if (trimedstr.StartsWith(".")) comm = trimedstr; } + else if (sn is simple_property) + { + comm = RemoveOverSpaces(comm).Replace(" ;", ";"); + } if (comm.StartsWith(" ")) add_space_before = true; if (comm != "()") diff --git a/TestSuite/formatter_tests/input/property6.pas b/TestSuite/formatter_tests/input/property6.pas new file mode 100644 index 000000000..ae45cfe7e --- /dev/null +++ b/TestSuite/formatter_tests/input/property6.pas @@ -0,0 +1,19 @@ +type + T = class + fX: byte; + + property A0 : byte write ; abstract ; + property B0 : byte read ; abstract ; + property C0 : byte read write ; abstract ; + + property A1 : byte write fX ; virtual ; + property B1 : byte read fX ; virtual ; + property C1 : byte read fX write fX ; virtual ; + + property A3 : byte write begin end ; virtual ; + property B3 : byte read 0 ; virtual ; + property C3 : byte read 0 write begin end ; virtual ; + end; + +begin +end. \ No newline at end of file diff --git a/TestSuite/formatter_tests/should/property6.pas b/TestSuite/formatter_tests/should/property6.pas new file mode 100644 index 000000000..044e99cad --- /dev/null +++ b/TestSuite/formatter_tests/should/property6.pas @@ -0,0 +1,19 @@ +type + T = class + fX: byte; + + property A0: byte write; abstract; + property B0: byte read; abstract; + property C0: byte read write; abstract; + + property A1: byte write fX; virtual; + property B1: byte read fX; virtual; + property C1: byte read fX write fX; virtual; + + property A3: byte write begin end; virtual; + property B3: byte read 0; virtual; + property C3: byte read 0 write begin end; virtual; + end; + +begin +end. \ No newline at end of file