on master help sign in
got case matches and do binds working
commit979cc86ee1a8adb29ace6827dcca959ebbbdd346 authorIlya <iko@Shrek.local> dateMon 21 Feb 2022, 19:28 (5 years ago) parente9d579a
1 file changed+69−10
Haskell Language Server.novaextension/Syntaxes/Haskell.xml+69−10
Haskell Language Server.novaextension/Syntaxes/Haskell.xml+69−10
@@ -87,9 +87,8 @@
8787 <include syntax="self" collection="lambda-case" />
8888 <include syntax="self" collection="lambda-head" />
8989 <include syntax="self" collection="type-applications" />
90− <include syntax="self" collection="case-expression" />
90+ <include syntax="self" collection="outer-case-expression" />
9191 <include syntax="self" collection="qvarid" />
92− <include syntax="self" collection="bind-arrow" />
9392 <include syntax="self" collection="tuple" />
9493
9594
@@ -100,13 +99,13 @@
10099
101100 <collection name="pattern-match">
102101 <include syntax="self" collection="literal" />
103− <include syntax="self" collection="view-pattern" />
104102 <include syntax="self" collection="tuple-match" />
105−<!-- <include syntax="self" collection="at-pattern" /> -->
103+ <!-- <include syntax="self" collection="at-pattern" /> -->
106104 <include syntax="self" collection="varid" />
107105 <include syntax="self" collection="qconid" />
108106 <include syntax="self" collection="record-match" />
109107 <include syntax="self" collection="list-pattern" />
108+ <include syntax="self" collection="view-pattern" />
110109 </collection>
111110
112111 <collection name="type-applications">
@@ -285,8 +284,50 @@
285284 <expression>(of)</expression>
286285 <capture number="1" name="haskell.case.keyword.condition" />
287286 </ends-with>
287+ <subscopes anchored="true">
288+ <include syntax="self" collection="pattern-match" />
289+ </subscopes>
290+ </scope>
291+ </collection>
292+
293+ <collection name="case-match">
294+ <scope name="case-match">
295+ <starts-with>
296+ <expression>(?=((\h*)\S.*-&gt;($|\h)))</expression>
297+ </starts-with>
298+ <ends-with>
299+ <expression>-&gt;</expression>
300+ </ends-with>
301+ <subscopes anchored="true">
302+ <include syntax="self" collection="pattern-match" />
303+ </subscopes>
304+ </scope>
305+ </collection>
306+
307+ <collection name="inner-case-expressions">
308+ <scope name="inner-case-expressions">
309+ <starts-with>
310+ <expression>(?=((\h*)\S.*-&gt;($|\h)))</expression>
311+ </starts-with>
312+ <ends-with>
313+ <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
314+ </ends-with>
288315 <subscopes>
289− <include syntax="self" collection="expressions" />
316+ <include syntax="self" collection="case-match" />
317+ <include syntax="self" collection="expressions"/>
318+ </subscopes>
319+ </scope>
320+ </collection>
321+
322+ <collection name="outer-case-expression">
323+ <scope name="outer-case-expression">
324+ <starts-with>
325+ <expression>(?=case)</expression>
326+ </starts-with>
327+ <ends-with />
328+ <subscopes anchored="true" skip-whitespace="false">
329+ <include syntax="self" collection="case-expression" />
330+ <include syntax="self" collection="inner-case-expressions" repeat="true" />
290331 </subscopes>
291332 </scope>
292333 </collection>
@@ -397,17 +438,35 @@
397438 <collection name="do-bind">
398439 <scope name="do-bind">
399440 <starts-with>
400− <expression>^(?=(\h*).+&lt;-($|\h))</expression>
441+ <expression>^(?=((\h*)\S.+&lt;-($|\h)))</expression>
401442 </starts-with>
402443 <ends-with>
403− <template>^(?!\0)(?!\s+\1\S)(?!\s*$)</template>
444+ <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
404445 </ends-with>
405− <subscopes anchored="true">
446+ <subscopes>
447+ <include syntax="self" collection="do-pattern" />
448+ <include syntax="self" collection="expressions" />
449+ <!-- <scope name="bind-arrow">
450+ <expression>&lt;-</expression>
451+ </scope> -->
452+ </subscopes>
453+ </scope>
454+ </collection>
455+
456+ <collection name="do-pattern">
457+ <scope name="do-pattern">
458+ <starts-with>
459+ <expression>^(?=((\h*)\S.+&lt;-($|\h)))</expression>
460+ </starts-with>
461+ <ends-with>
462+ <expression>&lt;-</expression>
463+ </ends-with>
464+ <subscopes>
406465 <include syntax="self" collection="pattern-match" />
407− <scope name="bind-arrow">
466+ <!-- <scope name="bind-arrow">
408467 <expression>&lt;-</expression>
409468 </scope>
410− <include syntax="self" collection="expressions" repeat="true" />
469+ <include syntax="self" collection="expressions" repeat="true" /> -->
411470 </subscopes>
412471 </scope>
413472 </collection>