Skip to content

Commit

Permalink
Incomplete Kotlin support.
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfmanstout committed Jun 22, 2024
1 parent 4eca035 commit 9259355
Show file tree
Hide file tree
Showing 44 changed files with 2,038 additions and 0 deletions.
55 changes: 55 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeBranch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
languageId: kotlin
command:
version: 7
spokenForm: change branch
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: branch}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
class Test {
fun main() {
val f = fun(i: Int, j: Int) { i + j }
val s = f(1, 2)
when (s) {
1 -> print("x == 1")
2 -> print("x == 2")
else -> {
print("x is neither 1 nor 2")
}
}
if (true) {
return;
}
}
}
selections:
- anchor: {line: 5, character: 20}
active: {line: 5, character: 20}
marks: {}
finalState:
documentContents: |-
class Test {
fun main() {
val f = fun(i: Int, j: Int) { i + j }
val s = f(1, 2)
when (s) {
2 -> print("x == 2")
else -> {
print("x is neither 1 nor 2")
}
}
if (true) {
return;
}
}
}
selections:
- anchor: {line: 5, character: 12}
active: {line: 5, character: 12}
33 changes: 33 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeBranch2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
languageId: kotlin
command:
version: 7
spokenForm: change branch
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: branch}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
fun main() {
if (true) 0
if (true) 0 else 1
}
selections:
- anchor: {line: 1, character: 12}
active: {line: 1, character: 12}
marks: {}
finalState:
documentContents: |-
fun main() {
if (true) 0 else 1
}
selections:
- anchor: {line: 1, character: 4}
active: {line: 1, character: 4}
33 changes: 33 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeBranch3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
languageId: kotlin
command:
version: 7
spokenForm: change branch
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: branch}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
fun main() {
if (true) 0
if (true) 0 else 1
}
selections:
- anchor: {line: 3, character: 12}
active: {line: 3, character: 12}
marks: {}
finalState:
documentContents: |-
fun main() {
if (true) 0
else 1
}
selections:
- anchor: {line: 3, character: 4}
active: {line: 3, character: 4}
29 changes: 29 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeBranch4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
languageId: kotlin
command:
version: 7
spokenForm: change branch
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: branch}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
fun main() {
if (true) 0 else if (false) 1 else -1
}
selections:
- anchor: {line: 1, character: 18}
active: {line: 1, character: 18}
marks: {}
finalState:
documentContents: |-
fun main() {
if (true) 0 else -1
}
selections:
- anchor: {line: 1, character: 16}
active: {line: 1, character: 16}
29 changes: 29 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeBranch5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
languageId: kotlin
command:
version: 7
spokenForm: change branch
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: branch}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
fun main() {
if (true) 0 else if (false) 1 else -1
}
selections:
- anchor: {line: 1, character: 37}
active: {line: 1, character: 37}
marks: {}
finalState:
documentContents: |-
fun main() {
if (true) 0 else if (false) 1
}
selections:
- anchor: {line: 1, character: 34}
active: {line: 1, character: 34}
55 changes: 55 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeCall.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
languageId: kotlin
command:
version: 7
spokenForm: change call
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: functionCall}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
class Test {
fun main() {
val f = fun(i: Int, j: Int) { i + j }
val s = f(1, 2)
when (s) {
1 -> print("x == 1")
2 -> print("x == 2")
else -> {
print("x is neither 1 nor 2")
}
}
if (true) {
return;
}
}
}
selections:
- anchor: {line: 3, character: 18}
active: {line: 3, character: 18}
marks: {}
finalState:
documentContents: |-
class Test {
fun main() {
val f = fun(i: Int, j: Int) { i + j }
val s =
when (s) {
1 -> print("x == 1")
2 -> print("x == 2")
else -> {
print("x is neither 1 nor 2")
}
}
if (true) {
return;
}
}
}
selections:
- anchor: {line: 3, character: 16}
active: {line: 3, character: 16}
33 changes: 33 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeCall2.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: |-
class A : B() {}
class C(param: Int) : D(param)
class D : SomeInterface
selections:
- anchor: {line: 2, character: 25}
active: {line: 2, character: 25}
marks: {}
finalState:
documentContents: |-
class A : B() {}
class C(param: Int) :
class D : SomeInterface
selections:
- anchor: {line: 2, character: 22}
active: {line: 2, character: 22}
29 changes: 29 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeCall3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
languageId: kotlin
command:
version: 7
spokenForm: change call
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: functionCall}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
class Test(x: Int, y: Int) {
constructor() : this(0, 0)
}
selections:
- anchor: {line: 1, character: 25}
active: {line: 1, character: 25}
marks: {}
finalState:
documentContents: |-
class Test(x: Int, y: Int) {
constructor() :
}
selections:
- anchor: {line: 1, character: 18}
active: {line: 1, character: 18}
41 changes: 41 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeClass.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
languageId: kotlin
command:
version: 7
spokenForm: change class
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: class}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
class HelloWorld {
fun a() {}
fun b() {}
}
object GoodbyeWorld {
fun a() {}
fun b() {}
}
selections:
- anchor: {line: 1, character: 2}
active: {line: 1, character: 2}
marks: {}
finalState:
documentContents: |-
object GoodbyeWorld {
fun a() {}
fun b() {}
}
selections:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 0}
40 changes: 40 additions & 0 deletions data/fixtures/recorded/languages/kotlin/changeClass2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
languageId: kotlin
command:
version: 7
spokenForm: change class
action:
name: clearAndSetSelection
target:
type: primitive
modifiers:
- type: containingScope
scopeType: {type: class}
usePrePhraseSnapshot: true
initialState:
documentContents: |-
class HelloWorld {
fun a() {}
fun b() {}
}
object GoodbyeWorld {
fun a() {}
fun b() {}
}
selections:
- anchor: {line: 8, character: 0}
active: {line: 8, character: 0}
marks: {}
finalState:
documentContents: |+
class HelloWorld {
fun a() {}
fun b() {}
}
selections:
- anchor: {line: 6, character: 0}
active: {line: 6, character: 0}
Loading

0 comments on commit 9259355

Please sign in to comment.