-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate PHP statements to treesitter (#1983)
This PR begins the migration of PHP to treesitter. ## 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 --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
- Loading branch information
1 parent
479b67f
commit 1453284
Showing
13 changed files
with
339 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/php/changeFunk2.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
languageId: php | ||
command: | ||
version: 6 | ||
spokenForm: change funk | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: namedFunction} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
<?php | ||
class MyClass | ||
{ | ||
public function helloWorld() | ||
{ | ||
} | ||
} | ||
selections: | ||
- anchor: {line: 6, character: 0} | ||
active: {line: 6, character: 0} | ||
marks: {} | ||
finalState: | ||
documentContents: |- | ||
<?php | ||
class MyClass | ||
{ | ||
} | ||
selections: | ||
- anchor: {line: 4, character: 4} | ||
active: {line: 4, character: 4} |
31 changes: 31 additions & 0 deletions
31
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/php/changeFunk3.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
languageId: php | ||
command: | ||
version: 6 | ||
spokenForm: change funk | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: namedFunction} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
<?php | ||
$myFunk = function() { | ||
}; | ||
selections: | ||
- anchor: {line: 3, character: 0} | ||
active: {line: 3, character: 0} | ||
marks: {} | ||
finalState: | ||
documentContents: |- | ||
<?php | ||
; | ||
selections: | ||
- anchor: {line: 2, character: 0} | ||
active: {line: 2, character: 0} |
29 changes: 29 additions & 0 deletions
29
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/php/changeFunk4.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
languageId: php | ||
command: | ||
version: 6 | ||
spokenForm: change funk | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: namedFunction} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: | | ||
<?php | ||
$myFunk = fn() => 'Hello world'; | ||
selections: | ||
- anchor: {line: 2, character: 24} | ||
active: {line: 2, character: 24} | ||
marks: {} | ||
finalState: | ||
documentContents: | | ||
<?php | ||
; | ||
selections: | ||
- anchor: {line: 2, character: 0} | ||
active: {line: 2, character: 0} |
32 changes: 32 additions & 0 deletions
32
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/php/changeList.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
languageId: php | ||
command: | ||
version: 6 | ||
spokenForm: change list | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: list} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
<?php | ||
$list = [ | ||
'hello', | ||
'world' | ||
]; | ||
selections: | ||
- anchor: {line: 3, character: 8} | ||
active: {line: 3, character: 8} | ||
marks: {} | ||
finalState: | ||
documentContents: |- | ||
<?php | ||
$list = ; | ||
selections: | ||
- anchor: {line: 2, character: 8} | ||
active: {line: 2, character: 8} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/php/changeRound2.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
languageId: php | ||
command: | ||
version: 6 | ||
spokenForm: change round | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: surroundingPair, delimiter: parentheses} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
<?php | ||
"Hello (world)"; | ||
selections: | ||
- anchor: {line: 2, character: 11} | ||
active: {line: 2, character: 11} | ||
marks: {} | ||
finalState: | ||
documentContents: |- | ||
<?php | ||
"Hello "; | ||
selections: | ||
- anchor: {line: 2, character: 7} | ||
active: {line: 2, character: 7} |
29 changes: 29 additions & 0 deletions
29
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/php/changeRound3.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
languageId: php | ||
command: | ||
version: 6 | ||
spokenForm: change round | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: surroundingPair, delimiter: parentheses} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: |- | ||
<?php | ||
`Hello (world)`; | ||
selections: | ||
- anchor: {line: 2, character: 11} | ||
active: {line: 2, character: 11} | ||
marks: {} | ||
finalState: | ||
documentContents: |- | ||
<?php | ||
`Hello `; | ||
selections: | ||
- anchor: {line: 2, character: 7} | ||
active: {line: 2, character: 7} |
29 changes: 29 additions & 0 deletions
29
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/languages/php/changeState.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
languageId: php | ||
command: | ||
version: 6 | ||
spokenForm: change state | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: statement} | ||
usePrePhraseSnapshot: true | ||
initialState: | ||
documentContents: | | ||
<?php | ||
$myVar = 'Hello world'; | ||
selections: | ||
- anchor: {line: 2, character: 3} | ||
active: {line: 2, character: 3} | ||
marks: {} | ||
finalState: | ||
documentContents: |+ | ||
<?php | ||
selections: | ||
- anchor: {line: 2, character: 0} | ||
active: {line: 2, character: 0} |
Oops, something went wrong.