-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhighlighter_compat_rules.yaml
218 lines (196 loc) · 7.3 KB
/
highlighter_compat_rules.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# Strings used for the "problem" field in popups.
# Each value used for the "change" in the "issues" list must appear here
changes:
# When a structure won't work until a later version
added: Added in fish {}
# When a structure won't behave the way the syntax highlighting shows until a later version
behaviour: Behaviour changed in fish {}
# When a structure was marked for removal
deprecated: Deprecated in fish {}
# When a structure was removed or intentionally broken
removed: Removed in fish {}
# For now I'm only specifying version numbers to two fields (eg "3.0"), under
# the assumption that patch releases (the third field) will never make
# major changes. But, if that ever happens, the compatibility highlighter ought
# to have no problem with it because internally I am always padding out the
# version number to three fields with extra zeroes anyway
# List of conflicting structures between fish versions.
# Each issue must have one or more scope selectors ("selector") used to pick
# candidate structures from the source file. The full text of each
# structure (or the text captured after extending the range of the selector
# by the positive integer "extend" number of characters in both directions)
# is then tested against the given regular expression ("match").
# Alternatively, if the expression is "true" then no testing is done
# and the candidate is immediately accepted. (This is much more
# efficient when possible, because essentially the regex matching is done
# during syntax parsing and optimised by Sublime Text.)
# If the candidate is accepted, then the fish version being
# targeted by the plugin is compared to each individual state
# throughout the "history" of the issue. If a conflict is determined
# (eg, the plugin is targeting fish 2.7 but the issue history indicates
# the structure was only added in fish 3.0) then the full extent of the
# structure will be highlighted. Hovering over the region will reveal
# the "hint" that suggests alternative structures to resolve the conflict
# Important to note: the order of issues is important, as it determines
# which issue will be preferentially drawn in the (uncommon) event that two
# or more issues can all describe the exact same region in a file
issues:
op-cmdsub-in-str:
selector: meta.interpolation.command meta.parens.command-substitution
match: true
history:
- change: added
version: 3.4
hint: Use unquoted as <code>(... | string collect)</code>.
op-cmdsub-with-dollar:
selector: meta.parens.command-substitution.dollar punctuation.definition.variable
match: true
history:
- change: added
version: 3.4
hint: Remove <code>$</code>.
op-bang:
selector: meta.function-call.name keyword.operator.word.bang
match: true
history:
- change: added
version: 3.0
hint: Use <code>not</code>.
op-ampersand-nobg-in-token:
selector: meta.function-call.operator.control.ampersand
extend: 1
match: '\w\&[\w#]'
history:
- change: deprecated
version: 3.4
hint: Consider putting a separator before or after this symbol.
op-double-ampersand:
selector: meta.function-call.operator.control.double-ampersand
match: true
history:
- change: added
version: 3.0
hint: Use <code>; and</code>.
op-double-bar:
selector: meta.function-call.operator.control.double-bar
match: true
history:
- change: added
version: 3.0
hint: Use <code>; or</code>.
op-newline-in-pipeline:
selector: meta.function-call.operator.control.newline.ignored
match: true
history:
- change: added
version: 3.0
hint: Insert <code>\</code>.
op-stderr-nocaret-append:
selector:
- meta.function-call.operator.pipe.stderr.implicit keyword.operator.redirect.write.append
- meta.function-call.operator.redirection.stderr.implicit keyword.operator.redirect.write.append
match: true
history:
- change: deprecated
version: 3.0
hint: Consider using <code>2>></code>.
op-stderr-nocaret-truncate:
selector:
- meta.function-call.operator.pipe.stderr.implicit keyword.operator.redirect.write.truncate
- meta.function-call.operator.redirection.stderr.implicit keyword.operator.redirect.write.truncate
match: true
history:
- change: deprecated
version: 3.0
hint: Consider using <code>2></code>.
op-std-write-file-append:
selector: meta.function-call.operator.redirection.std-write.append
match: true
history:
- change: added
version: 3.1
# Whether you use 2>&1 or 2>>&1 makes no difference in fish
hint: Use <code>>>file 2>&1</code>.
op-std-write-file-truncate:
selector: meta.function-call.operator.redirection.std-write.truncate
match: true
history:
- change: added
version: 3.1
# Whether you use 2>&1 or 2>>&1 makes no difference in fish
hint: Use <code>>file 2>&1</code>.
op-std-write-pipe:
selector: meta.function-call.operator.pipe.std-write
match: true
history:
- change: added
version: 3.1
hint: Use <code>2>&1 >|</code>.
op-qmark-noglob:
selector: keyword.operator.question-mark
match: true
history:
- change: deprecated
version: 3.0
hint: Consider using <code>*</code>.
cmd-brace-expansion:
selector: meta.function-call.name meta.braces.brace-expansion
match: true
history:
- change: added
version: 3.0
hint: Try using <code>eval</code>.
cmd-variable-expansion:
selector: meta.function-call.name meta.variable-expansion
match: true
history:
- change: added
version: 3.0
hint: Try using <code>eval</code>.
cmd-environment:
selector: meta.function-call.environment
match: true
history:
- change: added
version: 3.1
# This is what `VAR=val cmd` is literally equivalent to
hint: Use <code>begin set -lx VAR val; cmd; end</code>.
# This can overlap with arg-braces-empty or arg-braces-non-empty, but it is a more serious issue (results in an error not a warning). Place it above them in this list so that it is drawn preferentially
arg-braces-space:
selector:
- meta.braces.literal.empty.ignored-whitespace
- meta.braces.literal.non-empty.ignored-whitespace
- meta.braces.brace-expansion.ignored-whitespace
match: true
history:
- change: added
version: 3.0
hint: Delete extra spaces.
arg-braces-empty:
selector: meta.braces.literal.empty
match: true
history:
- change: behaviour
version: 3.0
hint: This will expand to an empty string and the braces disappear.
arg-braces-non-empty:
selector: meta.braces.literal.non-empty
match: true
history:
- change: behaviour
version: 3.1
hint: This will expand to its contents and the braces disappear.
arg-process-expansion-last:
selector: meta.function-call.parameter.argument.process-expansion.last
match: true
history:
- change: removed
version: 3.0
hint: Use <code>$last_pid</code>.
arg-process-expansion:
selector: meta.function-call.parameter.argument.process-expansion.other
match: true
history:
- change: removed
version: 3.0
hint: Try using <code>pgrep</code>, etc.