Skip to content

Commit 999d164

Browse files
Update tests with type scope
1 parent 67bbbdd commit 999d164

File tree

10 files changed

+71
-30
lines changed

10 files changed

+71
-30
lines changed

data/fixtures/recorded/languages/rust/changeArgBlueAir.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
languageId: rust
22
command:
33
version: 6
4-
spokenForm: change arg blue air
4+
spokenForm: change type blue air
55
action:
66
name: clearAndSetSelection
77
target:
88
type: primitive
99
modifiers:
1010
- type: containingScope
11-
scopeType: {type: argumentOrParameter}
11+
scopeType: {type: type}
1212
mark: {type: decoratedSymbol, symbolColor: blue, character: a}
1313
usePrePhraseSnapshot: true
1414
initialState:
@@ -21,4 +21,9 @@ initialState:
2121
blue.a:
2222
start: {line: 0, character: 18}
2323
end: {line: 0, character: 19}
24-
thrownError: {name: NoContainingScopeError}
24+
finalState:
25+
documentContents: |
26+
struct S<'a, , T>;
27+
selections:
28+
- anchor: {line: 0, character: 13}
29+
active: {line: 0, character: 13}

data/fixtures/recorded/languages/rust/changeArgSun.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
languageId: rust
22
command:
33
version: 6
4-
spokenForm: change arg sun
4+
spokenForm: change type sun
55
action:
66
name: clearAndSetSelection
77
target:
88
type: primitive
99
modifiers:
1010
- type: containingScope
11-
scopeType: {type: argumentOrParameter}
11+
scopeType: {type: type}
1212
mark: {type: decoratedSymbol, symbolColor: default, character: s}
1313
usePrePhraseSnapshot: true
1414
initialState:
@@ -24,4 +24,4 @@ initialState:
2424
default.s:
2525
start: {line: 0, character: 20}
2626
end: {line: 0, character: 27}
27-
thrownError: {name: NoContainingScopeError}
27+
thrownError: {name: Error}

data/fixtures/recorded/languages/rust/changeArgTrap.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
languageId: rust
22
command:
33
version: 6
4-
spokenForm: change arg trap
4+
spokenForm: change type trap
55
action:
66
name: clearAndSetSelection
77
target:
88
type: primitive
99
modifiers:
1010
- type: containingScope
11-
scopeType: {type: argumentOrParameter}
11+
scopeType: {type: type}
1212
mark: {type: decoratedSymbol, symbolColor: default, character: t}
1313
usePrePhraseSnapshot: true
1414
initialState:
@@ -21,4 +21,9 @@ initialState:
2121
default.t:
2222
start: {line: 0, character: 21}
2323
end: {line: 0, character: 22}
24-
thrownError: {name: NoContainingScopeError}
24+
finalState:
25+
documentContents: |
26+
struct S<'a, 'b: 'a, > {};
27+
selections:
28+
- anchor: {line: 0, character: 21}
29+
active: {line: 0, character: 21}

data/fixtures/recorded/languages/rust/changeArgTrapAndBlueTrap.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
languageId: rust
22
command:
33
version: 6
4-
spokenForm: change arg trap and blue trap
4+
spokenForm: change type trap and blue trap
55
action:
66
name: clearAndSetSelection
77
target:
@@ -10,7 +10,7 @@ command:
1010
- type: primitive
1111
modifiers:
1212
- type: containingScope
13-
scopeType: {type: argumentOrParameter}
13+
scopeType: {type: type}
1414
mark: {type: decoratedSymbol, symbolColor: default, character: t}
1515
- type: primitive
1616
mark: {type: decoratedSymbol, symbolColor: blue, character: t}

data/fixtures/recorded/languages/rust/changeTypeTrap.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,4 @@ initialState:
2424
default.t:
2525
start: {line: 0, character: 17}
2626
end: {line: 0, character: 18}
27-
finalState:
28-
documentContents: |
29-
fn some_function<T: , U: Clone + Debug>(t: &T, u: &U) -> i32 {
30-
}
31-
selections:
32-
- anchor: {line: 0, character: 20}
33-
active: {line: 0, character: 20}
27+
thrownError: {name: Error}

