tm-grammars 1.25.3 → 1.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/grammars/vue.json CHANGED
@@ -55,12 +55,13 @@
55
55
  ]
56
56
  },
57
57
  {
58
- "begin": "([-0-:A-Za-z]+)\\b(?=[^>]*\\blang\\s*=\\s*([\"']?)html\\b\\2)",
58
+ "begin": "(?!template(?![-0-:A-Za-z]))([-0-:A-Za-z]+)\\b(?=[^>]*\\blang\\s*=\\s*([\"']?)html\\b\\2)",
59
59
  "beginCaptures": {
60
60
  "1": {
61
61
  "name": "entity.name.tag.$1.html.vue"
62
62
  }
63
63
  },
64
+ "contentName": "text.html.derivative",
64
65
  "end": "(</)(\\1)\\s*(?=>)",
65
66
  "endCaptures": {
66
67
  "1": {
@@ -75,14 +76,7 @@
75
76
  "include": "#tag-stuff"
76
77
  },
77
78
  {
78
- "begin": "(?<=>)",
79
- "end": "(?=</)",
80
- "name": "text.html.derivative",
81
- "patterns": [
82
- {
83
- "include": "#html-stuff"
84
- }
85
- ]
79
+ "include": "#html-stuff"
86
80
  }
87
81
  ]
88
82
  },
@@ -363,14 +357,24 @@
363
357
  "include": "#tag-stuff"
364
358
  },
365
359
  {
366
- "begin": "(?<=>)",
367
- "end": "(?=</)",
360
+ "begin": "(?<=>)(?=[^\\n]*</script[>\\s])",
361
+ "end": "(?=</script[>\\s])",
368
362
  "name": "source.ts",
369
363
  "patterns": [
370
364
  {
371
365
  "include": "source.ts"
372
366
  }
373
367
  ]
368
+ },
369
+ {
370
+ "begin": "(?<=>)",
371
+ "name": "source.ts",
372
+ "patterns": [
373
+ {
374
+ "include": "source.ts"
375
+ }
376
+ ],
377
+ "while": "^(?!\\s*</script[>\\s])"
374
378
  }
375
379
  ]
376
380
  },
@@ -427,14 +431,24 @@
427
431
  "include": "#tag-stuff"
428
432
  },
429
433
  {
430
- "begin": "(?<=>)",
431
- "end": "(?=</)",
434
+ "begin": "(?<=>)(?=[^\\n]*</script[>\\s])",
435
+ "end": "(?=</script[>\\s])",
432
436
  "name": "source.tsx",
433
437
  "patterns": [
434
438
  {
435
439
  "include": "source.tsx"
436
440
  }
437
441
  ]
442
+ },
443
+ {
444
+ "begin": "(?<=>)",
445
+ "name": "source.tsx",
446
+ "patterns": [
447
+ {
448
+ "include": "source.tsx"
449
+ }
450
+ ],
451
+ "while": "^(?!\\s*</script[>\\s])"
438
452
  }
439
453
  ]
440
454
  },
@@ -685,17 +699,17 @@
685
699
  {
686
700
  "begin": "(?<=>)",
687
701
  "end": "(?=</)",
688
- "name": "source.vue",
702
+ "name": "text.html.vue",
689
703
  "patterns": [
690
704
  {
691
- "include": "source.vue"
705
+ "include": "text.html.vue"
692
706
  }
693
707
  ]
694
708
  }
695
709
  ]
696
710
  },
