[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/kotlin-mode 511e0a4ee3 121/162: Add in more kotlin keyword
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/kotlin-mode 511e0a4ee3 121/162: Add in more kotlin keywords and indent get/set methods for properties |
Date: |
Sat, 29 Jan 2022 08:25:29 -0500 (EST) |
branch: elpa/kotlin-mode
commit 511e0a4ee3dd536411df282e58a81c5e14851d47
Author: Martin Blake <martinblake@github.com>
Commit: Martin Blake <martinblake@github.com>
Add in more kotlin keywords and indent get/set methods for properties
---
kotlin-mode.el | 16 ++++++++--------
test/sample.kt | 22 +++++++++++-----------
2 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/kotlin-mode.el b/kotlin-mode.el
index 61d7ac643e..5ff46bfe28 100644
--- a/kotlin-mode.el
+++ b/kotlin-mode.el
@@ -172,7 +172,7 @@
"when" "is" "in" "as" "return"))
(defconst kotlin-mode--context-variables-keywords
- '("this" "super"))
+ '("field" "it" "this" "super"))
(defvar kotlin-mode--keywords
(append kotlin-mode--misc-keywords
@@ -192,7 +192,7 @@
"annotation" "internal" "const" "in" "out")) ;; "in" "out"
(defconst kotlin-mode--property-keywords
- '("by")) ;; "by" "get" "set"
+ '("by" "get" "set")) ;; "by" "get" "set"
(defconst kotlin-mode--initializer-keywords
'("init" "constructor"))
@@ -256,11 +256,11 @@
;; Properties
;; by/get/set are valid identifiers being used as variable
- ;; TODO: Highlight keywords in the property declaration statement
- ;; (,(rx-to-string
- ;; `(and bow (group (or ,@kotlin-mode--property-keywords)) eow)
- ;; t)
- ;; 1 font-lock-keyword-face)
+ ;; TODO: Highlight only within the property declaration statement
+ (,(rx-to-string
+ `(and bow (group (or ,@kotlin-mode--property-keywords)) eow)
+ t)
+ 1 font-lock-keyword-face)
;; Constructor/Initializer blocks
(,(rx-to-string
@@ -344,7 +344,7 @@
(defun kotlin-mode--line-continuation()
"Return whether this line continues a statement in the previous line"
(or
- (kotlin-mode--line-begins "\\([\.=:]\\|->\\)")
+ (kotlin-mode--line-begins "\\([\.=:]\\|->\\|[sg]et\\b\\)")
(save-excursion
(kotlin-mode--prev-line)
(kotlin-mode--line-ends "\\([=:]\\|->\\)"))))
diff --git a/test/sample.kt b/test/sample.kt
index 2c01e0ed6d..06a8063dfc 100644
--- a/test/sample.kt
+++ b/test/sample.kt
@@ -356,10 +356,10 @@ fun eval(expr: Expr): Double = when(expr) {
}
var stringRepresentation: String
-get() = this.toString()
-set(value) {
- setDataFromString(value) // parses the string and assigns values to other
properties
-}
+ get() = this.toString()
+ set(value) {
+ setDataFromString(value) // parses the string and assigns values to
other properties
+ }
var setterVisibility: String = "abc"
private set // the setter is private and has the default implementation
@@ -368,13 +368,13 @@ var setterWithAnnotation: Any? = null
@Inject set // annotate the setter with Inject
var counter = 0 // the initializer value is written directly to the backing
field
-set(value) {
- if (value >= 0)
- field = value
-}
+ set(value) {
+ if (value >= 0)
+ field = value
+ }
val isEmpty: Boolean
-get() = this.size == 0
+ get() = this.size == 0
const val SUBSYSTEM_DEPRECATED: String = "This subsystem is deprecated"
@@ -409,7 +409,7 @@ interface MyInterface {
val property: Int // abstract
val propertyWithImplementation: String
- get() = "foo"
+ get() = "foo"
fun foo() {
print(property)
@@ -479,7 +479,7 @@ fun Any?.toString(): String {
}
val <T> List<T>.lastIndex: Int
-get() = size - 1
+ get() = size - 1
class MyClass {
companion object { } // will be called "Companion"
- [nongnu] elpa/kotlin-mode e5c6d845e6 093/162: Merge pull request #19 from gregghz/fixes-closing-bracket-indentation, (continued)
- [nongnu] elpa/kotlin-mode e5c6d845e6 093/162: Merge pull request #19 from gregghz/fixes-closing-bracket-indentation, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 72a2bf2347 096/162: Add a file to get Travis-CI to run the test suite., ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode b91bab57b6 099/162: Adding REPL support, credit to https://github.com/sarvex/kotlin-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 1ed0c5589e 098/162: Merge pull request #22 from russel/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 8574583b30 105/162: Fix highlighting escaped identifiers in interpolations, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode eb3704e0e2 106/162: Set adaptive-fill-regexp to comment-start-skip, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 77d709ab54 107/162: Merge pull request #30 from CyberShadow/pull-20180624-142858, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode f08724b978 115/162: Improve handling of bracket-based indentation, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 9fa0d75997 119/162: Tidy up bracked-based indentation into a class, and fix bugs, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 76921927de 117/162: Add a test for correct indentation of sample.kt, and get it to pass (with a few tweaks), ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 511e0a4ee3 121/162: Add in more kotlin keywords and indent get/set methods for properties,
ELPA Syncer <=
- [nongnu] elpa/kotlin-mode 21ae667561 126/162: Add highlighted keywords, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode b2d5ff65fc 125/162: Highlight single quotes and back quotes, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode dd24461721 128/162: Add prefix to class methods, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 6aa6d56c0a 131/162: Merge pull request #42 from taku0/add_keywords, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 2f8a57ba64 138/162: Comment out failing emacs versions and link associated bugs, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 3062e14ac0 140/162: Merge pull request #47 from Emacs-Kotlin-Mode-Maintainers/emacs-version-test, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode d8d6461395 145/162: Fix warnings in tests, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 1f60b01659 148/162: Fix indentation of multiline comment at the beginning of buffer, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 9fba76ff2b 155/162: Fix highlighting of backquotes, ELPA Syncer, 2022/01/29
- [nongnu] elpa/kotlin-mode 3e0c34087b 162/162: Merge pull request #61 from taku0/make_underbar_symbol, ELPA Syncer, 2022/01/29