data/fixtures/recorded/languages/rust/chuckArgAir.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
languageId: rust
22
command:
33
version: 6
4-
spokenForm: chuck arg air
4+
spokenForm: chuck type air
55
action:
66
name: remove
77
target:
88
type: primitive
99
modifiers:
1010
- type: containingScope
11-
scopeType: {type: argumentOrParameter}
11+
scopeType: {type: type}
1212
mark: {type: decoratedSymbol, symbolColor: default, character: a}
1313
usePrePhraseSnapshot: true
1414
initialState:
@@ -21,4 +21,9 @@ initialState:
2121
default.a:
2222
start: {line: 0, character: 10}
2323
end: {line: 0, character: 11}
24-
thrownError: {name: NoContainingScopeError}
24+
finalState:
25+
documentContents: |
26+
struct S<'b: 'a, T>;
27+
selections:
28+
- anchor: {line: 1, character: 0}
29+
active: {line: 1, character: 0}

data/fixtures/recorded/languages/rust/chuckArgBlueAir.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
languageId: rust
22
command:
33
version: 6
4-
spokenForm: chuck arg blue air
4+
spokenForm: chuck type blue air
55
action:
66
name: remove
77
target:
88
type: primitive
99
modifiers:
1010
- type: containingScope
11-
scopeType: {type: argumentOrParameter}
11+
scopeType: {type: type}
1212
mark: {type: decoratedSymbol, symbolColor: blue, character: a}
1313
usePrePhraseSnapshot: true
1414
initialState:
@@ -21,4 +21,9 @@ initialState:
2121
blue.a:
2222
start: {line: 0, character: 18}
2323
end: {line: 0, character: 19}
24-
thrownError: {name: NoContainingScopeError}
24+
finalState:
25+
documentContents: |
26+
struct S<'a, T>;
27+
selections:
28+
- anchor: {line: 1, character: 0}
29+
active: {line: 1, character: 0}

data/fixtures/recorded/languages/rust/chuckArgSun2.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
languageId: rust
22
command:
33
version: 6
4-
spokenForm: chuck arg sun
4+
spokenForm: chuck type sun
55
action:
66
name: remove
77
target:
88
type: primitive
99
modifiers:
1010
- type: containingScope
11-
scopeType: {type: argumentOrParameter}
11+
scopeType: {type: type}
1212
mark: {type: decoratedSymbol, symbolColor: default, character: s}
1313
usePrePhraseSnapshot: true
1414
initialState:
@@ -24,4 +24,4 @@ initialState:
2424
default.s:
2525
start: {line: 0, character: 20}
2626
end: {line: 0, character: 27}
27-
thrownError: {name: NoContainingScopeError}
27+
thrownError: {name: Error}

data/fixtures/recorded/languages/rust/chuckArgTrap.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
languageId: rust
22
command:
33
version: 6
4-
spokenForm: chuck arg trap
4+
spokenForm: chuck type trap
55
action:
66
name: remove
77
target:
88
type: primitive
99
modifiers:
1010
- type: containingScope
11-
scopeType: {type: argumentOrParameter}
11+
scopeType: {type: type}
1212
mark: {type: decoratedSymbol, symbolColor: default, character: t}
1313
usePrePhraseSnapshot: true
1414
initialState:
@@ -21,4 +21,9 @@ initialState:
2121
default.t:
2222
start: {line: 0, character: 21}
2323
end: {line: 0, character: 22}
24-
thrownError: {name: NoContainingScopeError}
24+
finalState:
25+
documentContents: |
26+
struct S<'a, 'b: 'a> {};
27+
selections:
28+
- anchor: {line: 1, character: 0}
29+
active: {line: 1, character: 0}

queries/rust.scm

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,28 @@
419419
(#empty-single-multi-delimiter! @argumentList.start.endOf @_dummy "" ", " ",\n")
420420
) @argumentList.domain @argumentOrParameter.iteration.domain
421421

422+
;;!! #[derive(aaa, bbb)]
423+
;;! ^^^ ^^^
424+
(_
425+
(type_parameters
426+
(_)? @_.leading.endOf
427+
.
428+
(_) @type
429+
.
430+
(_)? @_.trailing.startOf
431+
) @_dummy
432+
(#single-or-multi-line-delimiter! @type @_dummy ", " ",\n")
433+
)
434+
435+
;;!! #[derive(aaa, bbb)]
436+
;;! ^^^^^^^^
437+
(_
438+
(type_parameters
439+
"<" @type.iteration.start.endOf
440+
">" @type.iteration.end.startOf
441+
)
442+
) @type.iteration.domain
443+
422444
operator: [
423445
"<"
424446
"<<"

0 commit comments

Comments
 (0)