on master help sign in
data
commitd1749418de17dbb58f16d53031c5a426fe47bf42 authoriko <ilyakooo0@gmail.com> dateWed 16 Mar 2022, 18:11 (5 years ago) parent16bdb29
2 files changed+1020−23
Haskell Language Server.novaextension/Scripts/main.js+1−1 Haskell Language Server.novaextension/Syntaxes/Haskell.xml+1019−22
Haskell Language Server.novaextension/Scripts/main.js+1−1
@@ -23,7 +23,7 @@ exports.activate = function () {
2323 startServer();
2424 });
2525 nova.commands.register("format", formatFile);
26− startServer();
26+ // startServer();
2727};
2828exports.deactivate = function () {
2929 // Clean up state before the extension is deactivated
Haskell Language Server.novaextension/Syntaxes/Haskell.xml+1019−22
@@ -58,7 +58,6 @@
5858 <include syntax="self" collection="pattern-definition" />
5959 <include syntax="self" collection="type-definition" />
6060 <!-- <include syntax="self" collection="type-annotation" /> -->
61− <include syntax="self" collection="data-definition" />
6261 <include syntax="self" collection="GADT-definition" />
6362 <include syntax="self" collection="instance" />
6463 <include syntax="self" collection="typeclass" />
@@ -554,60 +553,1056 @@
554553
555554 <collection name="GADT-definition">
556555 <scope name="haskell.definition.struct.GADT">
556+ <symbol type="struct">
557+ <context behavior="subtree" foldable="false" />
558+ </symbol>
559+ <starts-with>
560+ <expression>^(\h*)(data|newtype)\h+(\w(\w|')*)</expression>
561+ <capture number="2" name="haskell.keyword.construct.data.GADT" />
562+ <capture number="3" name="haskell.identifier.data.type.name" />
563+ </starts-with>
564+ <ends-with>
565+ <template>^(?!\s+\1\S)(?!\s*$)</template>
566+ </ends-with>
567+ <subscopes>
568+ <scope name="haskell.keyword.construct.where">
569+ <expression>where</expression>
570+ </scope>
571+
572+ <include syntax="self" collection="deriving-clause" />
573+ <include syntax="self" collection="record-definition" />
574+ <include syntax="self" collection="gadt-constructor" />
575+ <include syntax="self" collection="type" />
576+ </subscopes>
577+ </scope>
578+ </collection>
579+
580+ <collection name="gadt-constructor">
581+ <scope name="haskell.identifier.type.struct.data.constructor">
582+ <symbol type="constructor">
583+ <context behavior="whitespace" />
584+ </symbol>
585+ <expression>(^|=|\|)\h+([A-Z](\w|')*)</expression>
586+ <capture number="2" name="haskell.identifier.data.name" />
587+ </scope>
588+ <scope name="identifier.type.struct.GADT.constructor">
589+ <symbol type="constructor"></symbol>
590+ <expression>^\h+([A-Z](\w|')*)</expression>
591+ <capture number="1" name="haskell.identifier.data.name" />
592+ </scope>
593+ </collection>
594+
595+ <collection name="deriving-clause">
596+ <scope name="haskell.record.construct.deriving.keyword">
597+ <expression>deriving\h+(newtype|stock|anyclass)</expression>
598+ </scope>
599+ </collection>
600+
601+ <collection name="record-definition">
602+ <scope name="haskell.record">
603+ <symbol>
604+ <context behavior="subtree" foldable="true" />
605+ </symbol>
606+ <starts-with>
607+ <expression>(?=\{)</expression>
608+ <capture number="0" name="haskell.record.bracket" />
609+ </starts-with>
610+ <ends-with>
611+ <expression>(\})</expression>
612+ <capture number="1" name="haskell.record.bracket" />
613+ </ends-with>
614+ <subscopes>
615+ <include syntax="self" collection="record-definition-field-name" />
616+ <include syntax="self" collection="type" />
617+ </subscopes>
618+ </scope>
619+ </collection>
620+
621+ <collection name="record-definition-field-name">
622+ <scope name="haskell.record.definition.property">
623+ <symbol type="property" />
624+ <expression>(((?![A-Z])\w(\w|')*)\h*::|(^|\{|,)\h*((?![A-Z])\w(\w|')*))</expression>
625+ <capture number="5" name="haskell.record.definition.property.field.property.name" />
626+ <capture number="2" name="haskell.record.definition.property.field.property.name" />
627+ </scope>
628+ </collection>
629+
630+ <collection name="type">
631+ <scope name="haskell.type.construct.tuple">
632+ <starts-with>
633+ <expression>\(</expression>
634+ </starts-with>
635+ <ends-with>
636+ <expression>\)</expression>
637+ </ends-with>
638+ <subscopes>
639+ <scope name="haskell.construct.type.typle.comma">
640+ <expression>\,</expression>
641+ </scope>
642+ <include syntax="self" collection="type" />
643+ </subscopes>
644+ </scope>
645+ <scope name="haskell.type.list">
646+ <starts-with>
647+ <expression>'?\[</expression>
648+ </starts-with>
649+ <ends-with>
650+ <expression>\]</expression>
651+ </ends-with>
652+ <subscopes>
653+ <include syntax="self" collection="type" />
654+ </subscopes>
655+ </scope>
656+ <scope name="haskell.type.star">
657+ <expression>\*</expression>
658+ </scope>
659+ <scope name="haskell.keyword.construct.type-annotation-operator">
660+ <expression>::</expression>
661+ </scope>
662+ <include syntax="self" collection="type-list" />
663+ <scope>
664+ <expression>(([A-Z](\w|')*\.)*)'*([A-Z](\w|')*)</expression>
665+ <capture number="1" name="haskell.identifier.package.module" />
666+ <capture number="4" name="haskell.identifier.type" />
667+ </scope>
668+ <scope name="haskell.keyword.construct.forall">
669+ <expression>forall</expression>
670+ </scope>
671+ <scope name="haskell.identifier.type.variable">
672+ <expression>(?!=)((?!(\(|\)|\,))\S)((?!(\(|\)|\,))\S)*</expression>
673+ </scope>
674+ <scope name="haskell.keyword.construct.function-arrow">
675+ <expression>-&gt;</expression>
676+ </scope>
677+ <scope name="haskell.keyword.construct.fat-arrow">
678+ <expression>=&gt;</expression>
679+ </scope>
680+ </collection>
681+
682+ <collection name="pattern-definition">
683+ <scope name="haskell.pattern">
684+ <starts-with>
685+ <expression>^(\h*)(pattern)\h+(\w(\w|')*)</expression>
686+ <capture number="2" name="haskell.keyword.construct.pattern" />
687+ <capture number="3" name="haskell.identifier.decorator.pattern" />
688+ </starts-with>
689+ <ends-with>
690+ <template>^(?!\s+\1\S)(?!\s*$)</template>
691+ </ends-with>
692+ <subscopes>
693+ <scope name="haskell.keyword.construct.where">
694+ <expression>where</expression>
695+ </scope>
696+ <include syntax="self" collection="expressions" />
697+ </subscopes>
698+ </scope>
699+ </collection>
700+
701+ <collection name="type-list">
702+ <scope name="haskell.type-list">
703+ <starts-with>
704+ <expression>('\[)</expression>
705+ <capture number="1" name="haskell.type-list.bracket" />
706+ </starts-with>
707+ <ends-with>
708+ <expression>(\])</expression>
709+ <capture number="1" name="haskell.type-list.bracket" />
710+ </ends-with>
711+ <subscopes>
712+ <include syntax="self" collection="type" />
713+ </subscopes>
714+ </scope>
715+ </collection>
716+
717+ <collection name="lambda-head">
718+ <scope name="haskell.lambda">
719+ <starts-with>
720+ <expression>(\\)</expression>
721+ <capture number="1" name="haskell.keyword.construct.lambda" />
722+ </starts-with>
723+ <ends-with>
724+ <expression>(-&gt;)</expression>
725+ <capture number="1" name="haskell.keyword.construct.lambda" />
726+ </ends-with>
727+ <subscopes>
728+ <include syntax="self" collection="pattern-match" />
729+ </subscopes>
730+ </scope>
731+ </collection>
732+
733+ <collection name="lambda-case">
734+ <scope name="haskell.keyword.condition.lambda-case">
735+ <expression>\\case</expression>
736+ </scope>
737+ </collection>
738+
739+ <collection name="where-clause">
740+ <scope name="haskell.construct.where">
741+ <local scope="within-parent" />
742+ <starts-with>
743+ <expression>^(\h*)(where)</expression>
744+ <capture number="2" name="haskell.construct.keyword.where" />
745+ </starts-with>
746+ <ends-with>
747+ <template>^(?!\1\s*\S)(?!s*$)</template>
748+ </ends-with>
749+ <subscopes>
750+ <include syntax="self" collection="definition" />
751+ </subscopes>
752+ </scope>
753+ </collection>
754+
755+
756+ <collection name="qvarid">
757+ <scope name="haskell.identifier.function">
758+ <expression>(([A-Z](\w|')*\.)*)(\w(\w|')*)</expression>
759+ <capture number="1" name="haskell.identifier.package.module" />
760+ <capture number="4" name="haskell.identifier.type" />
761+ </scope>
762+ </collection>
763+
764+ <collection name="varid">
765+ <scope name="haskell.identifier.variable">
766+ <expression>\w(\w|')*</expression>
767+ </scope>
768+ </collection>
769+
770+ <collection name="qconid">
771+ <scope name="haskell.identifier.type.struct.constructor">
772+ <expression>([A-Z](\w|')*\.)*[A-Z](\w|')*</expression>
773+ </scope>
774+ </collection>
775+
776+ <collection name="qconsym">
777+ <scope name="haskell.identifier.decorator.pattern">
778+ <expression>([A-Z](\w|')*\.):(\w|')*</expression>
779+ </scope>
780+ </collection>
781+
782+ <collection name="literal">
783+ <include syntax="self" collection="number" />
784+ <include syntax="self" collection="strings" />
785+ </collection>
786+
787+
788+ <collection name="strings">
789+ <scope name="haskell.string.double-quoted">
790+ <starts-with>
791+ <expression>"</expression>
792+ </starts-with>
793+ <ends-with>
794+ <expression>"</expression>
795+ </ends-with>
796+ <subscopes>
797+ <scope name="haskell.string.escape-sequences">
798+ <expression>\\.</expression>
799+ </scope>
800+ </subscopes>
801+ </scope>
802+ <scope name="haskell.string.single-quoted">
803+ <expression>'([^'\\]|\\.)'</expression>
804+ </scope>
805+ </collection>
806+
807+
808+ <collection name="number">
809+ <scope name="haskell.value.number">
810+ <expression>(0x|0o|0O|0X)?\d+(\d|_)*(\.[\d|_]+)?((e|E)(\+|-)?\d+)?</expression>
811+ </scope>
812+ </collection>
813+
814+
815+ <collection name="module">
816+ <scope name="haskell.definition.module.package">
817+ <symbol type="package">
818+ <context behavior="subtree" foldable="true" export-local="true" />
819+ </symbol>
820+ <starts-with>
821+ <expression>^(module)\s+((\w|\.)+)</expression>
822+ <capture number="1" name="haskell.construct.keyword.module" />
823+ <capture number="2" name="haskell.definition.module.package" />
824+ </starts-with>
825+ <ends-with>
826+ <expression>(where)</expression>
827+ <capture number="1" name="haskell.construct.keyword.module" />
828+ </ends-with>
829+ <subscopes>
830+ <scope name="identifier.haskell.type">
831+ <symbol type="expression" />
832+ <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
833+ <capture number="1" name="identifier.type" />
834+ </scope>
835+ <scope name="identifier.variable">
836+ <symbol type="expression" />
837+ <expression>(\w|')+</expression>
838+ <capture number="0" name="identifier.haskell.function" />
839+ </scope>
840+ </subscopes>
841+ </scope>
842+ </collection>
843+
844+ <collection name="import">
845+ <scope name="haskell.construct.import">
846+ <starts-with>
847+ <expression>^(import)\s</expression>
848+ <capture number="1" name="haskell.construct.keyword.import" />
849+ </starts-with>
850+ <ends-with>
851+ <expression>(?=^\S)</expression>
852+ </ends-with>
853+ <subscopes>
854+ <scope name="haskell.construct.qualified">
855+ <expression>qualified</expression>
856+ <capture number="0" name="haskell.construct.keyword.qualified" />
857+ </scope>
858+
859+ <scope name="haskell.construct.hiding">
860+ <symbol type="keyword">
861+ <context behavior="subtree" />
862+ </symbol>
863+ <starts-with>
864+ <expression>(hiding)\h*(?=\()</expression>
865+ <capture number="1" name="haskell.construct.keyword.hiding" />
866+ </starts-with>
867+ <ends-with>
868+ <expression>(?=\))</expression>
869+ </ends-with>
870+ <subscopes anchored="true">
871+ <include syntax="self" collection="import-list" />
872+ </subscopes>
873+ </scope>
874+
875+ <scope name="haskell.construct.keyword.as">
876+ <symbol type="package" />
877+ <expression>as(\h+([A-Z]\w*))?</expression>
878+ <capture number="2" name="haskell.package.qualified.name" />
879+ </scope>
880+ <scope name="haskell.identifier.module.package">
881+ <symbol type="package" />
882+ <expression>([A-Z](\w|')*\.)*[A-Z](\w|')*</expression>
883+ <capture number="0" name="haskell.package.name" />
884+ </scope>
885+ <include syntax="self" collection="import-list" />
886+ </subscopes>
887+ </scope>
888+ </collection>
889+
890+ <collection name="import-list">
891+ <scope name="import-list">
892+ <symbol>
893+ <context behavior="subtree" export-local="true" />
894+ </symbol>
895+ <starts-with>
896+ <expression>(\()</expression>
897+ <capture number="1" name="haskell.import-list.bracket" />
898+ </starts-with>
899+ <ends-with>
900+ <expression>(\))</expression>
901+ <capture number="1" name="haskell.import-list.bracket" />
902+ </ends-with>
903+ <subscopes>
904+ <scope name="haskell.identifier.struct">
905+ <symbol type="reference" scope="local" />
906+ <expression>([A-Z](\w|')*)\h*(\(\h*\.\.\h*\))?</expression>
907+ <capture number="1" name="haskell.import-list.identifier.type.name" />
908+ </scope>
909+ <scope name="haskell.identifier.function">
910+ <symbol type="reference" scope="local" />
911+ <expression>(\w|')+</expression>
912+ <capture number="0" name="haskell.import-list.function.name" />
913+ </scope>
914+ </subscopes>
915+ </scope>
916+ </collection>
917+
918+ <!-- <collection name="special">
919+ <scope>
920+ <expression>(;|,)</expression>
921+ </scope>
922+ </collection> -->
923+
924+
925+ <collection name="reservedop">
926+ <scope name="keyword.operator">
927+ <expression>(\.\.|:|::|=|\\|\||&lt;-|-&gt;|@|~|=>)</expression>
928+ </scope>
929+ </collection>
930+
931+ <collection name="keywords">
932+ <scope name="haskell.keyword.modifier">
933+ <symbol type="keyword" />
934+ <strings>
935+ <string>do</string>
936+ <string>in</string>
937+ <string>infix</string>
938+ <string>infixl</string>
939+ <string>infixr</string>
940+ <string>where</string>
941+ <string>let</string>
942+ </strings>
943+ </scope>
944+ <scope name="haskell.keyword.condition">
945+ <symbol type="keyword" />
946+ <strings>
947+ <string>of</string>
948+ <string>case</string>
949+ <string>else</string>
950+ <string>if</string>
951+ <string>then</string>
952+ </strings>
953+ </scope>
954+ <scope name="haskell.keyword.keyword.construct">
955+ <symbol type="keyword" />
956+ <strings>
957+ <string>instance</string>
958+ <string>newtype</string>
959+ <string>module</string>
960+ <string>type</string>
961+ <string>class</string>
962+ <string>data</string>
963+ <string>default</string>
964+ <string>deriving</string>
965+ <string>foreign</string>
966+ </strings>
967+ </scope>
968+ <scope name="haskell.keyword.self">
969+ <symbol type="keyword" />
970+ <strings>
971+ <string>undefined</string>
972+ <string>_</string>
973+ </strings>
974+ </scope>
975+ </collection>
976+
977+ <collection name="comments">
978+ <scope name="haskell.comment.single" spell-check="true">
979+ <starts-with>
980+ <expression>--</expression>
981+ </starts-with>
982+ <ends-with>
983+ <expression>$</expression>
984+ </ends-with>
985+ </scope>
986+ <scope name="haskell.comment.block" spell-check="true">
987+ <starts-with>
988+ <expression>{-</expression>
989+ </starts-with>
990+ <ends-with>
991+ <expression>-}</expression>
992+ </ends-with>
993+ </scope>
994+ </collection>
995+
996+
997+ </collections>
998+</syntax><?xml version="1.0" encoding="UTF-8"?>
999+<syntax name="haskell">
1000+ <meta>
1001+ <name>Haskell</name>
1002+ <type>compiled</type>
1003+ <preferred-file-extension>hs</preferred-file-extension>
1004+ </meta>
1005+
1006+ <detectors>
1007+ <extension priority="1.0">hs</extension>
1008+ </detectors>
1009+
1010+ <comments>
1011+ <single>
1012+ <expression>--</expression>
1013+ </single>
1014+ <multiline>
1015+ <starts-with>
1016+ <expression>{-</expression>
1017+ </starts-with>
1018+ <ends-with>
1019+ <expression>-}</expression>
1020+ </ends-with>
1021+ </multiline>
1022+ </comments>
1023+
1024+ <brackets>
1025+ <pair open="{" close="}" />
1026+ <pair open="[" close="]" />
1027+ <pair open="(" close=")" />
1028+ </brackets>
1029+
1030+ <surrounding-pairs>
1031+ <pair open="[" close="]" />
1032+ <pair open="(" close=")" />
1033+ <pair open="&apos;" close="&apos;" />
1034+ <pair open="&quot;" close="&quot;" />
1035+ <pair open="`" close="`" />
1036+ </surrounding-pairs>
1037+
1038+ <indentation>
1039+ <increase>
1040+ <expression>
1041+ (case|class|do|let|where|=).*
1042+ </expression>
1043+ </increase>
1044+ <decrease>
1045+ <expression>^\\s*(end|done|with|in|else)\\b|^\\s*;;</expression>
1046+ </decrease>
1047+ </indentation>
1048+
1049+
1050+ <scopes>
1051+ <include syntax="self" collection="comments" />
1052+ <include syntax="self" collection="module" />
1053+ <include syntax="self" collection="import" />
1054+ <include syntax="self" collection="type-family-definition" />
1055+ <include syntax="self" collection="pattern-definition" />
1056+ <include syntax="self" collection="type-definition" />
1057+ <!-- <include syntax="self" collection="type-annotation" /> -->
1058+ <include syntax="self" collection="GADT-definition" />
1059+ <include syntax="self" collection="instance" />
1060+ <include syntax="self" collection="typeclass" />
1061+ <include syntax="self" collection="definition" />
1062+ </scopes>
1063+
1064+ <template-scopes>
1065+ <include syntax="self" collection="Quote" />
1066+ <include syntax="self" collection="comments" />
1067+ </template-scopes>
1068+
1069+ <collections>
1070+
1071+
1072+ <collection name="operators">
1073+ <scope name="keyword.modifier">
1074+ <expression>(!|#|\$|%|&amp;|⋆|\+|\.|/|&lt;|=|&gt;|\?|@|\\|\^|\||-|~|:)+</expression>
1075+ </scope>
1076+ </collection>
1077+
1078+ <collection name="expressions">
1079+ <include syntax="self" collection="do-bind" />
1080+ <include syntax="self" collection="literal" />
1081+ <include syntax="self" collection="operators" />
1082+ <include syntax="self" collection="list" />
1083+ <include syntax="self" collection="lambda-case" />
1084+ <include syntax="self" collection="lambda-head" />
1085+ <include syntax="self" collection="type-applications" />
1086+ <include syntax="self" collection="outer-case-expression" />
1087+ <include syntax="self" collection="qvarid" />
1088+ <include syntax="self" collection="tuple" />
1089+
1090+
1091+ <!-- Needed for do binds -->
1092+ <!-- <include syntax="self" collection="pattern-match" /> -->
1093+ </collection>
1094+
1095+ <collection name="pattern-match">
1096+ <include syntax="self" collection="literal" />
1097+ <include syntax="self" collection="tuple-match" />
1098+ <!-- <include syntax="self" collection="at-pattern" /> -->
1099+ <include syntax="self" collection="varid" />
1100+ <include syntax="self" collection="qconid" />
1101+ <include syntax="self" collection="record-match" />
1102+ <include syntax="self" collection="list-pattern" />
1103+ <include syntax="self" collection="view-pattern" />
1104+ </collection>
1105+
1106+ <collection name="type-applications">
1107+ <scope name="type-applications">
1108+ <starts-with>
1109+ <expression>(\s@)\(</expression>
1110+ <capture number="1" name="haskell.keyword.operator.typeapplication" />
1111+ </starts-with>
1112+ <ends-with>
1113+ <expression>)</expression>
1114+ </ends-with>
1115+ <subscopes>
1116+ <include syntax="self" collection="type" />
1117+ </subscopes>
1118+ </scope>
1119+ <scope name="type-applications-single">
1120+ <expression>(@)(\w+)</expression>
1121+ <capture number="1" name="haskell.keyword.operator.typeapplication" />
1122+ <capture number="2" name="haskell.identifier.type" />
1123+ </scope>
1124+ </collection>
1125+
1126+ <collection name="Quote">
1127+ <scope name="haskell.quasiquote.string-template">
1128+ <starts-with>
1129+ <expression>\[((?:\w|')+)\|</expression>
1130+ <capture number="1" name="haskell.identifier.constant" />
1131+ </starts-with>
1132+ <ends-with>
1133+ <expression>\|\]</expression>
1134+ </ends-with>
1135+ <subscopes>
1136+ <scope name="haskell.quasiquote.string-template.value">
1137+ <expression>.+?</expression>
1138+ </scope>
1139+ </subscopes>
1140+ </scope>
1141+ </collection>
1142+
1143+ <collection name="record-match">
1144+ <include syntax="self" collection="qconid" />
1145+ <include syntax="self" collection="record-fields-match" />
1146+ <include syntax="self" collection="record-fields-match-all" />
1147+ </collection>
1148+
1149+
1150+ <collection name="record-fields-match">
1151+ <scope name="record-fields-match">
1152+ <symbol type="expression" />
1153+ <starts-with>
1154+ <expression>(\{)</expression>
1155+ <capture number="1" name="haskell.pattern.record.bracket" />
1156+ </starts-with>
1157+ <ends-with>
1158+ <expression>(\})</expression>
1159+ <capture number="1" name="haskell.pattern.record.bracket" />
1160+ </ends-with>
1161+ <subscopes>
1162+ <include syntax="self" collection="pattern-match" />
1163+ <include syntax="self" collection="varid" />
1164+ <scope name="record-sep">
1165+ <expression>=</expression>
1166+ </scope>
1167+ <scope name="record-sep">
1168+ <expression>,</expression>
1169+ </scope>
1170+ </subscopes>
1171+ </scope>
1172+ </collection>
1173+
1174+ <collection name="record-fields-match-wildcard">
1175+ <scope name="record-fields-match-all">
1176+ <starts-with>
1177+ <expression>(\{)</expression>
1178+ <capture number="1" name="haskell.pattern.record.bracket" />
1179+ </starts-with>
1180+ <ends-with>
1181+ <expression>(\})</expression>
1182+ <capture number="1" name="haskell.pattern.record.bracket" />
1183+ </ends-with>
1184+ <subscopes>
1185+ <scope name="haskell.pattern.record.wildcard">
1186+ <expression>\.\.</expression>
1187+ </scope>
1188+ </subscopes>
1189+ </scope>
1190+ </collection>
1191+
1192+ <collection name="bind-arrow">
1193+ <scope name="haskell.operator.bind-arrow">
1194+ <expression>&lt;-</expression>
1195+ </scope>
1196+ </collection>
1197+
1198+
1199+ <collection name="list">
1200+ <symbol type="expression" />
1201+ <scope name="haskell.list">
1202+ <starts-with>
1203+ <expression>(\[)</expression>
1204+ <capture number="1" name="haskell.list.bracket" />
1205+ </starts-with>
1206+ <ends-with>
1207+ <expression>(\])</expression>
1208+ <capture number="1" name="haskell.list.bracket" />
1209+ </ends-with>
1210+ <subscopes>
1211+ <include syntax="self" collection="expressions" />
1212+ </subscopes>
1213+ </scope>
1214+ </collection>
1215+
1216+ <collection name="list-pattern">
1217+ <symbol type="expression" />
1218+ <scope name="haskell.pattern.list">
1219+ <starts-with>
1220+ <expression>(\[)</expression>
1221+ <capture number="1" name="haskell.pattern.list.bracket" />
1222+ </starts-with>
1223+ <ends-with>
1224+ <expression>(\])</expression>
1225+ <capture number="1" name="haskell.pattern.list.bracket" />
1226+ </ends-with>
1227+ <subscopes>
1228+ <include syntax="self" collection="pattern-match" />
1229+ </subscopes>
1230+ </scope>
1231+ </collection>
1232+
1233+
1234+ <collection name="view-pattern">
1235+ <scope name="haskell.pattern.view">
1236+ <symbol type="expression" />
1237+ <starts-with>
1238+ <expression>(\()</expression>
1239+ <capture number="1" name="haskell.pattern.view.bracket" />
1240+ </starts-with>
1241+ <ends-with>
1242+ <expression>(\))</expression>
1243+ <capture number="1" name="haskell.pattern.view.bracket" />
1244+ </ends-with>
1245+ <subscopes anchored="true">
1246+ <include syntax="self" collection="expressions" />
1247+ <scope name="haskell.pattern.view.operator.arrow">
1248+ <expression>-&gt;</expression>
1249+ </scope>
1250+ <include syntax="self" collection="pattern-match" />
1251+ </subscopes>
1252+ </scope>
1253+ </collection>
1254+
1255+ <collection name="tuple-match">
1256+ <symbol type="expression" />
1257+ <scope name="haskell.pattern.tuple">
1258+ <starts-with>
1259+ <expression>(\()</expression>
1260+ <capture number="1" name="haskell.pattern.tuple.bracket" />
1261+ </starts-with>
1262+ <ends-with>
1263+ <expression>(\))</expression>
1264+ <capture number="1" name="haskell.pattern.tuple.bracket" />
1265+ </ends-with>
1266+ <subscopes>
1267+ <include syntax="self" collection="pattern-match" />
1268+ </subscopes>
1269+ </scope>
1270+ </collection>
1271+
1272+ <collection name="case-expression">
1273+ <scope name="haskell.case">
1274+ <starts-with>
1275+ <expression>(case)</expression>
1276+ <capture number="1" name="haskell.case.keyword.condition" />
1277+ </starts-with>
1278+ <ends-with>
1279+ <expression>(of)</expression>
1280+ <capture number="1" name="haskell.case.keyword.condition" />
1281+ </ends-with>
1282+ <subscopes anchored="true">
1283+ <include syntax="self" collection="pattern-match" />
1284+ </subscopes>
1285+ </scope>
1286+ </collection>
1287+
1288+ <collection name="case-match">
1289+ <scope name="case-match">
1290+ <starts-with>
1291+ <expression>(?=((\h*)\S.*-&gt;($|\h)))</expression>
1292+ </starts-with>
1293+ <ends-with>
1294+ <expression>-&gt;</expression>
1295+ </ends-with>
1296+ <subscopes anchored="true">
1297+ <include syntax="self" collection="pattern-match" />
1298+ </subscopes>
1299+ </scope>
1300+ </collection>
1301+
1302+ <collection name="inner-case-expressions">
1303+ <scope name="inner-case-expressions">
1304+ <starts-with>
1305+ <expression>(?=((\h*)\S.*-&gt;($|\h)))</expression>
1306+ </starts-with>
1307+ <ends-with>
1308+ <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
1309+ </ends-with>
1310+ <subscopes>
1311+ <include syntax="self" collection="case-match" />
1312+ <include syntax="self" collection="expressions" />
1313+ </subscopes>
1314+ </scope>
1315+ </collection>
1316+
1317+ <collection name="outer-case-expression">
1318+ <scope name="outer-case-expression">
5571319 <starts-with>
558− <expression>^(\h*)(data)\h+(\w(\w|')*)</expression>
559− <capture number="2" name="haskell.keyword.construct.data.GADT" />
1320+ <expression>(?=case)</expression>
1321+ </starts-with>
1322+ <ends-with />
1323+ <subscopes anchored="true" skip-whitespace="false">
1324+ <include syntax="self" collection="case-expression" />
1325+ <include syntax="self" collection="inner-case-expressions" repeat="true" />
1326+ </subscopes>
1327+ </scope>
1328+ </collection>
1329+
1330+ <collection name="tuple">
1331+ <symbol type="expression" />
1332+ <scope name="haskell.tuple">
1333+ <starts-with>
1334+ <expression>(\()</expression>
1335+ <capture number="1" name="haskell.tuple.bracket" />
1336+ </starts-with>
1337+ <ends-with>
1338+ <expression>(\))</expression>
1339+ <capture number="1" name="haskell.tuple.bracket" />
1340+ </ends-with>
1341+ <subscopes>
1342+ <include syntax="self" collection="expressions" />
1343+ </subscopes>
1344+ </scope>
1345+ </collection>
1346+
1347+ <collection name="typeclass">
1348+ <symbol type="interface" />
1349+ <scope name="haskell.definition.class">
1350+ <starts-with>
1351+ <expression>^(\h*)(class)($|\h)</expression>
1352+ <capture number="2" name="haskell.keyword.construct.class" />
5601353 </starts-with>
5611354 <ends-with>
5621355 <template>^(?!\s+\1\S)(?!\s*$)</template>
5631356 </ends-with>
5641357 <subscopes>
565− <include syntax="self" collection="gadt-constructor" />
1358+ <scope name="haskell.keyword.construct.where">
1359+ <expression>where</expression>
1360+ </scope>
5661361 <include syntax="self" collection="type" />
567− <include syntax="self" collection="record-definition" />
568− <include syntax="self" collection="record-definition-field-name" />
1362+ <include syntax="self" collection="type-definition" />
1363+ <!-- <include syntax="self" collection="type-annotation" /> -->
1364+ <include syntax="self" collection="definition" />
5691365 </subscopes>
5701366 </scope>
5711367 </collection>
5721368
573− <collection name="gadt-constructor">
574− <scope name="identifier.type.struct.GADT.constructor">
575− <expression>^\h+[A-Z](\w|')*</expression>
1369+ <collection name="instance">
1370+ <scope name="haskell.instance">
1371+ <symbol type="category" />
1372+ <starts-with>
1373+ <expression>^(\h*)(instance)($|\h)</expression>
1374+ <capture number="2" name="haskell.keyword.construct.instance" />
1375+ </starts-with>
1376+ <ends-with>
1377+ <template>^(?!\s+\1\S)(?!\s*$)</template>
1378+ </ends-with>
1379+ <subscopes>
1380+ <scope name="haskell.keyword.construct.where">
1381+ <expression>where</expression>
1382+ </scope>
1383+ <include syntax="self" collection="type" />
1384+ <include syntax="self" collection="type-definition" />
1385+ <include syntax="self" collection="type-annotation" />
1386+ <include syntax="self" collection="definition" />
1387+ </subscopes>
5761388 </scope>
5771389 </collection>
5781390
579− <collection name="data-definition">
580− <scope name="haskell.definition.struct.data">
1391+ <collection name="type-family-definition">
1392+ <scope name="haskell.definition.type-family.type">
1393+ <symbol type="type">
1394+ <context behavior="subtree" foldable="false" />
1395+ </symbol>
5811396 <starts-with>
582− <expression>^(\h*)(data|newtype)\h+(\w(\w|')*)</expression>
583− <capture number="2" name="haskell.keyword.construct.data.newtype" />
1397+ <expression>^(\h*)(type\h+family)</expression>
1398+ <capture number="2" name="haskell.keyword.construct.type-family" />
1399+ </starts-with>
1400+ <ends-with>
1401+ <template>^(?!\s+\1\S)(?!\s*$)</template>
1402+ </ends-with>
1403+ <subscopes anchored="true" skip-whitespace="false">
1404+ <scope name="haskell.type-family.head">
1405+ <starts-with>
1406+ <expression></expression>
1407+ </starts-with>
1408+ <ends-with>
1409+ <expression>where</expression>
1410+ <capture number="0" name="haskell.keyword.construct.where" />
1411+ </ends-with>
1412+ <subscopes anchored="true">
1413+ <scope name="haskell.identifier.type-family.type.name">
1414+ <expression>\S+</expression>
1415+ </scope>
1416+ <include syntax="self" collection="type" repeat="true" optional="true" />
1417+ </subscopes>
1418+ </scope>
1419+
1420+ <include syntax="self" collection="type-family-case-definition" optional="true" repeat="true" />
1421+ </subscopes>
1422+ </scope>
1423+ </collection>
1424+
1425+ <collection name="type-family-case-definition">
1426+ <scope name="haskell.definition.type-family.type.case">
1427+ <starts-with>
1428+ <expression>^(\h*)(?=\S)</expression>
1429+ </starts-with>
1430+ <ends-with>
1431+ <template>^(?!\s+\1\S)(?!\s*$)</template>
1432+ </ends-with>
1433+ <subscopes>
1434+ <include syntax="self" collection="type" optional="true" repeat="true" />
1435+ <scope>
1436+ <expression>=</expression>
1437+ </scope>
1438+ <include syntax="self" collection="type" optional="true" repeat="true" />
1439+ </subscopes>
1440+ </scope>
1441+ </collection>
1442+
1443+ <collection name="definition">
1444+ <scope name="haskell.definition.type.function">
1445+ <symbol type="function">
1446+ <display-name>
1447+ <component selector="haskell.definition.type.function" />
1448+ </display-name>
1449+
1450+ </symbol>
1451+ <starts-with>
1452+ <expression>^(?=(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h))</expression>
1453+ <capture number="2" name="haskell.keyword.construct.default" />
1454+ <capture number="3" name="haskell.identifier.function" />
1455+ </starts-with>
1456+ <ends-with>
1457+ <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
1458+ </ends-with>
1459+ <subscopes>
1460+ <include syntax="self" collection="type-annotation" />
1461+ <include syntax="self" collection="implementation" />
1462+ </subscopes>
1463+ </scope>
1464+ </collection>
1465+
1466+ <collection name="do-bind">
1467+ <scope name="do-bind">
1468+ <starts-with>
1469+ <expression>^(?=((\h*)\S.+&lt;-($|\h)))</expression>
1470+ </starts-with>
1471+ <ends-with>
1472+ <template>^(?!\1)(?!\2\h)(?!\s*$)</template>
1473+ </ends-with>
1474+ <subscopes>
1475+ <include syntax="self" collection="do-pattern" />
1476+ <include syntax="self" collection="expressions" />
1477+ <!-- <scope name="bind-arrow">
1478+ <expression>&lt;-</expression>
1479+ </scope> -->
1480+ </subscopes>
1481+ </scope>
1482+ </collection>
1483+
1484+ <collection name="do-pattern">
1485+ <scope name="do-pattern">
1486+ <starts-with>
1487+ <expression>^(?=((\h*)\S.+&lt;-($|\h)))</expression>
1488+ </starts-with>
1489+ <ends-with>
1490+ <expression>&lt;-</expression>
1491+ </ends-with>
1492+ <subscopes>
1493+ <include syntax="self" collection="pattern-match" />
1494+ <!-- <scope name="bind-arrow">
1495+ <expression>&lt;-</expression>
1496+ </scope>
1497+ <include syntax="self" collection="expressions" repeat="true" /> -->
1498+ </subscopes>
1499+ </scope>
1500+ </collection>
1501+
1502+ <collection name="implementation">
1503+ <scope name="haskell.definition.type.function">
1504+ <local scope="within-construct" />
1505+ <starts-with>
1506+ <expression>^(\h*)(default\h+)?`?(\w(\w|')*)`?($|\h)</expression>
1507+ <capture number="2" name="haskell.keyword.construct.default" />
1508+ <capture number="3" name="haskell.identifier.function" />
1509+ </starts-with>
1510+ <ends-with>
1511+ <template>^(?!\1\3\s)(?!\s+\1\S)(?!\s*$)</template>
1512+ </ends-with>
1513+ <subscopes>
1514+ <include syntax="self" collection="where-clause" />
1515+ <include syntax="self" collection="expressions" />
1516+ </subscopes>
1517+ </scope>
1518+ </collection>
1519+
1520+ <collection name="type-annotation">
1521+ <scope name="haskell.definition.type.function">
1522+ <starts-with>
1523+ <expression>^(\h*)`?(\w(\w|')*)`?\h*::($|\h)</expression>
1524+ <capture number="2" name="haskell.identifier.function" />
1525+ </starts-with>
1526+ <ends-with>
1527+ <template>^(?!\s+\1\S)(?!\s*$)</template>
1528+ </ends-with>
1529+ <subscopes>
1530+ <include syntax="self" collection="type" />
1531+ </subscopes>
1532+ </scope>
1533+ </collection>
1534+
1535+ <collection name="type-definition">
1536+ <scope name="haskell.definition.type">
1537+ <starts-with>
1538+ <expression>^(\h*)(type)\h+(\w(\w|')*)</expression>
1539+ <capture number="2" name="haskell.keyword.construct.type" />
5841540 <capture number="3" name="haskell.identifier.type" />
5851541 </starts-with>
5861542 <ends-with>
5871543 <template>^(?!\s+\1\S)(?!\s*$)</template>
5881544 </ends-with>
5891545 <subscopes>
1546+ <include syntax="self" collection="type" />
1547+ </subscopes>
1548+ </scope>
1549+ </collection>
1550+
1551+ <collection name="GADT-definition">
1552+ <scope name="haskell.definition.struct.GADT">
1553+ <symbol type="struct">
1554+ <context behavior="subtree" foldable="false" />
1555+ </symbol>
1556+ <starts-with>
1557+ <expression>^(\h*)(data|newtype)\h+(\w(\w|')*)</expression>
1558+ <capture number="2" name="haskell.keyword.construct.data.GADT" />
1559+ <capture number="3" name="haskell.identifier.data.type.name" />
1560+ </starts-with>
1561+ <ends-with>
1562+ <template>^(?!\s+\1\S)(?!\s*$)</template>
1563+ </ends-with>
1564+ <subscopes>
1565+ <scope name="haskell.keyword.construct.where">
1566+ <expression>where</expression>
1567+ </scope>
1568+
1569+ <include syntax="self" collection="deriving-clause" />
5901570 <include syntax="self" collection="record-definition" />
591− <include syntax="self" collection="data-constructor" />
1571+ <include syntax="self" collection="gadt-constructor" />
5921572 <include syntax="self" collection="type" />
5931573 </subscopes>
5941574 </scope>
5951575 </collection>
5961576
597− <collection name="data-constructor">
1577+ <collection name="gadt-constructor">
5981578 <scope name="haskell.identifier.type.struct.data.constructor">
599− <expression>=\h+[A-Z](\w|')*</expression>
1579+ <symbol type="constructor">
1580+ <context behavior="whitespace" />
1581+ </symbol>
1582+ <expression>(^|=|\|)\h+([A-Z](\w|')*)</expression>
1583+ <capture number="2" name="haskell.identifier.data.name" />
6001584 </scope>
601− <scope name="haskell.identifier.type.struct.data.constructor">
602− <expression>\|\h+[A-Z](\w|')*</expression>
1585+ <scope name="identifier.type.struct.GADT.constructor">
1586+ <symbol type="constructor"></symbol>
1587+ <expression>^\h+([A-Z](\w|')*)</expression>
1588+ <capture number="1" name="haskell.identifier.data.name" />
1589+ </scope>
1590+ </collection>
1591+
1592+ <collection name="deriving-clause">
1593+ <scope name="haskell.record.construct.deriving.keyword">
1594+ <expression>deriving\h+(newtype|stock|anyclass)</expression>
6031595 </scope>
6041596 </collection>
6051597
6061598 <collection name="record-definition">
6071599 <scope name="haskell.record">
1600+ <symbol>
1601+ <context behavior="subtree" foldable="true" />
1602+ </symbol>
6081603 <starts-with>
609− <expression>(\{)</expression>
610− <capture number="1" name="haskell.record.bracket" />
1604+ <expression>(?=\{)</expression>
1605+ <capture number="0" name="haskell.record.bracket" />
6111606 </starts-with>
6121607 <ends-with>
6131608 <expression>(\})</expression>
@@ -622,7 +1617,10 @@
6221617
6231618 <collection name="record-definition-field-name">
6241619 <scope name="haskell.record.definition.property">
625− <expression>\w(\w|')*\h*::</expression>
1620+ <symbol type="property" />
1621+ <expression>(((?![A-Z])\w(\w|')*)\h*::|(^|\{|,)\h*((?![A-Z])\w(\w|')*))</expression>
1622+ <capture number="5" name="haskell.record.definition.property.field.property.name" />
1623+ <capture number="2" name="haskell.record.definition.property.field.property.name" />
6261624 </scope>
6271625 </collection>
6281626
@@ -954,7 +1952,6 @@
9541952 <symbol type="keyword" />
9551953 <strings>
9561954 <string>instance</string>
957− <string>newtype</string>
9581955 <string>module</string>
9591956 <string>type</string>
9601957 <string>class</string>