@vue/language-service 1.8.19 → 1.8.21

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.
@@ -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
  },
@@ -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
@@ -1,32 +1,9 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.getTemplateTagsAndAttrs = exports.getElementAttrs = exports.getComponentNames = exports.getTemplateCtx = exports.getEventsOfTag = exports.getPropsByTag = void 0;
27
- const vue = __importStar(require("@vue/language-core"));
28
- const embedded = __importStar(require("@volar/language-core"));
29
- const reactivity_1 = require("@vue/reactivity");
4
+ const vue = require("@vue/language-core");
5
+ const embedded = require("@volar/language-core");
6
+ const computeds_1 = require("computeds");
30
7
  const language_core_1 = require("@vue/language-core");
31
8
  const shared_1 = require("@vue/shared");
32
9
  function getPropsByTag(ts, tsLs, sourceFile, tag, vueCompilerOptions, requiredOnly = false) {
@@ -209,10 +186,10 @@ function searchVariableDeclarationNode(ts, sourceFile, name) {
209
186
  const map = new WeakMap();
210
187
  function getTemplateTagsAndAttrs(sourceFile) {
211
188
  if (!map.has(sourceFile)) {
212
- const getter = (0, reactivity_1.computed)(() => {
189
+ const getter = (0, computeds_1.computed)(() => {
213
190
  if (!(sourceFile instanceof vue.VueFile))
214
191
  return;
215
- const ast = sourceFile.compiledSFCTemplate?.ast;
192
+ const ast = sourceFile.sfc.template?.ast;
216
193
  const tags = new Map();
217
194
  if (ast) {
218
195
  vue.walkElementNodes(ast, node => {
@@ -252,7 +229,7 @@ function getTemplateTagsAndAttrs(sourceFile) {
252
229
  });
253
230
  map.set(sourceFile, getter);
254
231
  }
255
- return map.get(sourceFile).value ?? new Map();
232
+ return map.get(sourceFile)() ?? new Map();
256
233
  }
257
234
  exports.getTemplateTagsAndAttrs = getTemplateTagsAndAttrs;
258
235
  //# sourceMappingURL=helpers.js.map
@@ -1,27 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.resolveConfig = void 0;
27
4
  const language_core_1 = require("@vue/language-core");
@@ -29,26 +6,26 @@ const shared_1 = require("@vue/shared");
29
6
  const nameCasing_1 = require("./ideFeatures/nameCasing");
30
7
  const types_1 = require("./types");
31
8
  // volar services
32
- const CssService = __importStar(require("volar-service-css"));
33
- const EmmetService = __importStar(require("volar-service-emmet"));
34
- const HtmlService = __importStar(require("volar-service-html"));
35
- const JsonService = __importStar(require("volar-service-json"));
36
- const PugService = __importStar(require("volar-service-pug"));
37
- const PugFormatService = __importStar(require("volar-service-pug-beautify"));
38
- const TsService = __importStar(require("volar-service-typescript"));
39
- const TsTqService = __importStar(require("volar-service-typescript-twoslash-queries"));
9
+ const CssService = require("volar-service-css");
10
+ const EmmetService = require("volar-service-emmet");
11
+ const HtmlService = require("volar-service-html");
12
+ const JsonService = require("volar-service-json");
13
+ const PugService = require("volar-service-pug");
14
+ const PugFormatService = require("volar-service-pug-beautify");
15
+ const TsService = require("volar-service-typescript");
16
+ const TsTqService = require("volar-service-typescript-twoslash-queries");
40
17
  // our services
41
- const VueService = __importStar(require("./plugins/vue"));
42
- const AutoDotValueService = __importStar(require("./plugins/vue-autoinsert-dotvalue"));
43
- const AutoWrapParenthesesService = __importStar(require("./plugins/vue-autoinsert-parentheses"));
44
- const AutoAddSpaceService = __importStar(require("./plugins/vue-autoinsert-space"));
45
- const ReferencesCodeLensService = __importStar(require("./plugins/vue-codelens-references"));
46
- const DirectiveCommentsService = __importStar(require("./plugins/vue-directive-comments"));
47
- const ExtractComponentService = __importStar(require("./plugins/vue-extract-file"));
48
- const VueTemplateLanguageService = __importStar(require("./plugins/vue-template"));
49
- const ToggleVBindService = __importStar(require("./plugins/vue-toggle-v-bind-codeaction"));
50
- const VueTqService = __importStar(require("./plugins/vue-twoslash-queries"));
51
- const VisualizeHiddenCallbackParamService = __importStar(require("./plugins/vue-visualize-hidden-callback-param"));
18
+ const VueService = require("./plugins/vue");
19
+ const AutoDotValueService = require("./plugins/vue-autoinsert-dotvalue");
20
+ const AutoWrapParenthesesService = require("./plugins/vue-autoinsert-parentheses");
21
+ const AutoAddSpaceService = require("./plugins/vue-autoinsert-space");
22
+ const ReferencesCodeLensService = require("./plugins/vue-codelens-references");
23
+ const DirectiveCommentsService = require("./plugins/vue-directive-comments");
24
+ const ExtractComponentService = require("./plugins/vue-extract-file");
25
+ const VueTemplateLanguageService = require("./plugins/vue-template");
26
+ const ToggleVBindService = require("./plugins/vue-toggle-v-bind-codeaction");
27
+ const VueTqService = require("./plugins/vue-twoslash-queries");
28
+ const VisualizeHiddenCallbackParamService = require("./plugins/vue-visualize-hidden-callback-param");
52
29
  function resolveConfig(config, compilerOptions = {}, vueCompilerOptions = {}, ts = require('typescript'), codegenStack = false) {
53
30
  const resolvedVueCompilerOptions = (0, language_core_1.resolveVueCompilerOptions)(vueCompilerOptions);
54
31
  const vueLanguageModules = (0, language_core_1.createLanguages)(compilerOptions, resolvedVueCompilerOptions, ts, codegenStack);
@@ -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
- data = require('../../data/language-blocks/ja.json');
48
+ return require('../../data/language-blocks/ja.json');
47
49
  }
48
50
  else if (lang === 'fr') {
49
- data = require('../../data/language-blocks/fr.json');
51
+ return require('../../data/language-blocks/fr.json');
50
52
  }
51
53
  else if (lang === 'ko') {
52
- data = require('../../data/language-blocks/ko.json');
54
+ return require('../../data/language-blocks/ko.json');
53
55
  }
54
56
  else if (lang === 'pt-br') {
55
- data = require('../../data/language-blocks/pt.json');
57
+ return require('../../data/language-blocks/pt.json');
56
58
  }
57
59
  else if (lang === 'zh-cn') {
58
- data = require('../../data/language-blocks/zh-cn.json');
60
+ return require('../../data/language-blocks/zh-cn.json');
59
61
  }
60
- else {
61
- data = require('../../data/language-blocks/en.json');
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
- data = require('../../data/model-modifiers/ja.json');
71
+ return require('../../data/model-modifiers/ja.json');
71
72
  }
72
73
  else if (lang === 'fr') {
73
- data = require('../../data/model-modifiers/fr.json');
74
+ return require('../../data/model-modifiers/fr.json');
74
75
  }
75
76
  else if (lang === 'ko') {
76
- data = require('../../data/model-modifiers/ko.json');
77
+ return require('../../data/model-modifiers/ko.json');
77
78
  }
78
79
  else if (lang === 'pt-br') {
79
- data = require('../../data/model-modifiers/pt.json');
80
+ return require('../../data/model-modifiers/pt.json');
80
81
  }
81
82
  else if (lang === 'zh-cn') {
82
- data = require('../../data/model-modifiers/zh-cn.json');
83
+ return require('../../data/model-modifiers/zh-cn.json');
83
84
  }
84
- else {
85
- data = require('../../data/model-modifiers/en.json');
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
@@ -6,7 +6,7 @@ const cmds = [
6
6
  'vue-skip',
7
7
  'vue-expect-error',
8
8
  ];
9
- const directiveCommentReg = /<!--\s+@/;
9
+ const directiveCommentReg = /<!--\s*@/;
10
10
  const plugin = () => {
11
11
  return {
12
12
  triggerCharacters: ['@'],
@@ -20,10 +20,9 @@ const create = function () {
20
20
  return;
21
21
  const { sfc } = vueFile;
22
22
  const script = sfc.scriptSetup ?? sfc.script;
23
- const scriptAst = sfc.scriptSetupAst ?? sfc.scriptAst;
24
- if (!sfc.template || !sfc.templateAst || !script || !scriptAst)
23
+ if (!sfc.template || !script)
25
24
  return;
26
- const templateCodeRange = selectTemplateCode(startOffset, endOffset, sfc.template, sfc.templateAst);
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
- const scriptAst = sfc.scriptSetupAst ?? sfc.scriptAst;
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, sfc.templateAst);
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(scriptAst);
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 && sfc.scriptAst) {
90
- const edit = createAddComponentToOptionEdit(ts, sfc.scriptAst, newName);
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, templateAst) {
210
+ function selectTemplateCode(startOffset, endOffset, templateBlock) {
213
211
  if (startOffset < templateBlock.startTagEnd || endOffset > templateBlock.endTagStart)
214
212
  return;
215
213
  const insideNodes = [];
216
- templateAst.children.forEach(function visit(node) {
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);