-
-
Notifications
You must be signed in to change notification settings - Fork 92
Enable initial r support #2721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Enable initial r support #2721
Changes from 23 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
dfe9fcd
Enable initial r support
35f3646
intial supported queries
BlueDrink9 2642bf6
add initial bunch of r scopes
BlueDrink9 84600ff
(r) clean up facet list
BlueDrink9 f8a9222
r: Update tests to include assignment operators
BlueDrink9 4bc8d4f
Correct name and value scopes and queries
BlueDrink9 d34e880
fix namedFunction query
BlueDrink9 c1b1199
Fix function names scope and tests
BlueDrink9 c41875b
Split argument and parameter scope tests and include delimiter inquiry
BlueDrink9 019b000
Split up if statement scope tests
BlueDrink9 bd59837
Merge branch 'main' into main
BlueDrink9 08b911b
Fix tests for trailing and leading delimiter for multiple arguments
BlueDrink9 2e10b93
merge = and <- assignments
BlueDrink9 9a58ae3
tweak parameter queries
BlueDrink9 44425ea
Fix argument test
BlueDrink9 3feb748
Remove unnecessary predicate
BlueDrink9 6f7c455
Update packages/common/src/scopeSupportFacets/r.ts
BlueDrink9 96c316b
Remove blank lines
BlueDrink9 183c335
comment
BlueDrink9 bb1e8fb
update if state tests
BlueDrink9 20a1f3b
Add multiline and formal argument scope tests
BlueDrink9 7536803
update queries to pass tests
BlueDrink9 3bc6b72
Remove function name from argument iteration scope
BlueDrink9 481040e
Return formal demain to the entire function
BlueDrink9 8cbb250
prettier
BlueDrink9 9ce136d
add function name to formal argument iteration domain
BlueDrink9 a48eeab
add r doc
BlueDrink9 f761eef
Update packages/cursorless-org-docs/src/docs/user/languages/r.mdx
AndreasArvidsson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,17 @@ | ||
| lapply(1:10, function(x) x^2) | ||
| --- | ||
|
|
||
| [Content] = | ||
| [Domain] = 0:13-0:28 | ||
| >---------------< | ||
| 0| lapply(1:10, function(x) x^2) | ||
|
|
||
| [Removal] = 0:12-0:28 | ||
| >----------------< | ||
| 0| lapply(1:10, function(x) x^2) | ||
|
|
||
| [Leading delimiter] = 0:12-0:13 | ||
| >-< | ||
| 0| lapply(1:10, function(x) x^2) | ||
|
|
||
| [Insertion delimiter] = "\n" |
This file contains hidden or 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,17 @@ | ||
| foo(x, y) | ||
|
|
||
| --- | ||
|
|
||
| [#1 Range] = 0:4-0:8 | ||
| >----< | ||
| 0| foo(x, y) | ||
|
|
||
| [#1 Domain] = 0:3-0:9 | ||
| >------< | ||
| 0| foo(x, y) | ||
|
|
||
|
|
||
| [#2 Range] = | ||
| [#2 Domain] = 0:4-0:8 | ||
| >----< | ||
| 0| foo(x, y) | ||
This file contains hidden or 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,33 @@ | ||
| func(x, y) | ||
| --- | ||
|
|
||
| [#1 Content] = | ||
| [#1 Domain] = 0:5-0:6 | ||
| >-< | ||
| 0| func(x, y) | ||
|
|
||
| [#1 Removal] = 0:5-0:8 | ||
| >---< | ||
| 0| func(x, y) | ||
|
|
||
| [#1 Trailing delimiter] = 0:6-0:8 | ||
| >--< | ||
| 0| func(x, y) | ||
BlueDrink9 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| [#1 Insertion delimiter] = ", " | ||
|
|
||
|
|
||
| [#2 Content] = | ||
| [#2 Domain] = 0:8-0:9 | ||
| >-< | ||
| 0| func(x, y) | ||
|
|
||
| [#2 Removal] = 0:6-0:9 | ||
| >---< | ||
| 0| func(x, y) | ||
|
|
||
| [#2 Leading delimiter] = 0:6-0:8 | ||
| >--< | ||
| 0| func(x, y) | ||
|
|
||
| [#2 Insertion delimiter] = ", " | ||
This file contains hidden or 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,10 @@ | ||
| func(1) | ||
| --- | ||
|
|
||
| [Content] = | ||
| [Removal] = | ||
| [Domain] = 0:5-0:6 | ||
| >-< | ||
| 0| func(1) | ||
|
|
||
| [Insertion delimiter] = ", " |
This file contains hidden or 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,10 @@ | ||
| func(...) | ||
| --- | ||
|
|
||
| [Content] = | ||
| [Removal] = | ||
| [Domain] = 0:5-0:8 | ||
| >---< | ||
| 0| func(...) | ||
|
|
||
| [Insertion delimiter] = ", " |
This file contains hidden or 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,10 @@ | ||
| func(x=1) | ||
| --- | ||
|
|
||
| [Content] = | ||
| [Removal] = | ||
| [Domain] = 0:5-0:8 | ||
| >---< | ||
| 0| func(x=1) | ||
|
|
||
| [Insertion delimiter] = ", " |
This file contains hidden or 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,45 @@ | ||
| foo( | ||
| x, | ||
| y | ||
| ) | ||
|
|
||
| --- | ||
|
|
||
| [#1 Content] = | ||
| [#1 Domain] = 1:7-1:8 | ||
| >-< | ||
| 1| x, | ||
|
|
||
| [#1 Removal] = 1:7-2:7 | ||
| >-- | ||
| 1| x, | ||
| 2| y | ||
| -------< | ||
|
|
||
| [#1 Trailing delimiter] = 1:8-2:7 | ||
| >- | ||
| 1| x, | ||
| 2| y | ||
| -------< | ||
|
|
||
| [#1 Insertion delimiter] = ",\n" | ||
|
|
||
|
|
||
| [#2 Content] = | ||
| [#2 Domain] = 2:7-2:8 | ||
| >-< | ||
| 2| y | ||
|
|
||
| [#2 Removal] = 1:8-2:8 | ||
| >- | ||
| 1| x, | ||
| 2| y | ||
| --------< | ||
|
|
||
| [#2 Leading delimiter] = 1:8-2:7 | ||
| >- | ||
| 1| x, | ||
| 2| y | ||
| -------< | ||
|
|
||
| [#2 Insertion delimiter] = ",\n" |
This file contains hidden or 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,17 @@ | ||
| abc <- function(x, y){} | ||
|
|
||
| --- | ||
|
|
||
| [#1 Range] = 0:16-0:20 | ||
| >----< | ||
| 0| abc <- function(x, y){} | ||
|
|
||
| [#1 Domain] = 0:15-0:21 | ||
| >------< | ||
| 0| abc <- function(x, y){} | ||
BlueDrink9 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| [#2 Range] = | ||
| [#2 Domain] = 0:16-0:20 | ||
| >----< | ||
| 0| abc <- function(x, y){} | ||
This file contains hidden or 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,33 @@ | ||
| abc <- function(x, y){ } | ||
| --- | ||
|
|
||
| [#1 Content] = | ||
| [#1 Domain] = 0:16-0:17 | ||
| >-< | ||
| 0| abc <- function(x, y){ } | ||
|
|
||
| [#1 Removal] = 0:16-0:19 | ||
| >---< | ||
| 0| abc <- function(x, y){ } | ||
|
|
||
| [#1 Trailing delimiter] = 0:17-0:19 | ||
| >--< | ||
| 0| abc <- function(x, y){ } | ||
|
|
||
| [#1 Insertion delimiter] = ", " | ||
|
|
||
|
|
||
| [#2 Content] = | ||
| [#2 Domain] = 0:19-0:20 | ||
| >-< | ||
| 0| abc <- function(x, y){ } | ||
|
|
||
| [#2 Removal] = 0:17-0:20 | ||
| >---< | ||
| 0| abc <- function(x, y){ } | ||
|
|
||
| [#2 Leading delimiter] = 0:17-0:19 | ||
| >--< | ||
| 0| abc <- function(x, y){ } | ||
|
|
||
| [#2 Insertion delimiter] = ", " |
This file contains hidden or 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,25 @@ | ||
| abc <- function(x, y){ } | ||
| --- | ||
|
|
||
| [#1 Content] = | ||
| [#1 Removal] = 0:16-0:20 | ||
| >----< | ||
| 0| abc <- function(x, y){ } | ||
|
|
||
| [#1 Domain] = 0:0-0:24 | ||
| >------------------------< | ||
| 0| abc <- function(x, y){ } | ||
|
|
||
| [#1 Insertion delimiter] = ", " | ||
|
|
||
|
|
||
| [#2 Content] = | ||
| [#2 Removal] = 0:16-0:20 | ||
| >----< | ||
| 0| abc <- function(x, y){ } | ||
|
|
||
| [#2 Domain] = 0:7-0:24 | ||
| >-----------------< | ||
| 0| abc <- function(x, y){ } | ||
|
|
||
| [#2 Insertion delimiter] = ", " |
This file contains hidden or 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,25 @@ | ||
| abc <- function(){ } | ||
| --- | ||
|
|
||
| [#1 Content] = | ||
| [#1 Removal] = 0:16-0:16 | ||
| >< | ||
| 0| abc <- function(){ } | ||
|
|
||
| [#1 Domain] = 0:0-0:20 | ||
| >--------------------< | ||
| 0| abc <- function(){ } | ||
|
|
||
| [#1 Insertion delimiter] = "" | ||
|
|
||
|
|
||
| [#2 Content] = | ||
| [#2 Removal] = 0:16-0:16 | ||
| >< | ||
| 0| abc <- function(){ } | ||
|
|
||
| [#2 Domain] = 0:7-0:20 | ||
| >-------------< | ||
| 0| abc <- function(){ } | ||
|
|
||
| [#2 Insertion delimiter] = "" |
This file contains hidden or 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,47 @@ | ||
| abc <- function( | ||
| x, | ||
| y | ||
| ){ | ||
| } | ||
| --- | ||
|
|
||
| [#1 Content] = | ||
| [#1 Removal] = 0:16-3:0 | ||
| > | ||
| 0| abc <- function( | ||
| 1| x, | ||
| 2| y | ||
| 3| ){ | ||
| < | ||
|
|
||
| [#1 Domain] = 0:0-4:1 | ||
| >---------------- | ||
| 0| abc <- function( | ||
| 1| x, | ||
| 2| y | ||
| 3| ){ | ||
| 4| } | ||
| -< | ||
|
|
||
| [#1 Insertion delimiter] = ",\n" | ||
|
|
||
|
|
||
| [#2 Content] = | ||
| [#2 Removal] = 0:16-3:0 | ||
| > | ||
| 0| abc <- function( | ||
| 1| x, | ||
| 2| y | ||
| 3| ){ | ||
| < | ||
|
|
||
| [#2 Domain] = 0:7-4:1 | ||
| >--------- | ||
| 0| abc <- function( | ||
| 1| x, | ||
| 2| y | ||
| 3| ){ | ||
| 4| } | ||
| -< | ||
|
|
||
| [#2 Insertion delimiter] = ",\n" |
This file contains hidden or 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,13 @@ | ||
| function(x, y){ } | ||
| --- | ||
|
|
||
| [Content] = | ||
| [Removal] = 0:9-0:13 | ||
| >----< | ||
| 0| function(x, y){ } | ||
|
|
||
| [Domain] = 0:0-0:17 | ||
| >-----------------< | ||
| 0| function(x, y){ } | ||
|
|
||
| [Insertion delimiter] = ", " |
This file contains hidden or 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,10 @@ | ||
| # Hello world | ||
| --- | ||
|
|
||
| [Content] = | ||
| [Removal] = | ||
| [Domain] = 0:0-0:13 | ||
| >-------------< | ||
| 0| # Hello world | ||
|
|
||
| [Insertion delimiter] = "\n" |
This file contains hidden or 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,10 @@ | ||
| lapply(1:10, function(x) x^2) | ||
| --- | ||
|
|
||
| [Content] = | ||
| [Removal] = | ||
| [Domain] = 0:0-0:29 | ||
| >-----------------------------< | ||
| 0| lapply(1:10, function(x) x^2) | ||
|
|
||
| [Insertion delimiter] = " " |
This file contains hidden or 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,10 @@ | ||
| lapply(1:10, function(x) x^2) | ||
| --- | ||
|
|
||
| [Content] = | ||
| [Removal] = | ||
| [Domain] = 0:0-0:6 | ||
| >------< | ||
| 0| lapply(1:10, function(x) x^2) | ||
|
|
||
| [Insertion delimiter] = " " |
This file contains hidden or 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,25 @@ | ||
| abc <- function(arg){ | ||
| TRUE | ||
| } | ||
| --- | ||
|
|
||
| [Content] = 0:0-0:3 | ||
| >---< | ||
| 0| abc <- function(arg){ | ||
BlueDrink9 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| [Removal] = 0:0-0:7 | ||
| >-------< | ||
| 0| abc <- function(arg){ | ||
|
|
||
| [Trailing delimiter] = 0:3-0:7 | ||
| >----< | ||
| 0| abc <- function(arg){ | ||
|
|
||
| [Domain] = 0:0-2:1 | ||
| >--------------------- | ||
| 0| abc <- function(arg){ | ||
| 1| TRUE | ||
| 2| } | ||
| -< | ||
|
|
||
| [Insertion delimiter] = " " | ||
This file contains hidden or 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,10 @@ | ||
| if(FALSE) 0 | ||
| --- | ||
|
|
||
| [Content] = | ||
| [Removal] = | ||
| [Domain] = 0:0-0:11 | ||
| >-----------< | ||
| 0| if(FALSE) 0 | ||
|
|
||
| [Insertion delimiter] = "\n" |
This file contains hidden or 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,10 @@ | ||
| if(TRUE){ 1 } | ||
| --- | ||
|
|
||
| [Content] = | ||
| [Removal] = | ||
| [Domain] = 0:0-0:13 | ||
| >-------------< | ||
| 0| if(TRUE){ 1 } | ||
|
|
||
| [Insertion delimiter] = "\n" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.