[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/csharp-mode ebd67a1 209/459: Correctly indent nested ge
From: |
ELPA Syncer |
Subject: |
[elpa] externals/csharp-mode ebd67a1 209/459: Correctly indent nested generic object initializers |
Date: |
Sun, 22 Aug 2021 13:59:28 -0400 (EDT) |
branch: externals/csharp-mode
commit ebd67a1d2301434ef704c6cd77982808764f463f
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: Jostein Kjønigsen <jostein@kjonigsen.net>
Correctly indent nested generic object initializers
This properly closes https://github.com/josteink/csharp-mode/issues/85
---
csharp-mode.el | 7 +++++--
test-files/indentation-tests.cs | 5 +++++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/csharp-mode.el b/csharp-mode.el
index d0ba8dd..cc6cbb0 100644
--- a/csharp-mode.el
+++ b/csharp-mode.el
@@ -484,8 +484,11 @@ to work properly with code that includes attributes.
;; typename
"\\(?:[A-Za-z_][[:alnum:]]*\\.\\)*"
"[A-Za-z_][[:alnum:]]*"
- ;; optional generic constraint
- "\\(?:<\\(?:[[:alpha:]][[:alnum:]]*\\)\\(?:[,
]+[[:alpha:]][[:alnum:]]*\\)*>\\)?"
+ ;; simplified generic constraint.
+ ;; handles generic sub-types.
+ ;; { is optional because otherwise initializers with
+ ;; bracket on same line will indent wrongly.
+ "\\(?:<[[:alnum:], <>]+>[ \t\n\f\v\r]*{?\\)?"
;; optional array-specifier
"\\(?:\\[\\]\\)?"
;; spacing
diff --git a/test-files/indentation-tests.cs b/test-files/indentation-tests.cs
index 4fa4ff5..8b09dcf 100644
--- a/test-files/indentation-tests.cs
+++ b/test-files/indentation-tests.cs
@@ -69,6 +69,11 @@ namespace Boo
{ 2, "false" },
};
+ var map3 = new Dictionary<string,Func<int, bool>>
+ {
+ { "IsZero", (int i) => i == 0 }
+ };
+
using (test)
{
System.Console.WriteLine("boo");
- [elpa] externals/csharp-mode ed030e7 152/459: Ensure test-cases don't overlap., (continued)
- [elpa] externals/csharp-mode ed030e7 152/459: Ensure test-cases don't overlap., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode c7932f9 156/459: Remove useless autoloads, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode ee9125d 163/459: Fix looking-back warnings., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode f9e95d1 167/459: Ensure tests reproduce fontification bugs., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode ca394f1 188/459: imenu: Fix indexing of methods in test-file., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode c206dbc 191/459: extern is a modifier-keyword, not "other" keyword., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode a8d8ef8 195/459: imenu: Index delegates, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 897c85a 197/459: imenu: Fix indexing of delegates., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode fe3ca7e 200/459: Inline square-parenthesis detection., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode f9122bb 208/459: Fix indentation for array collection initializers., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode ebd67a1 209/459: Correctly indent nested generic object initializers,
ELPA Syncer <=
- [elpa] externals/csharp-mode 5b89db2 088/459: Imenu: Correctly handle default-values in param-lists., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 8ccafbc 092/459: remove unused rule and documentation, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 0e333c3 090/459: fontify else, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode f96cf8b 089/459: remove fontification of accessors and constructors, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode c097a34 093/459: add async as a function modifier, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode dd6c930 102/459: Merge pull request #43 from wasamasa/fix-major-mode-definition, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 55fe188 101/459: Use `define-derived-mode`, ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 3c6a4ea 096/459: Add info about customization to readme., ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode f80eace 098/459: Revert "Fix runtime warnings about obsolete Emacs-functions.", ELPA Syncer, 2021/08/22
- [elpa] externals/csharp-mode 43e7120 095/459: Merge remote-tracking branch 'less-colors', ELPA Syncer, 2021/08/22