Skip to content

Commit bb820ba

Browse files
author
fidgetingbits
committed
lambda interior, actually fix formals, assert domain
1 parent 8253ac3 commit bb820ba

File tree

2 files changed

+36
-9
lines changed

2 files changed

+36
-9
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
languageId: nix
2+
command:
3+
version: 6
4+
spokenForm: change inside lambda
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- {type: interiorOnly}
11+
- type: containingScope
12+
scopeType: {type: anonymousFunction}
13+
usePrePhraseSnapshot: true
14+
initialState:
15+
documentContents: |-
16+
{
17+
x = a: b: a + b;
18+
}
19+
selections:
20+
- anchor: {line: 1, character: 9}
21+
active: {line: 1, character: 9}
22+
marks: {}
23+
finalState:
24+
documentContents: |-
25+
{
26+
x = a: b: ;
27+
}
28+
selections:
29+
- anchor: {line: 1, character: 12}
30+
active: {line: 1, character: 12}

queries/nix.scm

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99
;; file for an example.
1010
(assert_expression
1111
"assert" @statement.start
12-
condition: (_)
12+
condition: (_) @condition
1313
";" @statement.end
14-
body: (_)
15-
)
14+
) @_.domain
1615
(binding_set) @map.iteration @list.iteration @ifStatement.iteration
1716
(source_code) @statement.iteration @map.iteration @comment.iteration
1817

@@ -97,7 +96,7 @@
9796
;;! ^^^^^^^^^^^ Func2 due to currying
9897
(function_expression
9998
universal: (identifier) @argumentOrParameter
100-
body: (_)
99+
body: (_) @anonymousFunction.interior
101100
) @anonymousFunction @argumentOrParameter.iteration
102101

103102
;; We define the named function as the full assignment of the lambda
@@ -114,11 +113,9 @@
114113
) @_.domain
115114

116115
(apply_expression) @functionCall
117-
(formals) @argumentOrParameter.iteration
118-
(formal) @argumentOrParameter
119-
(formals
120-
(ellipses) @argumentOrParameter
121-
)
116+
(function_expression
117+
(formals) @argumentOrParameter
118+
) @_.domain
122119

123120
;; Names and Values
124121

0 commit comments

Comments
 (0)