Skip to content

Commit 06eb81c

Browse files
authored
Changes for tree-sitter 0.21 (#2409)
- Depends on cursorless-dev/vscode-parse-tree#84 - Note that this PR will fail CI until cursorless-dev/vscode-parse-tree#84 has been released ## Checklist - [x] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [-] 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) - [-] I have not broken the cheatsheet
1 parent 1abf38d commit 06eb81c

File tree

26 files changed

+310
-293
lines changed

26 files changed

+310
-293
lines changed

data/fixtures/recorded/languages/php/changeRound.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

data/fixtures/recorded/languages/php/changeRound2.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

data/fixtures/recorded/languages/php/changeRound3.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

data/fixtures/recorded/languages/typescript/changeType9.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

data/fixtures/recorded/languages/typescript/chuckType5.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
"aaa";
3+
'aaa';
4+
`aaa`;
5+
"aaa $bbb ccc"
6+
`aaa $bbb ccc`;
7+
---
8+
9+
[#1 Content] =
10+
[#1 Removal] =
11+
[#1 Domain] = 1:5-1:8
12+
>---<
13+
1| "aaa";
14+
15+
[#1 Insertion delimiter] = " "
16+
17+
18+
[#2 Content] =
19+
[#2 Removal] =
20+
[#2 Domain] = 2:5-2:8
21+
>---<
22+
2| 'aaa';
23+
24+
[#2 Insertion delimiter] = " "
25+
26+
27+
[#3 Content] =
28+
[#3 Removal] =
29+
[#3 Domain] = 3:5-3:8
30+
>---<
31+
3| `aaa`;
32+
33+
[#3 Insertion delimiter] = " "
34+
35+
36+
[#4 Content] =
37+
[#4 Removal] =
38+
[#4 Domain] = 4:5-4:17
39+
>------------<
40+
4| "aaa $bbb ccc"
41+
42+
[#4 Insertion delimiter] = " "
43+
44+
45+
[#5 Content] =
46+
[#5 Removal] =
47+
[#5 Domain] = 5:5-5:17
48+
>------------<
49+
5| `aaa $bbb ccc`;
50+
51+
[#5 Insertion delimiter] = " "
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
aaa as const
2+
---
3+
4+
[Content] = 0:7-0:12
5+
>-----<
6+
0| aaa as const
7+
8+
[Removal] = 0:3-0:12
9+
>---------<
10+
0| aaa as const
11+
12+
[Leading delimiter] = 0:3-0:7
13+
>----<
14+
0| aaa as const
15+
16+
[Domain] = 0:0-0:12
17+
>------------<
18+
0| aaa as const
19+
20+
[Insertion delimiter] = " "

packages/common/src/scopeSupportFacets/php.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;
1111
export const phpScopeSupport: LanguageScopeSupportFacetMap = {
1212
"comment.line": supported,
1313
"comment.block": supported,
14+
"textFragment.string.singleLine": supported,
1415
};

packages/cursorless-engine/src/actions/ShowParseTree.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,6 @@ function parseCursor(
116116
}
117117

118118
function getFieldName(cursor: TreeCursor): string {
119-
const field = cursor.currentFieldName();
119+
const field = cursor.currentFieldName;
120120
return field != null ? `${field}: ` : "";
121121
}

packages/cursorless-engine/src/core/Debug.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export class Debug {
101101
cursor: TreeCursor,
102102
index: number,
103103
) {
104-
const field = cursor.currentFieldName();
104+
const field = cursor.currentFieldName;
105105
const fieldText = field != null ? `${field}: ` : "";
106106
const indent = " ".repeat(index);
107107
const nodeIsLast = index === nodes.length - 1;
@@ -133,7 +133,7 @@ export class Debug {
133133

134134
private cursorGoToChildWithId(cursor: TreeCursor, id: number): boolean {
135135
cursor.gotoFirstChild();
136-
while (cursor.currentNode().id !== id) {
136+
while (cursor.currentNode.id !== id) {
137137
if (!cursor.gotoNextSibling()) {
138138
return false;
139139
}

0 commit comments

Comments
 (0)