File tree 9 files changed +340
-8
lines changed
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/lua
9 files changed +340
-8
lines changed Original file line number Diff line number Diff line change
1
+ languageId : lua
2
+ command :
3
+ version : 6
4
+ spokenForm : change key
5
+ action :
6
+ name : clearAndSetSelection
7
+ target :
8
+ type : primitive
9
+ modifiers :
10
+ - type : containingScope
11
+ scopeType : {type: collectionKey}
12
+ usePrePhraseSnapshot : true
13
+ initialState :
14
+ documentContents : |-
15
+ local person = {
16
+ name = "John",
17
+ age = 30,
18
+ hobbies = {"reading", "gaming", "programming"},
19
+ address = {
20
+ street = "123 Main St",
21
+ city = "Example City"
22
+ }
23
+ }
24
+ selections :
25
+ - anchor : {line: 2, character: 6}
26
+ active : {line: 2, character: 6}
27
+ marks : {}
28
+ finalState :
29
+ documentContents : |-
30
+ local person = {
31
+ name = "John",
32
+ = 30,
33
+ hobbies = {"reading", "gaming", "programming"},
34
+ address = {
35
+ street = "123 Main St",
36
+ city = "Example City"
37
+ }
38
+ }
39
+ selections :
40
+ - anchor : {line: 2, character: 4}
41
+ active : {line: 2, character: 4}
Original file line number Diff line number Diff line change
1
+ languageId : lua
2
+ command :
3
+ version : 6
4
+ spokenForm : change lambda
5
+ action :
6
+ name : clearAndSetSelection
7
+ target :
8
+ type : primitive
9
+ modifiers :
10
+ - type : containingScope
11
+ scopeType : {type: anonymousFunction}
12
+ usePrePhraseSnapshot : true
13
+ initialState :
14
+ documentContents : |-
15
+ function makeCounter()
16
+ local count = 0
17
+ return function()
18
+ count = count + 1
19
+ return count
20
+ end
21
+ end
22
+ selections :
23
+ - anchor : {line: 3, character: 12}
24
+ active : {line: 3, character: 12}
25
+ marks : {}
26
+ finalState :
27
+ documentContents : |-
28
+ function makeCounter()
29
+ local count = 0
30
+ return
31
+ end
32
+ selections :
33
+ - anchor : {line: 2, character: 11}
34
+ active : {line: 2, character: 11}
Original file line number Diff line number Diff line change
1
+ languageId : lua
2
+ command :
3
+ version : 6
4
+ spokenForm : change list
5
+ action :
6
+ name : clearAndSetSelection
7
+ target :
8
+ type : primitive
9
+ modifiers :
10
+ - type : containingScope
11
+ scopeType : {type: list}
12
+ usePrePhraseSnapshot : true
13
+ initialState :
14
+ documentContents : |-
15
+ local person = {
16
+ name = "John",
17
+ age = 30,
18
+ hobbies = {"reading", "gaming", "programming"},
19
+ address = {
20
+ street = "123 Main St",
21
+ city = "Example City"
22
+ }
23
+ }
24
+ selections :
25
+ - anchor : {line: 3, character: 17}
26
+ active : {line: 3, character: 17}
27
+ marks : {}
28
+ finalState :
29
+ documentContents : |-
30
+ local person = {
31
+ name = "John",
32
+ age = 30,
33
+ hobbies = ,
34
+ address = {
35
+ street = "123 Main St",
36
+ city = "Example City"
37
+ }
38
+ }
39
+ selections :
40
+ - anchor : {line: 3, character: 14}
41
+ active : {line: 3, character: 14}
Original file line number Diff line number Diff line change
1
+ languageId : lua
2
+ command :
3
+ version : 6
4
+ spokenForm : change state
5
+ action :
6
+ name : clearAndSetSelection
7
+ target :
8
+ type : primitive
9
+ modifiers :
10
+ - type : containingScope
11
+ scopeType : {type: statement}
12
+ usePrePhraseSnapshot : true
13
+ initialState :
14
+ documentContents : |-
15
+ function makeCounter()
16
+ local count = 0
17
+ return function()
18
+ count = count + 1
19
+ return count
20
+ end
21
+ end
22
+ selections :
23
+ - anchor : {line: 1, character: 12}
24
+ active : {line: 1, character: 12}
25
+ marks : {}
26
+ finalState :
27
+ documentContents : |-
28
+ function makeCounter()
29
+
30
+ return function()
31
+ count = count + 1
32
+ return count
33
+ end
34
+ end
35
+ selections :
36
+ - anchor : {line: 1, character: 4}
37
+ active : {line: 1, character: 4}
Original file line number Diff line number Diff line change
1
+ languageId : lua
2
+ command :
3
+ version : 6
4
+ spokenForm : change state
5
+ action :
6
+ name : clearAndSetSelection
7
+ target :
8
+ type : primitive
9
+ modifiers :
10
+ - type : containingScope
11
+ scopeType : {type: statement}
12
+ usePrePhraseSnapshot : true
13
+ initialState :
14
+ documentContents : |-
15
+ function makeCounter()
16
+ local count = 0
17
+ return function()
18
+ count = count + 1
19
+ return count
20
+ end
21
+ end
22
+ selections :
23
+ - anchor : {line: 2, character: 8}
24
+ active : {line: 2, character: 8}
25
+ marks : {}
26
+ finalState :
27
+ documentContents : |-
28
+ function makeCounter()
29
+ local count = 0
30
+
31
+ end
32
+ selections :
33
+ - anchor : {line: 2, character: 4}
34
+ active : {line: 2, character: 4}
Original file line number Diff line number Diff line change
1
+ languageId : lua
2
+ command :
3
+ version : 6
4
+ spokenForm : change state
5
+ action :
6
+ name : clearAndSetSelection
7
+ target :
8
+ type : primitive
9
+ modifiers :
10
+ - type : containingScope
11
+ scopeType : {type: statement}
12
+ usePrePhraseSnapshot : true
13
+ initialState :
14
+ documentContents : |-
15
+ function makeCounter()
16
+ local count = 0
17
+ return function()
18
+ count = count + 1
19
+ return count
20
+ end
21
+ end
22
+ selections :
23
+ - anchor : {line: 3, character: 11}
24
+ active : {line: 3, character: 11}
25
+ marks : {}
26
+ finalState :
27
+ documentContents : |-
28
+ function makeCounter()
29
+ local count = 0
30
+ return function()
31
+
32
+ return count
33
+ end
34
+ end
35
+ selections :
36
+ - anchor : {line: 3, character: 8}
37
+ active : {line: 3, character: 8}
Original file line number Diff line number Diff line change
1
+ languageId : lua
2
+ command :
3
+ version : 6
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
+ local person = {
16
+ name = "John",
17
+ age = 30,
18
+ hobbies = {"reading", "gaming", "programming"},
19
+ address = {
20
+ street = "123 Main St",
21
+ city = "Example City"
22
+ }
23
+ }
24
+ selections :
25
+ - anchor : {line: 4, character: 10}
26
+ active : {line: 4, character: 10}
27
+ marks : {}
28
+ finalState :
29
+ documentContents : |-
30
+ local person = {
31
+ name = "John",
32
+ age = 30,
33
+ hobbies = {"reading", "gaming", "programming"},
34
+ address =
35
+ }
36
+ selections :
37
+ - anchor : {line: 4, character: 14}
38
+ active : {line: 4, character: 14}
Original file line number Diff line number Diff line change
1
+ languageId : lua
2
+ command :
3
+ version : 6
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
+ local person = {
16
+ name = "John",
17
+ age = 30,
18
+ hobbies = {"reading", "gaming", "programming"},
19
+ address = {
20
+ street = "123 Main St",
21
+ city = "Example City"
22
+ }
23
+ }
24
+ selections :
25
+ - anchor : {line: 5, character: 11}
26
+ active : {line: 5, character: 11}
27
+ marks : {}
28
+ finalState :
29
+ documentContents : |-
30
+ local person = {
31
+ name = "John",
32
+ age = 30,
33
+ hobbies = {"reading", "gaming", "programming"},
34
+ address = {
35
+ street = ,
36
+ city = "Example City"
37
+ }
38
+ }
39
+ selections :
40
+ - anchor : {line: 5, character: 17}
41
+ active : {line: 5, character: 17}
Original file line number Diff line number Diff line change 1
1
;; Statements
2
2
[
3
+ (variable_declaration)
3
4
(break_statement)
4
5
(do_statement)
5
6
(elseif_statement)
12
13
(repeat_statement)
13
14
(return_statement)
14
15
(while_statement)
15
- (variable_declaration)
16
- ;; TODO: These will be too aggressive in assignments, need to check parent node isn't
17
- ;; a variable declaration, etc
18
- (function_declaration)
19
- (function_call)
20
- ;; Missing call
21
16
] @statement
22
- (chunk) @statement.iteration
17
+
18
+ ;; Only treat function declarions and calls as statements if they
19
+ ;; aren't part of assignments, etc
20
+ (
21
+ [
22
+ (function_declaration)
23
+ (function_call)
24
+ ] @statement
25
+ (#not-parent-type? @statement expression_list)
26
+ )
27
+ [
28
+ (block)
29
+ (chunk)
30
+ ] @statement.iteration
31
+
32
+ ;; Capture assignment only if without variable prefix
33
+ ;; !! count = count + 1
34
+ ;; ! ^^^^^^^^^^^^^^^^^
35
+ (
36
+ (assignment_statement) @statement
37
+ (#not-parent-type? @statement variable_declaration)
38
+ )
23
39
24
40
;; Conditionals
25
41
(
37
53
] @branch
38
54
39
55
;; Lists and maps
40
- (table_constructor) @map
56
+ (table_constructor) @map @collectionKey.iteration
57
+ (field
58
+ name: (_) @collectionKey
59
+ ) @_.domain
60
+ (field
61
+ value: (_) @value
62
+ ) @_.domain
63
+ ;; In lua everything is a map, but a map that omits keys for entries
64
+ ;; is similar enough to a list to warrant having that scope.
65
+ (table_constructor
66
+ (field
67
+ !name
68
+ )
69
+ ) @list
41
70
42
71
;; Strings
43
72
You can’t perform that action at this time.
0 commit comments