697
711
  {
698
- "begin": "(template)\\b",
712
+ "begin": "(template)(?=\\s|/?>)",
699
713
  "beginCaptures": {
700
714
  "1": {
701
715
  "name": "entity.name.tag.$1.html.vue"
@@ -716,7 +730,7 @@
716
730
  },
717
731
  {
718
732
  "begin": "(?<=>)",
719
- "end": "(?=</template\\b)",
733
+ "end": "(?=</template[>\\s])",
720
734
  "name": "text.html.derivative",
721
735
  "patterns": [
722
736
  {
@@ -727,7 +741,7 @@
727
741
  ]
728
742
  },
729
743
  {
730
- "begin": "(script)\\b",
744
+ "begin": "(script)(?=\\s|/?>)",
731
745
  "beginCaptures": {
732
746
  "1": {
733
747
  "name": "entity.name.tag.$1.html.vue"
@@ -744,22 +758,12 @@
744
758
  },
745
759
  "patterns": [
746
760
  {
747
- "include": "#tag-stuff"
748
- },
749
- {
750
- "begin": "(?<=>)",
751
- "end": "(?=</script\\b)",
752
- "name": "source.js",
753
- "patterns": [
754
- {
755
- "include": "source.js"
756
- }
757
- ]
761
+ "include": "#multi-line-script-tag-stuff"
758
762
  }
759
763
  ]
760
764
  },
761
765
  {
762
- "begin": "(style)\\b",
766
+ "begin": "(style)(?=\\s|/?>)",
763
767
  "beginCaptures": {
764
768
  "1": {
765
769
  "name": "entity.name.tag.$1.html.vue"
@@ -776,17 +780,7 @@
776
780
  },
777
781
  "patterns": [
778
782
  {
779
- "include": "#tag-stuff"
780
- },
781
- {
782
- "begin": "(?<=>)",
783
- "end": "(?=</style\\b)",
784
- "name": "source.css",
785
- "patterns": [
786
- {
787
- "include": "source.css"
788
- }
789
- ]
783
+ "include": "#multi-line-style-tag-stuff"
790
784
  }
791
785
  ]
792
786
  },
@@ -834,6 +828,246 @@
834
828
  }
835
829
  ]
836
830
  },
831
+ "multi-line-script-tag-stuff": {
832
+ "begin": "\\G",
833
+ "end": "(?=</script[>\\s])",
834
+ "patterns": [
835
+ {
836
+ "begin": "\\G(?!\\blang\\s*=\\s*[\"']?(?:tsx??|jsx|coffee)\\b)",
837
+ "end": "(?=\\blang\\s*=\\s*[\"']?(?:tsx??|jsx|coffee)\\b)|(>)",
838
+ "endCaptures": {
839
+ "1": {
840
+ "name": "punctuation.definition.tag.end.html.vue"
841
+ }
842
+ },
843
+ "name": "meta.tag-stuff",
844
+ "patterns": [
845
+ {
846
+ "include": "#vue-directives"
847
+ },
848
+ {
849
+ "include": "text.html.basic#attribute"
850
+ }
851
+ ]
852
+ },
853
+ {
854
+ "begin": "(?=\\blang\\s*=\\s*[\"']?ts\\b)",
855
+ "end": "(?=</script[>\\s])",
856
+ "patterns": [
857
+ {
858
+ "include": "#tag-stuff"
859
+ },
860
+ {
861
+ "begin": "(?<=>)(?=[^\\n]*</script[>\\s])",
862
+ "end": "(?=</script[>\\s])",
863
+ "name": "source.ts",
864
+ "patterns": [
865
+ {
866
+ "include": "source.ts"
867
+ }
868
+ ]
869
+ },
870
+ {
871
+ "begin": "(?<=>)",
872
+ "name": "source.ts",
873
+ "patterns": [
874
+ {
875
+ "include": "source.ts"
876
+ }
877
+ ],
878
+ "while": "^(?!\\s*</script[>\\s])"
879
+ }
880
+ ]
881
+ },
882
+ {
883
+ "begin": "(?=\\blang\\s*=\\s*[\"']?tsx\\b)",
884
+ "end": "(?=</script[>\\s])",
885
+ "patterns": [
886
+ {
887
+ "include": "#tag-stuff"
888
+ },
889
+ {
890
+ "begin": "(?<=>)(?=[^\\n]*</script[>\\s])",
891
+ "end": "(?=</script[>\\s])",
892
+ "name": "source.tsx",
893
+ "patterns": [
894
+ {
895
+ "include": "source.tsx"
896
+ }
897
+ ]
898
+ },
899
+ {
900
+ "begin": "(?<=>)",
901
+ "name": "source.tsx",
902
+ "patterns": [
903
+ {
904
+ "include": "source.tsx"
905
+ }
906
+ ],
907
+ "while": "^(?!\\s*</script[>\\s])"
908
+ }
909
+ ]
910
+ },
911
+ {
912
+ "begin": "(?=\\blang\\s*=\\s*[\"']?jsx\\b)",
913
+ "end": "(?=</script[>\\s])",
914
+ "patterns": [
915
+ {
916
+ "include": "#tag-stuff"
917
+ },
918
+ {
919
+ "begin": "(?<=>)",
920
+ "end": "(?=</script[>\\s])",
921
+ "name": "source.js.jsx",
922
+ "patterns": [
923
+ {
924
+ "include": "source.js.jsx"
925
+ }
926
+ ]
927
+ }
928
+ ]
929
+ },
930
+ {
931
+ "begin": "(?=\\blang\\s*=\\s*[\"']?coffee\\b)",
932
+ "end": "(?=</script[>\\s])",
933
+ "patterns": [
934
+ {
935
+ "include": "#tag-stuff"
936
+ },
937
+ {
938
+ "begin": "(?<=>)",
939
+ "end": "(?=</script[>\\s])",
940
+ "name": "source.coffee",
941
+ "patterns": [
942
+ {
943
+ "include": "source.coffee"
944
+ }
945
+ ]
946
+ }
947
+ ]
948
+ },
949
+ {
950
+ "begin": "(?<=>)",
951
+ "end": "(?=</script[>\\s])",
952
+ "name": "source.js",
953
+ "patterns": [
954
+ {
955
+ "include": "source.js"
956
+ }
957
+ ]
958
+ }
959
+ ]
960
+ },
961
+ "multi-line-style-tag-stuff": {
962
+ "begin": "\\G",
963
+ "end": "(?=</style[>\\s])",
964
+ "patterns": [
965
+ {
966
+ "begin": "\\G(?!\\blang\\s*=\\s*[\"']?(?:scss|stylus|less|postcss)\\b)",
967
+ "end": "(?=\\blang\\s*=\\s*[\"']?(?:scss|stylus|less|postcss)\\b)|(>)",
968
+ "endCaptures": {
969
+ "1": {
970
+ "name": "punctuation.definition.tag.end.html.vue"
971
+ }
972
+ },
973
+ "name": "meta.tag-stuff",
974
+ "patterns": [
975
+ {
976
+ "include": "#vue-directives"
977
+ },
978
+ {
979
+ "include": "text.html.basic#attribute"
980
+ }
981
+ ]
982
+ },
983
+ {
984
+ "begin": "(?=\\blang\\s*=\\s*[\"']?scss\\b)",
985
+ "end": "(?=</style[>\\s])",
986
+ "patterns": [
987
+ {
988
+ "include": "#tag-stuff"
989
+ },
990
+ {
991
+ "begin": "(?<=>)",
992
+ "end": "(?=</style[>\\s])",
993
+ "name": "source.css.scss",
994
+ "patterns": [
995
+ {
996
+ "include": "source.css.scss"
997
+ }
998
+ ]
999
+ }
1000
+ ]
1001
+ },
1002
+ {
1003
+ "begin": "(?=\\blang\\s*=\\s*[\"']?stylus\\b)",
1004
+ "end": "(?=</style[>\\s])",
1005
+ "patterns": [
1006
+ {
1007
+ "include": "#tag-stuff"
1008
+ },
1009
+ {
1010
+ "begin": "(?<=>)",
1011
+ "end": "(?=</style[>\\s])",
1012
+ "name": "source.stylus",
1013
+ "patterns": [
1014
+ {
1015
+ "include": "source.stylus"
1016
+ }
1017
+ ]
1018
+ }
1019
+ ]
1020
+ },
1021
+ {
1022
+ "begin": "(?=\\blang\\s*=\\s*[\"']?less\\b)",
1023
+ "end": "(?=</style[>\\s])",
1024
+ "patterns": [
1025
+ {
1026
+ "include": "#tag-stuff"
1027
+ },
1028
+ {
1029
+ "begin": "(?<=>)",
1030
+ "end": "(?=</style[>\\s])",
1031
+ "name": "source.css.less",
1032
+ "patterns": [
1033
+ {
1034
+ "include": "source.css.less"
1035
+ }
1036
+ ]
1037
+ }
1038
+ ]
1039
+ },
1040
+ {
1041
+ "begin": "(?=\\blang\\s*=\\s*[\"']?postcss\\b)",
1042
+ "end": "(?=</style[>\\s])",
1043
+ "patterns": [
1044
+ {
1045
+ "include": "#tag-stuff"
1046
+ },
1047
+ {
1048
+ "begin": "(?<=>)",
1049
+ "end": "(?=</style[>\\s])",
1050
+ "name": "source.postcss",
1051
+ "patterns": [
1052
+ {
1053
+ "include": "source.postcss"
1054
+ }
1055
+ ]
1056
+ }
1057
+ ]
1058
+ },
1059
+ {
1060
+ "begin": "(?<=>)",
1061
+ "end": "(?=</style[>\\s])",
1062
+ "name": "source.css",
1063
+ "patterns": [
1064
+ {
1065
+ "include": "source.css"
1066
+ }
1067
+ ]
1068
+ }
1069
+ ]
1070
+ },
837
1071
  "self-closing-tag": {
838
1072
  "begin": "(<)([-0-:A-Za-z]+)(?=([^>]+/>))",
839
1073
  "beginCaptures": {
@@ -908,7 +1142,7 @@
908
1142
  "patterns": [
909
1143
  {
910
1144
  "begin": "\\G",
911
- "end": "(?=/>)|((</)(template))\\b",
1145
+ "end": "(?=/>)|((</)(template)(?=[>\\s]))",
912
1146
  "endCaptures": {
913
1147
  "2": {
914
1148
  "name": "punctuation.definition.tag.begin.html.vue"
@@ -927,7 +1161,7 @@
927
1161
  ]
928
1162
  },
929
1163
  "template-tag-2": {
930
- "begin": "(<)(template)\\b",
1164
+ "begin": "(<)(template)(?=\\s|/?>)",
931
1165
  "beginCaptures": {
932
1166
  "1": {
933
1167
  "name": "punctuation.definition.tag.begin.html.vue"
@@ -946,7 +1180,7 @@
946
1180
  "patterns": [
947
1181
  {
948
1182
  "begin": "\\G",
949
- "end": "(?=/>)|((</)(template))\\b",
1183
+ "end": "(?=/>)|((</)(template)(?=[>\\s]))",
950
1184
  "endCaptures": {
951
1185
  "2": {
952
1186
  "name": "punctuation.definition.tag.begin.html.vue"
@@ -1314,5 +1548,5 @@
1314
1548
  ]
1315
1549
  }
1316
1550
  },
1317
- "scopeName": "source.vue"
1551
+ "scopeName": "text.html.vue"
1318
1552
  }