@vue/language-service 1.8.18 → 1.8.20
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/data/language-blocks/en.json +136 -0
- package/data/language-blocks/fr.json +136 -0
- package/data/language-blocks/it.json +830 -0
- package/data/language-blocks/ja.json +136 -0
- package/data/language-blocks/ko.json +136 -0
- package/data/language-blocks/pt.json +136 -0
- package/data/language-blocks/zh-cn.json +136 -0
- package/data/model-modifiers/en.json +24 -0
- package/data/model-modifiers/fr.json +24 -0
- package/data/model-modifiers/it.json +140 -0
- package/data/model-modifiers/ja.json +24 -0
- package/data/model-modifiers/ko.json +24 -0
- package/data/model-modifiers/pt.json +24 -0
- package/data/model-modifiers/zh-cn.json +24 -0
- package/data/template/en.json +209 -1
- package/data/template/fr.json +209 -1
- package/data/template/it.json +1186 -0
- package/data/template/ja.json +209 -1
- package/data/template/ko.json +209 -1
- package/data/template/pt.json +208 -0
- package/data/template/zh-cn.json +209 -1
- package/out/helpers.js +4 -4
- package/out/plugins/data.js +19 -18
- package/out/plugins/vue-directive-comments.js +1 -1
- package/out/plugins/vue-extract-file.js +9 -11
- package/out/plugins/vue-template.js +7 -7
- package/out/plugins/vue-toggle-v-bind-codeaction.js +3 -3
- package/out/plugins/vue.js +1 -1
- package/package.json +8 -8
package/data/template/zh-cn.json
CHANGED
|
@@ -36,6 +36,14 @@
|
|
|
36
36
|
{
|
|
37
37
|
"name": "pt",
|
|
38
38
|
"url": "https://pt.vuejs.org/api/built-in-components.html#transition"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "bn",
|
|
42
|
+
"url": "https://bn.vuejs.org/api/built-in-components.html#transition"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "it",
|
|
46
|
+
"url": "https://it.vuejs.org/api/built-in-components.html#transition"
|
|
39
47
|
}
|
|
40
48
|
]
|
|
41
49
|
},
|
|
@@ -74,6 +82,14 @@
|
|
|
74
82
|
{
|
|
75
83
|
"name": "pt",
|
|
76
84
|
"url": "https://pt.vuejs.org/api/built-in-components.html#transitiongroup"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "bn",
|
|
88
|
+
"url": "https://bn.vuejs.org/api/built-in-components.html#transitiongroup"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "it",
|
|
92
|
+
"url": "https://it.vuejs.org/api/built-in-components.html#transitiongroup"
|
|
77
93
|
}
|
|
78
94
|
]
|
|
79
95
|
},
|
|
@@ -112,6 +128,14 @@
|
|
|
112
128
|
{
|
|
113
129
|
"name": "pt",
|
|
114
130
|
"url": "https://pt.vuejs.org/api/built-in-components.html#keepalive"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"name": "bn",
|
|
134
|
+
"url": "https://bn.vuejs.org/api/built-in-components.html#keepalive"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"name": "it",
|
|
138
|
+
"url": "https://it.vuejs.org/api/built-in-components.html#keepalive"
|
|
115
139
|
}
|
|
116
140
|
]
|
|
117
141
|
},
|
|
@@ -150,6 +174,14 @@
|
|
|
150
174
|
{
|
|
151
175
|
"name": "pt",
|
|
152
176
|
"url": "https://pt.vuejs.org/api/built-in-components.html#teleport"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"name": "bn",
|
|
180
|
+
"url": "https://bn.vuejs.org/api/built-in-components.html#teleport"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"name": "it",
|
|
184
|
+
"url": "https://it.vuejs.org/api/built-in-components.html#teleport"
|
|
153
185
|
}
|
|
154
186
|
]
|
|
155
187
|
},
|
|
@@ -188,6 +220,14 @@
|
|
|
188
220
|
{
|
|
189
221
|
"name": "pt",
|
|
190
222
|
"url": "https://pt.vuejs.org/api/built-in-components.html#suspense"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"name": "bn",
|
|
226
|
+
"url": "https://bn.vuejs.org/api/built-in-components.html#suspense"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"name": "it",
|
|
230
|
+
"url": "https://it.vuejs.org/api/built-in-components.html#suspense"
|
|
191
231
|
}
|
|
192
232
|
]
|
|
193
233
|
},
|
|
@@ -226,6 +266,14 @@
|
|
|
226
266
|
{
|
|
227
267
|
"name": "pt",
|
|
228
268
|
"url": "https://pt.vuejs.org/api/built-in-special-elements.html#component"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"name": "bn",
|
|
272
|
+
"url": "https://bn.vuejs.org/api/built-in-special-elements.html#component"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"name": "it",
|
|
276
|
+
"url": "https://it.vuejs.org/api/built-in-special-elements.html#component"
|
|
229
277
|
}
|
|
230
278
|
]
|
|
231
279
|
},
|
|
@@ -264,6 +312,14 @@
|
|
|
264
312
|
{
|
|
265
313
|
"name": "pt",
|
|
266
314
|
"url": "https://pt.vuejs.org/api/built-in-special-elements.html#slot"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"name": "bn",
|
|
318
|
+
"url": "https://bn.vuejs.org/api/built-in-special-elements.html#slot"
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"name": "it",
|
|
322
|
+
"url": "https://it.vuejs.org/api/built-in-special-elements.html#slot"
|
|
267
323
|
}
|
|
268
324
|
]
|
|
269
325
|
},
|
|
@@ -302,6 +358,14 @@
|
|
|
302
358
|
{
|
|
303
359
|
"name": "pt",
|
|
304
360
|
"url": "https://pt.vuejs.org/api/built-in-special-elements.html#template"
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"name": "bn",
|
|
364
|
+
"url": "https://bn.vuejs.org/api/built-in-special-elements.html#template"
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"name": "it",
|
|
368
|
+
"url": "https://it.vuejs.org/api/built-in-special-elements.html#template"
|
|
305
369
|
}
|
|
306
370
|
]
|
|
307
371
|
}
|
|
@@ -341,6 +405,14 @@
|
|
|
341
405
|
{
|
|
342
406
|
"name": "pt",
|
|
343
407
|
"url": "https://pt.vuejs.org/api/built-in-directives.html#v-text"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"name": "bn",
|
|
411
|
+
"url": "https://bn.vuejs.org/api/built-in-directives.html#v-text"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"name": "it",
|
|
415
|
+
"url": "https://it.vuejs.org/api/built-in-directives.html#v-text"
|
|
344
416
|
}
|
|
345
417
|
]
|
|
346
418
|
},
|
|
@@ -378,6 +450,14 @@
|
|
|
378
450
|
{
|
|
379
451
|
"name": "pt",
|
|
380
452
|
"url": "https://pt.vuejs.org/api/built-in-directives.html#v-html"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"name": "bn",
|
|
456
|
+
"url": "https://bn.vuejs.org/api/built-in-directives.html#v-html"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
"name": "it",
|
|
460
|
+
"url": "https://it.vuejs.org/api/built-in-directives.html#v-html"
|
|
381
461
|
}
|
|
382
462
|
]
|
|
383
463
|
},
|
|
@@ -415,6 +495,14 @@
|
|
|
415
495
|
{
|
|
416
496
|
"name": "pt",
|
|
417
497
|
"url": "https://pt.vuejs.org/api/built-in-directives.html#v-show"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"name": "bn",
|
|
501
|
+
"url": "https://bn.vuejs.org/api/built-in-directives.html#v-show"
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
"name": "it",
|
|
505
|
+
"url": "https://it.vuejs.org/api/built-in-directives.html#v-show"
|
|
418
506
|
}
|
|
419
507
|
]
|
|
420
508
|
},
|
|
@@ -452,6 +540,14 @@
|
|
|
452
540
|
{
|
|
453
541
|
"name": "pt",
|
|
454
542
|
"url": "https://pt.vuejs.org/api/built-in-directives.html#v-if"
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"name": "bn",
|
|
546
|
+
"url": "https://bn.vuejs.org/api/built-in-directives.html#v-if"
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
"name": "it",
|
|
550
|
+
"url": "https://it.vuejs.org/api/built-in-directives.html#v-if"
|
|
455
551
|
}
|
|
456
552
|
]
|
|
457
553
|
},
|
|
@@ -490,6 +586,14 @@
|
|
|
490
586
|
{
|
|
491
587
|
"name": "pt",
|
|
492
588
|
"url": "https://pt.vuejs.org/api/built-in-directives.html#v-else"
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
"name": "bn",
|
|
592
|
+
"url": "https://bn.vuejs.org/api/built-in-directives.html#v-else"
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
"name": "it",
|
|
596
|
+
"url": "https://it.vuejs.org/api/built-in-directives.html#v-else"
|
|
493
597
|
}
|
|
494
598
|
]
|
|
495
599
|
},
|
|
@@ -527,6 +631,14 @@
|
|
|
527
631
|
{
|
|
528
632
|
"name": "pt",
|
|
529
633
|
"url": "https://pt.vuejs.org/api/built-in-directives.html#v-else-if"
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
"name": "bn",
|
|
637
|
+
"url": "https://bn.vuejs.org/api/built-in-directives.html#v-else-if"
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
"name": "it",
|
|
641
|
+
"url": "https://it.vuejs.org/api/built-in-directives.html#v-else-if"
|
|
530
642
|
}
|
|
531
643
|
]
|
|
532
644
|
},
|
|
@@ -564,6 +676,14 @@
|
|
|
564
676
|
{
|
|
565
677
|
"name": "pt",
|
|
566
678
|
"url": "https://pt.vuejs.org/api/built-in-directives.html#v-for"
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
"name": "bn",
|
|
682
|
+
"url": "https://bn.vuejs.org/api/built-in-directives.html#v-for"
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
"name": "it",
|
|
686
|
+
"url": "https://it.vuejs.org/api/built-in-directives.html#v-for"
|
|
567
687
|
}
|
|
568
688
|
]
|
|
569
689
|
},
|
|
@@ -601,6 +721,14 @@
|
|
|
601
721
|
{
|
|
602
722
|
"name": "pt",
|
|
603
723
|
"url": "https://pt.vuejs.org/api/built-in-directives.html#v-on"
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
"name": "bn",
|
|
727
|
+
"url": "https://bn.vuejs.org/api/built-in-directives.html#v-on"
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
"name": "it",
|
|
731
|
+
"url": "https://it.vuejs.org/api/built-in-directives.html#v-on"
|
|
604
732
|
}
|
|
605
733
|
]
|
|
606
734
|
},
|
|
@@ -638,6 +766,14 @@
|
|
|
638
766
|
{
|
|
639
767
|
"name": "pt",
|
|
640
768
|
"url": "https://pt.vuejs.org/api/built-in-directives.html#v-bind"
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
"name": "bn",
|
|
772
|
+
"url": "https://bn.vuejs.org/api/built-in-directives.html#v-bind"
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
"name": "it",
|
|
776
|
+
"url": "https://it.vuejs.org/api/built-in-directives.html#v-bind"
|
|
641
777
|
}
|
|
642
778
|
]
|
|
643
779
|
},
|
|
@@ -675,6 +811,14 @@
|
|
|
675
811
|
{
|
|
676
812
|
"name": "pt",
|
|
677
813
|
"url": "https://pt.vuejs.org/api/built-in-directives.html#v-model"
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
"name": "bn",
|
|
817
|
+
"url": "https://bn.vuejs.org/api/built-in-directives.html#v-model"
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
"name": "it",
|
|
821
|
+
"url": "https://it.vuejs.org/api/built-in-directives.html#v-model"
|
|
678
822
|
}
|
|
679
823
|
]
|
|
680
824
|
},
|
|
@@ -712,6 +856,14 @@
|
|
|
712
856
|
{
|
|
713
857
|
"name": "pt",
|
|
714
858
|
"url": "https://pt.vuejs.org/api/built-in-directives.html#v-slot"
|
|
859
|
+
},
|
|
860
|
+
{
|
|
861
|
+
"name": "bn",
|
|
862
|
+
"url": "https://bn.vuejs.org/api/built-in-directives.html#v-slot"
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
"name": "it",
|
|
866
|
+
"url": "https://it.vuejs.org/api/built-in-directives.html#v-slot"
|
|
715
867
|
}
|
|
716
868
|
]
|
|
717
869
|
},
|
|
@@ -749,6 +901,14 @@
|
|
|
749
901
|
{
|
|
750
902
|
"name": "pt",
|
|
751
903
|
"url": "https://pt.vuejs.org/api/built-in-directives.html#v-pre"
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
"name": "bn",
|
|
907
|
+
"url": "https://bn.vuejs.org/api/built-in-directives.html#v-pre"
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
"name": "it",
|
|
911
|
+
"url": "https://it.vuejs.org/api/built-in-directives.html#v-pre"
|
|
752
912
|
}
|
|
753
913
|
]
|
|
754
914
|
},
|
|
@@ -786,6 +946,14 @@
|
|
|
786
946
|
{
|
|
787
947
|
"name": "pt",
|
|
788
948
|
"url": "https://pt.vuejs.org/api/built-in-directives.html#v-once"
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
"name": "bn",
|
|
952
|
+
"url": "https://bn.vuejs.org/api/built-in-directives.html#v-once"
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
"name": "it",
|
|
956
|
+
"url": "https://it.vuejs.org/api/built-in-directives.html#v-once"
|
|
789
957
|
}
|
|
790
958
|
]
|
|
791
959
|
},
|
|
@@ -823,6 +991,14 @@
|
|
|
823
991
|
{
|
|
824
992
|
"name": "pt",
|
|
825
993
|
"url": "https://pt.vuejs.org/api/built-in-directives.html#v-memo"
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
"name": "bn",
|
|
997
|
+
"url": "https://bn.vuejs.org/api/built-in-directives.html#v-memo"
|
|
998
|
+
},
|
|
999
|
+
{
|
|
1000
|
+
"name": "it",
|
|
1001
|
+
"url": "https://it.vuejs.org/api/built-in-directives.html#v-memo"
|
|
826
1002
|
}
|
|
827
1003
|
]
|
|
828
1004
|
},
|
|
@@ -860,6 +1036,14 @@
|
|
|
860
1036
|
{
|
|
861
1037
|
"name": "pt",
|
|
862
1038
|
"url": "https://pt.vuejs.org/api/built-in-directives.html#v-cloak"
|
|
1039
|
+
},
|
|
1040
|
+
{
|
|
1041
|
+
"name": "bn",
|
|
1042
|
+
"url": "https://bn.vuejs.org/api/built-in-directives.html#v-cloak"
|
|
1043
|
+
},
|
|
1044
|
+
{
|
|
1045
|
+
"name": "it",
|
|
1046
|
+
"url": "https://it.vuejs.org/api/built-in-directives.html#v-cloak"
|
|
863
1047
|
}
|
|
864
1048
|
]
|
|
865
1049
|
},
|
|
@@ -897,6 +1081,14 @@
|
|
|
897
1081
|
{
|
|
898
1082
|
"name": "pt",
|
|
899
1083
|
"url": "https://pt.vuejs.org/api/built-in-special-attributes.html#key"
|
|
1084
|
+
},
|
|
1085
|
+
{
|
|
1086
|
+
"name": "bn",
|
|
1087
|
+
"url": "https://bn.vuejs.org/api/built-in-special-attributes.html#key"
|
|
1088
|
+
},
|
|
1089
|
+
{
|
|
1090
|
+
"name": "it",
|
|
1091
|
+
"url": "https://it.vuejs.org/api/built-in-special-attributes.html#key"
|
|
900
1092
|
}
|
|
901
1093
|
]
|
|
902
1094
|
},
|
|
@@ -934,6 +1126,14 @@
|
|
|
934
1126
|
{
|
|
935
1127
|
"name": "pt",
|
|
936
1128
|
"url": "https://pt.vuejs.org/api/built-in-special-attributes.html#ref"
|
|
1129
|
+
},
|
|
1130
|
+
{
|
|
1131
|
+
"name": "bn",
|
|
1132
|
+
"url": "https://bn.vuejs.org/api/built-in-special-attributes.html#ref"
|
|
1133
|
+
},
|
|
1134
|
+
{
|
|
1135
|
+
"name": "it",
|
|
1136
|
+
"url": "https://it.vuejs.org/api/built-in-special-attributes.html#ref"
|
|
937
1137
|
}
|
|
938
1138
|
]
|
|
939
1139
|
},
|
|
@@ -941,7 +1141,7 @@
|
|
|
941
1141
|
"name": "is",
|
|
942
1142
|
"description": {
|
|
943
1143
|
"kind": "markdown",
|
|
944
|
-
"value": "\n用于绑定[动态组件](https://cn.vuejs.org/guide/essentials/component-basics.html#dynamic-components)。\n\n- **预期**:`string | Component`\n\n- **用于原生元素** <sup class=\"vt-badge\">3.1+</sup>\n\n 当 `is` attribute 用于原生 HTML 元素时,它将被当作 [Customized built-in element](https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-customized-builtin-example),其为原生 web 平台的特性。\n\n 但是,在这种用例中,你可能需要 Vue 用其组件来替换原生元素,如 [DOM
|
|
1144
|
+
"value": "\n用于绑定[动态组件](https://cn.vuejs.org/guide/essentials/component-basics.html#dynamic-components)。\n\n- **预期**:`string | Component`\n\n- **用于原生元素** <sup class=\"vt-badge\">3.1+</sup>\n\n 当 `is` attribute 用于原生 HTML 元素时,它将被当作 [Customized built-in element](https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-customized-builtin-example),其为原生 web 平台的特性。\n\n 但是,在这种用例中,你可能需要 Vue 用其组件来替换原生元素,如 [DOM 内模板解析注意事项](https://cn.vuejs.org/guide/essentials/component-basics.html#in-dom-template-parsing-caveats)所述。你可以在 `is` attribute 的值中加上 `vue:` 前缀,这样 Vue 就会把该元素渲染为 Vue 组件:\n\n ```html\n <table>\n <tr is=\"vue:my-row-component\"></tr>\n </table>\n ```\n\n- **参考**\n\n - [内置特殊元素 - `<component>`](https://cn.vuejs.org/api/built-in-special-elements.html#component)\n - [动态组件](https://cn.vuejs.org/guide/essentials/component-basics.html#dynamic-components)\n"
|
|
945
1145
|
},
|
|
946
1146
|
"references": [
|
|
947
1147
|
{
|
|
@@ -971,6 +1171,14 @@
|
|
|
971
1171
|
{
|
|
972
1172
|
"name": "pt",
|
|
973
1173
|
"url": "https://pt.vuejs.org/api/built-in-special-attributes.html#is"
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
"name": "bn",
|
|
1177
|
+
"url": "https://bn.vuejs.org/api/built-in-special-attributes.html#is"
|
|
1178
|
+
},
|
|
1179
|
+
{
|
|
1180
|
+
"name": "it",
|
|
1181
|
+
"url": "https://it.vuejs.org/api/built-in-special-attributes.html#is"
|
|
974
1182
|
}
|
|
975
1183
|
]
|
|
976
1184
|
}
|
package/out/helpers.js
CHANGED
|
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.getTemplateTagsAndAttrs = exports.getElementAttrs = exports.getComponentNames = exports.getTemplateCtx = exports.getEventsOfTag = exports.getPropsByTag = void 0;
|
|
27
27
|
const vue = __importStar(require("@vue/language-core"));
|
|
28
28
|
const embedded = __importStar(require("@volar/language-core"));
|
|
29
|
-
const
|
|
29
|
+
const computeds_1 = require("computeds");
|
|
30
30
|
const language_core_1 = require("@vue/language-core");
|
|
31
31
|
const shared_1 = require("@vue/shared");
|
|
32
32
|
function getPropsByTag(ts, tsLs, sourceFile, tag, vueCompilerOptions, requiredOnly = false) {
|
|
@@ -209,10 +209,10 @@ function searchVariableDeclarationNode(ts, sourceFile, name) {
|
|
|
209
209
|
const map = new WeakMap();
|
|
210
210
|
function getTemplateTagsAndAttrs(sourceFile) {
|
|
211
211
|
if (!map.has(sourceFile)) {
|
|
212
|
-
const getter = (0,
|
|
212
|
+
const getter = (0, computeds_1.computed)(() => {
|
|
213
213
|
if (!(sourceFile instanceof vue.VueFile))
|
|
214
214
|
return;
|
|
215
|
-
const ast = sourceFile.
|
|
215
|
+
const ast = sourceFile.sfc.template?.ast;
|
|
216
216
|
const tags = new Map();
|
|
217
217
|
if (ast) {
|
|
218
218
|
vue.walkElementNodes(ast, node => {
|
|
@@ -252,7 +252,7 @@ function getTemplateTagsAndAttrs(sourceFile) {
|
|
|
252
252
|
});
|
|
253
253
|
map.set(sourceFile, getter);
|
|
254
254
|
}
|
|
255
|
-
return map.get(sourceFile)
|
|
255
|
+
return map.get(sourceFile)() ?? new Map();
|
|
256
256
|
}
|
|
257
257
|
exports.getTemplateTagsAndAttrs = getTemplateTagsAndAttrs;
|
|
258
258
|
//# sourceMappingURL=helpers.js.map
|
package/out/plugins/data.js
CHANGED
|
@@ -19,6 +19,9 @@ function loadTemplateData(lang) {
|
|
|
19
19
|
else if (lang === 'zh-cn') {
|
|
20
20
|
data = require('../../data/template/zh-cn.json');
|
|
21
21
|
}
|
|
22
|
+
else if (lang === 'it') {
|
|
23
|
+
data = require('../../data/template/it.json');
|
|
24
|
+
}
|
|
22
25
|
else {
|
|
23
26
|
data = require('../../data/template/en.json');
|
|
24
27
|
}
|
|
@@ -41,50 +44,48 @@ function loadTemplateData(lang) {
|
|
|
41
44
|
exports.loadTemplateData = loadTemplateData;
|
|
42
45
|
function loadLanguageBlocks(lang) {
|
|
43
46
|
lang = lang.toLowerCase();
|
|
44
|
-
let data;
|
|
45
47
|
if (lang === 'ja') {
|
|
46
|
-
|
|
48
|
+
return require('../../data/language-blocks/ja.json');
|
|
47
49
|
}
|
|
48
50
|
else if (lang === 'fr') {
|
|
49
|
-
|
|
51
|
+
return require('../../data/language-blocks/fr.json');
|
|
50
52
|
}
|
|
51
53
|
else if (lang === 'ko') {
|
|
52
|
-
|
|
54
|
+
return require('../../data/language-blocks/ko.json');
|
|
53
55
|
}
|
|
54
56
|
else if (lang === 'pt-br') {
|
|
55
|
-
|
|
57
|
+
return require('../../data/language-blocks/pt.json');
|
|
56
58
|
}
|
|
57
59
|
else if (lang === 'zh-cn') {
|
|
58
|
-
|
|
60
|
+
return require('../../data/language-blocks/zh-cn.json');
|
|
59
61
|
}
|
|
60
|
-
else {
|
|
61
|
-
|
|
62
|
+
else if (lang === 'it') {
|
|
63
|
+
return require('../../data/language-blocks/it.json');
|
|
62
64
|
}
|
|
63
|
-
return data;
|
|
65
|
+
return require('../../data/language-blocks/en.json');
|
|
64
66
|
}
|
|
65
67
|
exports.loadLanguageBlocks = loadLanguageBlocks;
|
|
66
68
|
function loadModelModifiersData(lang) {
|
|
67
69
|
lang = lang.toLowerCase();
|
|
68
|
-
let data;
|
|
69
70
|
if (lang === 'ja') {
|
|
70
|
-
|
|
71
|
+
return require('../../data/model-modifiers/ja.json');
|
|
71
72
|
}
|
|
72
73
|
else if (lang === 'fr') {
|
|
73
|
-
|
|
74
|
+
return require('../../data/model-modifiers/fr.json');
|
|
74
75
|
}
|
|
75
76
|
else if (lang === 'ko') {
|
|
76
|
-
|
|
77
|
+
return require('../../data/model-modifiers/ko.json');
|
|
77
78
|
}
|
|
78
79
|
else if (lang === 'pt-br') {
|
|
79
|
-
|
|
80
|
+
return require('../../data/model-modifiers/pt.json');
|
|
80
81
|
}
|
|
81
82
|
else if (lang === 'zh-cn') {
|
|
82
|
-
|
|
83
|
+
return require('../../data/model-modifiers/zh-cn.json');
|
|
83
84
|
}
|
|
84
|
-
else {
|
|
85
|
-
|
|
85
|
+
else if (lang === 'it') {
|
|
86
|
+
return require('../../data/model-modifiers/it.json');
|
|
86
87
|
}
|
|
87
|
-
return data;
|
|
88
|
+
return require('../../data/model-modifiers/en.json');
|
|
88
89
|
}
|
|
89
90
|
exports.loadModelModifiersData = loadModelModifiersData;
|
|
90
91
|
//# sourceMappingURL=data.js.map
|
|
@@ -20,10 +20,9 @@ const create = function () {
|
|
|
20
20
|
return;
|
|
21
21
|
const { sfc } = vueFile;
|
|
22
22
|
const script = sfc.scriptSetup ?? sfc.script;
|
|
23
|
-
|
|
24
|
-
if (!sfc.template || !sfc.templateAst || !script || !scriptAst)
|
|
23
|
+
if (!sfc.template || !script)
|
|
25
24
|
return;
|
|
26
|
-
const templateCodeRange = selectTemplateCode(startOffset, endOffset, sfc.template
|
|
25
|
+
const templateCodeRange = selectTemplateCode(startOffset, endOffset, sfc.template);
|
|
27
26
|
if (!templateCodeRange)
|
|
28
27
|
return;
|
|
29
28
|
return [
|
|
@@ -45,10 +44,9 @@ const create = function () {
|
|
|
45
44
|
const [vueFile] = ctx.documents.getVirtualFileByUri(document.uri);
|
|
46
45
|
const { sfc } = vueFile;
|
|
47
46
|
const script = sfc.scriptSetup ?? sfc.script;
|
|
48
|
-
|
|
49
|
-
if (!sfc.template || !sfc.templateAst || !script || !scriptAst)
|
|
47
|
+
if (!sfc.template || !script)
|
|
50
48
|
return codeAction;
|
|
51
|
-
const templateCodeRange = selectTemplateCode(startOffset, endOffset, sfc.template
|
|
49
|
+
const templateCodeRange = selectTemplateCode(startOffset, endOffset, sfc.template);
|
|
52
50
|
if (!templateCodeRange)
|
|
53
51
|
return codeAction;
|
|
54
52
|
const languageService = ctx.inject('typescript/languageService');
|
|
@@ -58,7 +56,7 @@ const create = function () {
|
|
|
58
56
|
const toExtract = collectExtractProps();
|
|
59
57
|
const initialIndentSetting = await ctx.env.getConfiguration('volar.format.initialIndent');
|
|
60
58
|
const newUri = document.uri.substring(0, document.uri.lastIndexOf('/') + 1) + `${newName}.vue`;
|
|
61
|
-
const lastImportNode = getLastImportNode(
|
|
59
|
+
const lastImportNode = getLastImportNode(script.ast);
|
|
62
60
|
let newFileTags = [];
|
|
63
61
|
newFileTags.push(constructTag('template', [], initialIndentSetting.html, sfc.template.content.substring(templateCodeRange[0], templateCodeRange[1])));
|
|
64
62
|
if (toExtract.length) {
|
|
@@ -86,8 +84,8 @@ const create = function () {
|
|
|
86
84
|
newText: `\nimport ${newName} from './${newName}.vue'`,
|
|
87
85
|
},
|
|
88
86
|
];
|
|
89
|
-
if (sfc.script
|
|
90
|
-
const edit = createAddComponentToOptionEdit(ts, sfc.
|
|
87
|
+
if (sfc.script) {
|
|
88
|
+
const edit = createAddComponentToOptionEdit(ts, sfc.script.ast, newName);
|
|
91
89
|
if (edit) {
|
|
92
90
|
currentFileEdits.push({
|
|
93
91
|
range: {
|
|
@@ -209,11 +207,11 @@ const create = function () {
|
|
|
209
207
|
};
|
|
210
208
|
};
|
|
211
209
|
exports.create = create;
|
|
212
|
-
function selectTemplateCode(startOffset, endOffset, templateBlock
|
|
210
|
+
function selectTemplateCode(startOffset, endOffset, templateBlock) {
|
|
213
211
|
if (startOffset < templateBlock.startTagEnd || endOffset > templateBlock.endTagStart)
|
|
214
212
|
return;
|
|
215
213
|
const insideNodes = [];
|
|
216
|
-
|
|
214
|
+
templateBlock.ast?.children.forEach(function visit(node) {
|
|
217
215
|
if (node.loc.start.offset + templateBlock.startTagEnd >= startOffset
|
|
218
216
|
&& node.loc.end.offset + templateBlock.startTagEnd <= endOffset) {
|
|
219
217
|
insideNodes.push(node);
|
|
@@ -209,12 +209,12 @@ const create = (options) => (_context, modules) => {
|
|
|
209
209
|
if (!virtualFile || !(virtualFile instanceof language_core_1.VueFile))
|
|
210
210
|
continue;
|
|
211
211
|
const templateErrors = [];
|
|
212
|
-
const
|
|
213
|
-
if (
|
|
214
|
-
for (const error of
|
|
212
|
+
const { template } = virtualFile.sfc;
|
|
213
|
+
if (template) {
|
|
214
|
+
for (const error of template.errors) {
|
|
215
215
|
onCompilerError(error, 1);
|
|
216
216
|
}
|
|
217
|
-
for (const warning of
|
|
217
|
+
for (const warning of template.warnings) {
|
|
218
218
|
onCompilerError(warning, 2);
|
|
219
219
|
}
|
|
220
220
|
function onCompilerError(error, severity) {
|
|
@@ -320,7 +320,7 @@ const create = (options) => (_context, modules) => {
|
|
|
320
320
|
&& name !== 'KeepAlive'
|
|
321
321
|
&& name !== 'Suspense'
|
|
322
322
|
&& name !== 'Teleport');
|
|
323
|
-
const scriptSetupRanges = vueSourceFile.sfc.
|
|
323
|
+
const scriptSetupRanges = vueSourceFile.sfc.scriptSetup ? (0, language_core_1.parseScriptSetupRanges)(ts, vueSourceFile.sfc.scriptSetup.ast, options.vueCompilerOptions) : undefined;
|
|
324
324
|
const names = new Set();
|
|
325
325
|
const tags = [];
|
|
326
326
|
for (const tag of components) {
|
|
@@ -356,8 +356,8 @@ const create = (options) => (_context, modules) => {
|
|
|
356
356
|
const _tsCodegen = language_core_1.tsCodegen.get(vueSourceFile.sfc);
|
|
357
357
|
if (_tsCodegen) {
|
|
358
358
|
let ctxVars = [
|
|
359
|
-
..._tsCodegen.scriptRanges
|
|
360
|
-
..._tsCodegen.scriptSetupRanges
|
|
359
|
+
..._tsCodegen.scriptRanges()?.bindings.map(binding => vueSourceFile.sfc.script.content.substring(binding.start, binding.end)) ?? [],
|
|
360
|
+
..._tsCodegen.scriptSetupRanges()?.bindings.map(binding => vueSourceFile.sfc.scriptSetup.content.substring(binding.start, binding.end)) ?? [],
|
|
361
361
|
...(0, helpers_1.getTemplateCtx)(ts, languageService, vueSourceFile) ?? [],
|
|
362
362
|
];
|
|
363
363
|
ctxVars = [...new Set(ctxVars)];
|
|
@@ -15,12 +15,12 @@ const create = function () {
|
|
|
15
15
|
if (!vueFile || !(vueFile instanceof language_core_1.VueFile)) {
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
const {
|
|
19
|
-
if (!
|
|
18
|
+
const { template } = vueFile.sfc;
|
|
19
|
+
if (!template?.ast)
|
|
20
20
|
return;
|
|
21
21
|
const templateStartOffset = template.startTagEnd;
|
|
22
22
|
const result = [];
|
|
23
|
-
(0, language_core_1.walkElementNodes)(
|
|
23
|
+
(0, language_core_1.walkElementNodes)(template.ast, node => {
|
|
24
24
|
if (startOffset > templateStartOffset + node.loc.end.offset || endOffset < templateStartOffset + node.loc.start.offset) {
|
|
25
25
|
return;
|
|
26
26
|
}
|
package/out/plugins/vue.js
CHANGED
|
@@ -63,7 +63,7 @@ const create = () => (context, modules) => {
|
|
|
63
63
|
},
|
|
64
64
|
message: `Virtual script ${JSON.stringify(vueSourceFile.mainScriptName)} not found, may missing <script lang="ts"> / "allowJs": true / jsconfig.json.`,
|
|
65
65
|
severity: 3,
|
|
66
|
-
source: '
|
|
66
|
+
source: 'vue',
|
|
67
67
|
};
|
|
68
68
|
result.push(error);
|
|
69
69
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/language-service",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.20",
|
|
4
4
|
"main": "out/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
"update-html-data": "node ./scripts/update-html-data.js"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@volar/language-core": "~1.10.
|
|
21
|
-
"@volar/language-service": "~1.10.
|
|
22
|
-
"@volar/typescript": "~1.10.
|
|
20
|
+
"@volar/language-core": "~1.10.4",
|
|
21
|
+
"@volar/language-service": "~1.10.4",
|
|
22
|
+
"@volar/typescript": "~1.10.4",
|
|
23
23
|
"@vue/compiler-dom": "^3.3.0",
|
|
24
|
-
"@vue/language-core": "1.8.
|
|
25
|
-
"@vue/reactivity": "^3.3.0",
|
|
24
|
+
"@vue/language-core": "1.8.20",
|
|
26
25
|
"@vue/shared": "^3.3.0",
|
|
26
|
+
"computeds": "^0.0.1",
|
|
27
27
|
"volar-service-css": "0.0.14",
|
|
28
28
|
"volar-service-emmet": "0.0.14",
|
|
29
29
|
"volar-service-html": "0.0.14",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"vscode-languageserver-textdocument": "^1.0.11"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@volar/kit": "~1.10.
|
|
39
|
+
"@volar/kit": "~1.10.4",
|
|
40
40
|
"vscode-languageserver-protocol": "^3.17.5",
|
|
41
41
|
"vscode-uri": "^3.0.8"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "c5f0a7f2bec182880504e250fb3c8615a21ebd1e"
|
|
44
44
|
}
|