Skip to content

Commit

Permalink
Added Kotlin @name, @type, and @value.
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfmanstout committed Jun 22, 2024
1 parent 9259355 commit 71b125c
Show file tree
Hide file tree
Showing 25 changed files with 952 additions and 0 deletions.
33 changes: 33 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeCall4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
languageId: kotlin
command:
version: 7
spokenForm: change call
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: functionCall}
usePrePhraseSnapshot: true
initialState:
documentContents: |
enum class Color(val hex: String) {
RED("#FF0000"),
GREEN("#00FF00"),
BLUE("#0000FF")
}
selections:
- anchor: {line: 2, character: 4}
active: {line: 2, character: 4}
marks: {}
finalState:
documentContents: |
enum class Color(val hex: String) {
RED("#FF0000"),
,
BLUE("#0000FF")
}
selections:
- anchor: {line: 2, character: 4}
active: {line: 2, character: 4}
33 changes: 33 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeClassName3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
languageId: kotlin
command:
version: 7
spokenForm: change class name
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: className}
usePrePhraseSnapshot: true
initialState:
documentContents: |
class MyClass {
companion object NamedCompanion {
fun greet() = "Hello!"
}
}
selections:
- anchor: {line: 2, character: 30}
active: {line: 2, character: 30}
marks: {}
finalState:
documentContents: |
class MyClass {
companion object {
fun greet() = "Hello!"
}
}
selections:
- anchor: {line: 1, character: 21}
active: {line: 1, character: 21}
23 changes: 23 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeLambda2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
languageId: kotlin
command:
version: 7
spokenForm: change lambda
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: anonymousFunction}
usePrePhraseSnapshot: true
initialState:
documentContents: "val lambda = { x: Int -> x * 2 }"
selections:
- anchor: {line: 0, character: 26}
active: {line: 0, character: 26}
marks: {}
finalState:
documentContents: "val lambda = "
selections:
- anchor: {line: 0, character: 13}
active: {line: 0, character: 13}
29 changes: 29 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeName.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
languageId: kotlin
command:
version: 7
spokenForm: change name
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: name}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
fun add(a: Int, b: Int) {
return a + b;
}
selections:
- anchor: {line: 0, character: 12}
active: {line: 0, character: 12}
marks: {}
finalState:
documentContents: |-
fun add(: Int, b: Int) {
return a + b;
}
selections:
- anchor: {line: 0, character: 8}
active: {line: 0, character: 8}
29 changes: 29 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeName2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
languageId: kotlin
command:
version: 7
spokenForm: change name
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: name}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
fun main() {
val f = { a: Int, b: Int -> a + b }
}
selections:
- anchor: {line: 1, character: 20}
active: {line: 1, character: 20}
marks: {}
finalState:
documentContents: |-
fun main() {
val f = { : Int, b: Int -> a + b }
}
selections:
- anchor: {line: 1, character: 14}
active: {line: 1, character: 14}
23 changes: 23 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeName3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
languageId: kotlin
command:
version: 7
spokenForm: change name
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: name}
usePrePhraseSnapshot: true
initialState:
documentContents: typealias Predicate<T> = (T) -> Boolean
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
marks: {}
finalState:
documentContents: typealias = (T) -> Boolean
selections:
- anchor: {line: 0, character: 10}
active: {line: 0, character: 10}
23 changes: 23 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeName4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
languageId: kotlin
command:
version: 7
spokenForm: change name
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: name}
usePrePhraseSnapshot: true
initialState:
documentContents: "class Person(val firstName: String, var isEmployed: Boolean = true)"
selections:
- anchor: {line: 0, character: 14}
active: {line: 0, character: 14}
marks: {}
finalState:
documentContents: "class Person(val : String, var isEmployed: Boolean = true)"
selections:
- anchor: {line: 0, character: 17}
active: {line: 0, character: 17}
33 changes: 33 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeName5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
languageId: kotlin
command:
version: 7
spokenForm: change name
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: name}
usePrePhraseSnapshot: true
initialState:
documentContents: |
class MyClass {
companion object NamedCompanion {
fun greet() = "Hello!"
}
}
selections:
- anchor: {line: 1, character: 37}
active: {line: 1, character: 37}
marks: {}
finalState:
documentContents: |
class MyClass {
companion object {
fun greet() = "Hello!"
}
}
selections:
- anchor: {line: 1, character: 21}
active: {line: 1, character: 21}
31 changes: 31 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeRound.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
languageId: kotlin
command:
version: 7
spokenForm: change round
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: surroundingPair, delimiter: parentheses}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
fun main() {
// my (test) function
print("hello (test) world")
}
selections:
- anchor: {line: 1, character: 13}
active: {line: 1, character: 13}
marks: {}
finalState:
documentContents: |-
fun main() {
// my function
print("hello (test) world")
}
selections:
- anchor: {line: 1, character: 10}
active: {line: 1, character: 10}
31 changes: 31 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeRound2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
languageId: kotlin
command:
version: 7
spokenForm: change round
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: surroundingPair, delimiter: parentheses}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
fun main() {
// my (test) function
print("hello (test) world")
}
selections:
- anchor: {line: 2, character: 22}
active: {line: 2, character: 22}
marks: {}
finalState:
documentContents: |-
fun main() {
// my (test) function
print("hello world")
}
selections:
- anchor: {line: 2, character: 17}
active: {line: 2, character: 17}
29 changes: 29 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeType.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
languageId: kotlin
command:
version: 7
spokenForm: change type
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: type}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
fun main() {
val f: suspend (a: Int) -> Int = { x -> x }
}
selections:
- anchor: {line: 1, character: 39}
active: {line: 1, character: 39}
marks: {}
finalState:
documentContents: |-
fun main() {
val f: = { x -> x }
}
selections:
- anchor: {line: 1, character: 11}
active: {line: 1, character: 11}
23 changes: 23 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeType10.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
languageId: kotlin
command:
version: 7
spokenForm: change type
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: type}
usePrePhraseSnapshot: true
initialState:
documentContents: "class Person(val firstName: String, var isEmployed: Boolean = true)"
selections:
- anchor: {line: 0, character: 14}
active: {line: 0, character: 14}
marks: {}
finalState:
documentContents: "class Person(val firstName: , var isEmployed: Boolean = true)"
selections:
- anchor: {line: 0, character: 28}
active: {line: 0, character: 28}
23 changes: 23 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeType11.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
languageId: kotlin
command:
version: 7
spokenForm: change type
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: type}
usePrePhraseSnapshot: true
initialState:
documentContents: "class Person(val firstName: String, var isEmployed: Boolean = true)"
selections:
- anchor: {line: 0, character: 38}
active: {line: 0, character: 38}
marks: {}
finalState:
documentContents: "class Person(val firstName: String, var isEmployed: = true)"
selections:
- anchor: {line: 0, character: 52}
active: {line: 0, character: 52}
Loading

0 comments on commit 71b125c

Please sign in to comment.