Skip to content

Commit a5dda9f

Browse files
author
fidgetingbits
committed
Better domains for values in assignments
1 parent 55996cc commit a5dda9f

File tree

2 files changed

+42
-5
lines changed

2 files changed

+42
-5
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
languageId: shellscript
2+
command:
3+
version: 6
4+
spokenForm: chuck value
5+
action:
6+
name: remove
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: value}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: |
15+
local local_var="Local Variable"
16+
selections:
17+
- anchor: {line: 0, character: 0}
18+
active: {line: 0, character: 0}
19+
marks: {}
20+
finalState:
21+
documentContents: |
22+
local local_var
23+
selections:
24+
- anchor: {line: 0, character: 0}
25+
active: {line: 0, character: 0}

queries/shellscript.scm

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,20 @@
180180
;;! ^^^^^
181181
;;! xxxxxx
182182
;;! ---------
183-
(variable_assignment
184-
"=" @value.leading.start.startOf
185-
.
186-
value: (_) @value @value.leading.end.endOf
187-
) @_.domain
183+
(
184+
(variable_assignment
185+
"=" @value.leading.start.startOf
186+
.
187+
value: (_) @value @value.leading.end.endOf
188+
) @dummy @_.domain
189+
(#not-parent-type? @dummy declaration_command)
190+
)
191+
192+
(declaration_command
193+
"local" @_.domain.start.startOf
194+
(variable_assignment
195+
"=" @value.leading.start.startOf
196+
.
197+
value: (_) @value @value.leading.end.endOf
198+
) @_.domain.end.endOf
199+
)

0 commit comments

Comments
 (0)