Skip to content

Commit e1f6322

Browse files
Serialize scope fixtures: Add scope index when we have a target index (#3015)
1 parent a9affbb commit e1f6322

File tree

5 files changed

+33
-28
lines changed

5 files changed

+33
-28
lines changed
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<div>hello</div>
22
---
33

4-
[.1 Content] =
5-
[.1 Removal] = 0:0-0:5
4+
[#1.1 Content] =
5+
[#1.1 Removal] = 0:0-0:5
66
>-----<
77
0| <div>hello</div>
88

9-
[.1 Insertion delimiter] = " "
9+
[#1.1 Insertion delimiter] = " "
1010

11-
[.2 Content] =
12-
[.2 Removal] = 0:10-0:16
11+
[#1.2 Content] =
12+
[#1.2 Removal] = 0:10-0:16
1313
>------<
1414
0| <div>hello</div>
1515

16-
[.2 Insertion delimiter] = " "
16+
[#1.2 Insertion delimiter] = " "
1717

18-
[Domain] = 0:0-0:16
18+
[#1 Domain] = 0:0-0:16
1919
>----------------<
2020
0| <div>hello</div>
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<div>hello</div>
22
---
33

4-
[.1 Content] =
5-
[.1 Removal] = 0:0-0:5
4+
[#1.1 Content] =
5+
[#1.1 Removal] = 0:0-0:5
66
>-----<
77
0| <div>hello</div>
88

9-
[.1 Insertion delimiter] = " "
9+
[#1.1 Insertion delimiter] = " "
1010

11-
[.2 Content] =
12-
[.2 Removal] = 0:10-0:16
11+
[#1.2 Content] =
12+
[#1.2 Removal] = 0:10-0:16
1313
>------<
1414
0| <div>hello</div>
1515

16-
[.2 Insertion delimiter] = " "
16+
[#1.2 Insertion delimiter] = " "
1717

18-
[Domain] = 0:0-0:16
18+
[#1 Domain] = 0:0-0:16
1919
>----------------<
2020
0| <div>hello</div>

data/fixtures/scopes/latex/tags.scope

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,31 @@
33
\end{quote}
44
---
55

6-
[.1 Content] = 0:0-0:13
6+
[#1.1 Content] = 0:0-0:13
77
>-------------<
88
0| \begin{quote}
99

10-
[.1 Removal] = 0:0-1:0
10+
[#1.1 Removal] = 0:0-1:0
1111
>-------------
1212
0| \begin{quote}
1313
1| Hello
1414
<
1515

16-
[.1 Insertion delimiter] = " "
16+
[#1.1 Insertion delimiter] = " "
1717

18-
[.2 Content] = 2:0-2:11
18+
[#1.2 Content] = 2:0-2:11
1919
>-----------<
2020
2| \end{quote}
2121

22-
[.2 Removal] = 1:9-2:11
22+
[#1.2 Removal] = 1:9-2:11
2323
>
2424
1| Hello
2525
2| \end{quote}
2626
-----------<
2727

28-
[.2 Insertion delimiter] = " "
28+
[#1.2 Insertion delimiter] = " "
2929

30-
[Domain] = 0:0-2:11
30+
[#1 Domain] = 0:0-2:11
3131
>-------------
3232
0| \begin{quote}
3333
1| Hello
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<name id="name">Me</name>
22
---
33

4-
[.1 Content] =
5-
[.1 Removal] = 0:0-0:16
4+
[#1.1 Content] =
5+
[#1.1 Removal] = 0:0-0:16
66
>----------------<
77
0| <name id="name">Me</name>
88

9-
[.1 Insertion delimiter] = " "
9+
[#1.1 Insertion delimiter] = " "
1010

11-
[.2 Content] =
12-
[.2 Removal] = 0:18-0:25
11+
[#1.2 Content] =
12+
[#1.2 Removal] = 0:18-0:25
1313
>-------<
1414
0| <name id="name">Me</name>
1515

16-
[.2 Insertion delimiter] = " "
16+
[#1.2 Insertion delimiter] = " "
1717

18-
[Domain] = 0:0-0:25
18+
[#1 Domain] = 0:0-0:25
1919
>-------------------------<
2020
0| <name id="name">Me</name>

packages/cursorless-vscode-e2e/src/suite/serializeScopeFixture.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ function serializeScope(
7171
});
7272
}
7373

74+
// If we're going to add a target number we need a scope number as well.
75+
if (scopeNumber == null) {
76+
scopeNumber = 1;
77+
}
78+
7479
// If we have multiple targets or the domain is not equal to the content range: add domain last
7580
return [
7681
...targets.map((target, index) =>

0 commit comments

Comments
 (0)