Skip to content

Commit b743acf

Browse files
Remove lambda expression from interior scope (#3025)
This was just implemented and was actually really unintuitive and broke my workflow. Follow up to #3021
1 parent 96f6c83 commit b743acf

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

queries/csharp.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@
255255
;;!! () => 2;
256256
;;! ^
257257
(lambda_expression
258-
body: (_) @value @interior
258+
body: (_) @value
259259
(#not-type? @value block initializer_expression)
260260
) @_.domain
261261

queries/java.scm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,6 @@
134134
name: (_) @name @functionName
135135
) @namedFunction @_.domain
136136

137-
;;!! ((value) -> true)
138-
;;! ^^^^^^^^^^^^^^^
139-
(lambda_expression) @anonymousFunction
140-
141137
;;!! "string"
142138
;;! ^^^^^^^^
143139
(
@@ -537,11 +533,15 @@
537533
(_) @value
538534
) @_.domain
539535

536+
;;!! ((value) -> true)
537+
;;! ^^^^^^^^^^^^^^^
538+
(lambda_expression) @anonymousFunction
539+
540540
;;!! str -> str.length > 0
541541
;;! ^^^^^^^^^^^^^^
542542
;;! ---------------------
543543
(lambda_expression
544-
body: (_) @value @interior
544+
body: (_) @value
545545
(#not-type? @value block)
546546
) @_.domain
547547

queries/javascript.core.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@
457457
;;! ^
458458
;;! --------
459459
(arrow_function
460-
body: (_) @value @interior
460+
body: (_) @value
461461
(#not-type? @value statement_block)
462462
) @_.domain
463463

queries/python.scm

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -406,12 +406,6 @@
406406
function: (_) @functionCallee
407407
) @_.domain
408408

409-
;;!! lambda _: pass
410-
;;! ^^^^^^^^^^^^^^
411-
(lambda
412-
body: (_) @interior
413-
) @anonymousFunction @interior.domain
414-
415409
;;!! match value:
416410
;;! ^^^^^
417411
(match_statement
@@ -726,6 +720,10 @@
726720
(#child-range! @argumentList 1 -2)
727721
) @argumentList.domain @argumentOrParameter.iteration.domain
728722

723+
;;!! lambda _: pass
724+
;;! ^^^^^^^^^^^^^^
725+
(lambda) @anonymousFunction
726+
729727
;;!! lambda a, b: pass
730728
;;! ^^^^
731729
(lambda

0 commit comments

Comments
 (0)