Skip to content

Commit 8970637

Browse files
authored
Added tests for recently-fixed Kotlin functionality. (#2668)
Added tests for #2642 ## Checklist - [x] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [x] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [x] I have not broken the cheatsheet
1 parent e52a08c commit 8970637

File tree

3 files changed

+64
-1
lines changed

3 files changed

+64
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
languageId: kotlin
2+
command:
3+
version: 7
4+
spokenForm: change call
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: functionCall}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: |-
15+
fun main() {
16+
val s = "test"
17+
val l = with (s) { length }
18+
println(l)
19+
}
20+
selections:
21+
- anchor: {line: 2, character: 14}
22+
active: {line: 2, character: 14}
23+
marks: {}
24+
finalState:
25+
documentContents: |-
26+
fun main() {
27+
val s = "test"
28+
val l =
29+
println(l)
30+
}
31+
selections:
32+
- anchor: {line: 2, character: 12}
33+
active: {line: 2, character: 12}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
languageId: kotlin
2+
command:
3+
version: 7
4+
spokenForm: change value
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: value}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: |-
15+
fun main() {
16+
val n = null
17+
println(n)
18+
}
19+
selections:
20+
- anchor: {line: 1, character: 8}
21+
active: {line: 1, character: 8}
22+
marks: {}
23+
finalState:
24+
documentContents: |-
25+
fun main() {
26+
val n =
27+
println(n)
28+
}
29+
selections:
30+
- anchor: {line: 1, character: 12}
31+
active: {line: 1, character: 12}

queries/kotlin.scm

-1
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,6 @@
509509
(annotated_lambda) @argumentOrParameter
510510
)
511511

512-
;; Note: trailing lambda mixed with regular arguments doesn't work due to bad tree sitter parse.
513512
(call_expression
514513
(call_suffix) @argumentOrParameter.iteration
515514
) @argumentOrParameter.iteration.domain

0 commit comments

Comments
 (0)