[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/csharp-mode f83e2e3 207/459: Fix indentation of generic
From: |
ELPA Syncer |
Subject: |
[elpa] externals/csharp-mode f83e2e3 207/459: Fix indentation of generic type-initializers. |
Date: |
Sun, 22 Aug 2021 13:59:28 -0400 (EDT) |
branch: externals/csharp-mode
commit f83e2e3722000203363e98b77beb59761fa18579
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: Jostein Kjønigsen <jostein@kjonigsen.net>
Fix indentation of generic type-initializers.
Activate test-case in indentation test.
This closes https://github.com/josteink/csharp-mode/issues/85
---
csharp-mode.el | 7 ++++++-
test-files/indentation-tests.cs | 11 +++++------
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/csharp-mode.el b/csharp-mode.el
index 6683bd5..77eb5c6 100644
--- a/csharp-mode.el
+++ b/csharp-mode.el
@@ -481,8 +481,13 @@ to work properly with code that includes attributes.
;; before open curly in object initializer. new Foo* { }
((and (looking-back
(concat "\\<new[ \t\n\f\v\r]+"
+ ;; typename
"\\(?:[A-Za-z_][[:alnum:]]*\\.\\)*"
- "[A-Za-z_][[:alnum:]]*[\ t\n\f\v\r]*") nil)
+ "[A-Za-z_][[:alnum:]]*"
+ ;; optional generic constraint
+ "\\(?:<\\(?:[[:alpha:]][[:alnum:]]*\\)\\(?:[,
]+[[:alpha:]][[:alnum:]]*\\)*>\\)?"
+ ;; spacing
+ "[\ t\n\f\v\r]*") nil)
(looking-at "[ \t\n\f\v\r]*{"))
t)
diff --git a/test-files/indentation-tests.cs b/test-files/indentation-tests.cs
index d054655..9715840 100644
--- a/test-files/indentation-tests.cs
+++ b/test-files/indentation-tests.cs
@@ -53,12 +53,11 @@ namespace Boo
{ 2, "false" },
};
- // indents incorrectly! :(
- // var map2 = new Dictionary<int,string>
- // {
- // { 1, "true" },
- // { 2, "false" },
- // };
+ var map2 = new Dictionary<int,string>
+ {
+ { 1, "true" },
+ { 2, "false" },
+ };
using (test)
{
- [elpa] externals/csharp-mode 717bf76 194/459: Fix compilation errors and warnings., (continued)
- [elpa] externals/csharp-mode 717bf76 194/459: Fix compilation errors and warnings., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 7baacd5 196/459: Make imenu-tests less verbose., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 9616fd0 192/459: Fix method-name fontification tests., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 04958ec 198/459: Fix byte-compilation warnings., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 49a957b 199/459: Super-ugly hacks to fix build., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode aa4e5db 201/459: Escape both quoting and quoted double quote, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 48dd7ee 202/459: Remove empty line at file start, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 803a362 203/459: Move log functions back down where they were., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 8a9ab5a 204/459: imenu: Add test-cases for generic methods., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode b56c250 205/459: Add fontification tests for generic methods., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode f83e2e3 207/459: Fix indentation of generic type-initializers.,
ELPA Syncer <=
- [elpa] externals/csharp-mode 81cf94d 214/459: Update test-data., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode bd42802 216/459: Indentation fix (#88), ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 0c4edfd 217/459: Hopefully fix this CI-snafu for now., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 6ccf2cf 219/459: Apply syntax propertize function silently, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 6c0a0d6 220/459: Bump version. Update changelog., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode b87332e 222/459: Update documentation for Emacs 25., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 4516a18 223/459: Fix indentation of generic type-initializers., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode ed7c30c 224/459: WIP: Fix checkdoc- and package-lint errors, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode bbd2888 232/459: Merge branch 'mattiasb-fix-warnings', ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode bc6a419 237/459: Update changelog., ELPA Syncer, 2021/08/22