[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/swift-mode be8d770 446/496: Fix indentation after `class'
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/swift-mode be8d770 446/496: Fix indentation after `class' modifier |
Date: |
Sun, 29 Aug 2021 11:34:25 -0400 (EDT) |
branch: elpa/swift-mode
commit be8d7700cdbf47576d7c4e0a7e0855cce0fe9ad8
Author: taku0 <mxxouy6x3m_github@tatapa.org>
Commit: taku0 <mxxouy6x3m_github@tatapa.org>
Fix indentation after `class' modifier
---
swift-mode-lexer.el | 12 +++----
test/swift-files/indent/declarations.swift | 56 ++++++++++++++++++++++++++++++
2 files changed, 62 insertions(+), 6 deletions(-)
diff --git a/swift-mode-lexer.el b/swift-mode-lexer.el
index ab93cae..bcda40e 100644
--- a/swift-mode-lexer.el
+++ b/swift-mode-lexer.el
@@ -463,6 +463,12 @@ Return nil otherwise." ;; FIXME pound-count
"fileprivate")))))
nil)
+ ;; Suppress implicit semicolon after declaration starters.
+ ((member (swift-mode:token:text previous-token)
+ '("class" "struct" "protocol" "enum" "extension" "func"
+ "typealias" "associatedtype" "precedencegroup" "operator"))
+ nil)
+
;; Insert implicit semicolon before modifiers.
;;
;; Preceding modifiers takes precedence over this.
@@ -525,12 +531,6 @@ Return nil otherwise." ;; FIXME pound-count
'("get" "set" "willSet" "didSet" "subscript" "init" "deinit"))
t)
- ;; Suppress implicit semicolon after declaration starters.
- ((member (swift-mode:token:text previous-token)
- '("class" "struct" "protocol" "enum" "extension" "func"
- "typealias" "associatedtype" "precedencegroup" "operator"))
- nil)
-
;; Inserts implicit semicolon before declaration starters.
;; Modifiers take precedence over this.
;;
diff --git a/test/swift-files/indent/declarations.swift
b/test/swift-files/indent/declarations.swift
index 7ad7978..469d0f9 100644
--- a/test/swift-files/indent/declarations.swift
+++ b/test/swift-files/indent/declarations.swift
@@ -460,3 +460,59 @@ precedencegroup
associativity:
left
}
+
+// Declaration modifiers
+
+class Foo {
+ open
+ class
+ mutating
+ nonmutating
+ func
+ foo() {
+ }
+
+ public
+ (
+ set
+ )
+ class
+ dynamic
+ final
+ lazy
+ optional
+ required
+ static
+ unowned
+ unowned
+ (
+ safe
+ )
+ unowned
+ (
+ unsafe
+ )
+ weak
+ var
+ x = 1
+
+ internal
+ class
+ let
+ x = 1
+
+ fileprivate
+ class
+ init() {
+ }
+
+ private
+ class
+ deinit {
+ }
+
+ class
+ subscript(foo: Int) -> Int {
+ return foo
+ }
+}
- [nongnu] elpa/swift-mode acfc7fd 452/496: Fix comments, (continued)
- [nongnu] elpa/swift-mode acfc7fd 452/496: Fix comments, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 0daff60 463/496: Fix unreadable characters appearing in repl prompt, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 5597eaf 467/496: Avoid max-lisp-eval-depth in font-lock-match-expr, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 8f1a697 483/496: Fix documentations, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode cb6186e 474/496: Add support for font-lock-negation-char-face, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode b6d0351 338/496: Fix indentation of switch, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 07939df 413/496: Bump version to 7.0.0, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 55ce4e5 416/496: Fix command name, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode fa4f491 433/496: Add Emacs 25.3 and 26.1 to CI, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 3b6bdad 443/496: Bump version to 8.0.0, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode be8d770 446/496: Fix indentation after `class' modifier,
ELPA Syncer <=
- [nongnu] elpa/swift-mode 3d1cfcc 047/496: Clarify manual installation, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 5448098 366/496: Improve functions related to defuns, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 7d9aabb 426/496: Improve support for Imenu, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode b4e0622 444/496: Add test for indent of import declarations, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode d266fbd 462/496: Update standard types, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 3bbc38e 469/496: Update copyright notices, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode f88e1ac 491/496: Support actor, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode f614620 493/496: Add tests for effectful read-only properties, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 471d158 490/496: Highlight actor, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 59dcd60 358/496: Fix errors in 24.4, ELPA Syncer, 2021/08/29