-
-
Notifications
You must be signed in to change notification settings - Fork 91
Added iteration scope for python arguments #2757
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
aaa(bbb=0, ccc=1) | ||
--- | ||
|
||
[#1 Range] = | ||
[#1 Domain] = 0:0-0:17 | ||
>-----------------< | ||
0| aaa(bbb=0, ccc=1) | ||
|
||
|
||
[#2 Range] = 0:4-0:16 | ||
>------------< | ||
0| aaa(bbb=0, ccc=1) | ||
|
||
[#2 Domain] = 0:3-0:17 | ||
>--------------< | ||
0| aaa(bbb=0, ccc=1) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
aaa(bbb=0, ccc=1) | ||
--- | ||
|
||
[#1 Content] = | ||
[#1 Removal] = 0:4-0:7 | ||
>---< | ||
0| aaa(bbb=0, ccc=1) | ||
|
||
[#1 Domain] = 0:4-0:9 | ||
>-----< | ||
0| aaa(bbb=0, ccc=1) | ||
|
||
[#1 Insertion delimiter] = " " | ||
|
||
|
||
[#2 Content] = | ||
[#2 Removal] = 0:11-0:14 | ||
>---< | ||
0| aaa(bbb=0, ccc=1) | ||
|
||
[#2 Leading delimiter] = 0:10-0:11 | ||
>-< | ||
0| aaa(bbb=0, ccc=1) | ||
|
||
[#2 Domain] = 0:11-0:16 | ||
>-----< | ||
0| aaa(bbb=0, ccc=1) | ||
|
||
[#2 Insertion delimiter] = " " |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
aaa(bbb=0, ccc=1) | ||
--- | ||
|
||
[#1 Range] = | ||
[#1 Domain] = 0:0-0:17 | ||
>-----------------< | ||
0| aaa(bbb=0, ccc=1) | ||
|
||
|
||
[#2 Range] = 0:4-0:16 | ||
>------------< | ||
0| aaa(bbb=0, ccc=1) | ||
|
||
[#2 Domain] = 0:3-0:17 | ||
>--------------< | ||
0| aaa(bbb=0, ccc=1) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
aaa(bbb=0, ccc=1) | ||
--- | ||
|
||
[#1 Content] = 0:8-0:9 | ||
>-< | ||
0| aaa(bbb=0, ccc=1) | ||
|
||
[#1 Removal] = 0:7-0:9 | ||
>--< | ||
0| aaa(bbb=0, ccc=1) | ||
|
||
[#1 Leading delimiter] = 0:7-0:8 | ||
>-< | ||
0| aaa(bbb=0, ccc=1) | ||
|
||
[#1 Domain] = 0:4-0:9 | ||
>-----< | ||
0| aaa(bbb=0, ccc=1) | ||
|
||
[#1 Insertion delimiter] = " " | ||
|
||
|
||
[#2 Content] = 0:15-0:16 | ||
>-< | ||
0| aaa(bbb=0, ccc=1) | ||
|
||
[#2 Removal] = 0:14-0:16 | ||
>--< | ||
0| aaa(bbb=0, ccc=1) | ||
|
||
[#2 Leading delimiter] = 0:14-0:15 | ||
>-< | ||
0| aaa(bbb=0, ccc=1) | ||
|
||
[#2 Domain] = 0:11-0:16 | ||
>-----< | ||
0| aaa(bbb=0, ccc=1) | ||
|
||
[#2 Insertion delimiter] = " " |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -7,10 +7,16 @@ export const pythonScopeSupport: LanguageScopeSupportFacetMap = { | |||
"name.foreach": supported, | ||||
"name.resource": supported, | ||||
"name.resource.iteration": supported, | ||||
"name.argument.actual": supported, | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NB: we could extend this to other languages that support keyword arguments like ruby, but we need to have familiarity with them. A quick check of Line 4 in b62d901
|
||||
"name.argument.actual.iteration": supported, | ||||
|
||||
"value.foreach": supported, | ||||
"value.yield": supported, | ||||
"value.resource": supported, | ||||
"value.resource.iteration": supported, | ||||
"value.argument.actual": supported, | ||||
"value.argument.actual.iteration": supported, | ||||
|
||||
namedFunction: supported, | ||||
anonymousFunction: supported, | ||||
disqualifyDelimiter: supported, | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -626,9 +626,9 @@ | |
) @argumentOrParameter.iteration.domain | ||
|
||
(argument_list | ||
"(" @argumentOrParameter.iteration.start.endOf | ||
")" @argumentOrParameter.iteration.end.startOf | ||
) @argumentOrParameter.iteration.domain | ||
"(" @argumentOrParameter.iteration.start.endOf @name.iteration.start.endOf @value.iteration.start.endOf | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NB: Andreas says there's a limit of three captures on each node and more are silently discarded by tree-sitter, so beware. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally we should lint this - or adding to SCM tests |
||
")" @argumentOrParameter.iteration.end.startOf @name.iteration.end.startOf @value.iteration.end.startOf | ||
) @argumentOrParameter.iteration.domain @name.iteration.domain @value.iteration.domain | ||
|
||
(call | ||
(generator_expression | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Names come from compiler history -- an "actual" parameter is where it is passed, a formal parameter is where it is defined in the function definition (if there is one)