@vue/language-core 2.2.0 → 2.2.4
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/index.d.ts +0 -1
- package/index.js +1 -2
- package/lib/codegen/codeFeatures.d.ts +83 -0
- package/lib/codegen/codeFeatures.js +71 -0
- package/lib/codegen/globalTypes.d.ts +3 -1
- package/lib/codegen/globalTypes.js +45 -37
- package/lib/codegen/localTypes.d.ts +1 -1
- package/lib/codegen/localTypes.js +4 -4
- package/lib/codegen/script/component.d.ts +1 -1
- package/lib/codegen/script/component.js +15 -11
- package/lib/codegen/script/componentSelf.d.ts +1 -1
- package/lib/codegen/script/componentSelf.js +2 -2
- package/lib/codegen/script/context.d.ts +1 -1
- package/lib/codegen/script/index.d.ts +1 -8
- package/lib/codegen/script/index.js +19 -45
- package/lib/codegen/script/scriptSetup.d.ts +1 -1
- package/lib/codegen/script/scriptSetup.js +78 -79
- package/lib/codegen/script/src.d.ts +2 -2
- package/lib/codegen/script/src.js +37 -38
- package/lib/codegen/script/template.d.ts +2 -3
- package/lib/codegen/script/template.js +12 -79
- package/lib/codegen/style/classProperty.d.ts +2 -0
- package/lib/codegen/style/classProperty.js +31 -0
- package/lib/codegen/style/modules.d.ts +3 -0
- package/lib/codegen/{script/styleModulesType.js → style/modules.js} +15 -15
- package/lib/codegen/style/scopedClasses.d.ts +4 -0
- package/lib/codegen/style/scopedClasses.js +32 -0
- package/lib/codegen/template/context.d.ts +122 -17
- package/lib/codegen/template/context.js +162 -92
- package/lib/codegen/template/element.d.ts +1 -1
- package/lib/codegen/template/element.js +86 -330
- package/lib/codegen/template/elementChildren.js +0 -13
- package/lib/codegen/template/elementDirectives.js +20 -12
- package/lib/codegen/template/elementEvents.d.ts +1 -1
- package/lib/codegen/template/elementEvents.js +15 -11
- package/lib/codegen/template/elementProps.d.ts +2 -1
- package/lib/codegen/template/elementProps.js +31 -33
- package/lib/codegen/template/index.d.ts +1 -0
- package/lib/codegen/template/index.js +53 -33
- package/lib/codegen/template/interpolation.js +13 -9
- package/lib/codegen/template/slotOutlet.js +44 -21
- package/lib/codegen/template/styleScopedClasses.d.ts +3 -0
- package/lib/codegen/template/styleScopedClasses.js +146 -9
- package/lib/codegen/template/templateChild.js +69 -30
- package/lib/codegen/template/vFor.js +2 -2
- package/lib/codegen/template/vIf.js +3 -3
- package/lib/codegen/template/vSlot.d.ts +6 -0
- package/lib/codegen/template/vSlot.js +92 -0
- package/lib/codegen/utils/index.d.ts +13 -2
- package/lib/codegen/utils/index.js +33 -6
- package/lib/parsers/scriptSetupRanges.d.ts +5 -3
- package/lib/parsers/scriptSetupRanges.js +24 -35
- package/lib/parsers/vueCompilerOptions.d.ts +2 -2
- package/lib/plugins/file-md.js +3 -0
- package/lib/plugins/vue-template-inline-ts.js +56 -15
- package/lib/plugins/vue-tsx.d.ts +43 -32
- package/lib/plugins/vue-tsx.js +88 -68
- package/lib/types.d.ts +29 -16
- package/lib/utils/parseSfc.js +41 -16
- package/lib/utils/signals.d.ts +2 -0
- package/lib/utils/signals.js +54 -0
- package/lib/utils/ts.d.ts +14 -2
- package/lib/utils/ts.js +134 -88
- package/lib/virtualFile/computedEmbeddedCodes.d.ts +1 -1
- package/lib/virtualFile/computedEmbeddedCodes.js +14 -24
- package/lib/virtualFile/computedSfc.d.ts +1 -2
- package/lib/virtualFile/computedSfc.js +86 -96
- package/lib/virtualFile/computedVueSfc.d.ts +1 -2
- package/lib/virtualFile/computedVueSfc.js +7 -7
- package/lib/virtualFile/vueFile.d.ts +8 -11
- package/lib/virtualFile/vueFile.js +15 -9
- package/package.json +4 -4
- package/lib/codegen/script/styleModulesType.d.ts +0 -4
|
@@ -196,25 +196,21 @@ function parseScriptSetupRanges(ts, ast, vueCompilerOptions) {
|
|
|
196
196
|
}
|
|
197
197
|
else if (vueCompilerOptions.macros.defineProps.includes(callText)) {
|
|
198
198
|
defineProps = {
|
|
199
|
-
...
|
|
200
|
-
statement: getStatementRange(ts, parents, node, ast)
|
|
199
|
+
...parseCallExpressionAssignment(node, parent),
|
|
200
|
+
statement: getStatementRange(ts, parents, node, ast),
|
|
201
|
+
argNode: node.arguments[0]
|
|
201
202
|
};
|
|
202
|
-
if (ts.isVariableDeclaration(parent)) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
defineProps.destructured.add(name);
|
|
213
|
-
}
|
|
203
|
+
if (ts.isVariableDeclaration(parent) && ts.isObjectBindingPattern(parent.name)) {
|
|
204
|
+
defineProps.destructured = new Map();
|
|
205
|
+
const identifiers = (0, utils_1.collectIdentifiers)(ts, parent.name, []);
|
|
206
|
+
for (const { id, isRest, initializer } of identifiers) {
|
|
207
|
+
const name = _getNodeText(id);
|
|
208
|
+
if (isRest) {
|
|
209
|
+
defineProps.destructuredRest = name;
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
defineProps.destructured.set(name, initializer);
|
|
214
213
|
}
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
defineProps.name = _getNodeText(parent.name);
|
|
218
214
|
}
|
|
219
215
|
}
|
|
220
216
|
else if (ts.isCallExpression(parent)
|
|
@@ -230,17 +226,15 @@ function parseScriptSetupRanges(ts, ast, vueCompilerOptions) {
|
|
|
230
226
|
withDefaults = {
|
|
231
227
|
callExp: _getStartEnd(node),
|
|
232
228
|
exp: _getStartEnd(node.expression),
|
|
233
|
-
arg: arg ? _getStartEnd(arg) : undefined
|
|
229
|
+
arg: arg ? _getStartEnd(arg) : undefined,
|
|
230
|
+
argNode: arg
|
|
234
231
|
};
|
|
235
232
|
}
|
|
236
233
|
else if (vueCompilerOptions.macros.defineEmits.includes(callText)) {
|
|
237
234
|
defineEmits = {
|
|
238
|
-
...
|
|
235
|
+
...parseCallExpressionAssignment(node, parent),
|
|
239
236
|
statement: getStatementRange(ts, parents, node, ast)
|
|
240
237
|
};
|
|
241
|
-
if (ts.isVariableDeclaration(parent)) {
|
|
242
|
-
defineEmits.name = _getNodeText(parent.name);
|
|
243
|
-
}
|
|
244
238
|
if (node.typeArguments?.length && ts.isTypeLiteralNode(node.typeArguments[0])) {
|
|
245
239
|
for (const member of node.typeArguments[0].members) {
|
|
246
240
|
if (ts.isCallSignatureDeclaration(member)) {
|
|
@@ -255,17 +249,9 @@ function parseScriptSetupRanges(ts, ast, vueCompilerOptions) {
|
|
|
255
249
|
}
|
|
256
250
|
else if (vueCompilerOptions.macros.defineSlots.includes(callText)) {
|
|
257
251
|
defineSlots = {
|
|
258
|
-
...
|
|
252
|
+
...parseCallExpressionAssignment(node, parent),
|
|
259
253
|
statement: getStatementRange(ts, parents, node, ast)
|
|
260
254
|
};
|
|
261
|
-
if (ts.isVariableDeclaration(parent)) {
|
|
262
|
-
if (ts.isIdentifier(parent.name)) {
|
|
263
|
-
defineSlots.name = _getNodeText(parent.name);
|
|
264
|
-
}
|
|
265
|
-
else {
|
|
266
|
-
defineSlots.isObjectBindingPattern = ts.isObjectBindingPattern(parent.name);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
255
|
}
|
|
270
256
|
else if (vueCompilerOptions.macros.defineExpose.includes(callText)) {
|
|
271
257
|
defineExpose = parseCallExpression(node);
|
|
@@ -298,10 +284,7 @@ function parseScriptSetupRanges(ts, ast, vueCompilerOptions) {
|
|
|
298
284
|
}
|
|
299
285
|
else if (vueCompilerOptions.composables.useTemplateRef.includes(callText)
|
|
300
286
|
&& !node.typeArguments?.length) {
|
|
301
|
-
useTemplateRef.push(
|
|
302
|
-
name: ts.isVariableDeclaration(parent) ? _getNodeText(parent.name) : undefined,
|
|
303
|
-
...parseCallExpression(node)
|
|
304
|
-
});
|
|
287
|
+
useTemplateRef.push(parseCallExpressionAssignment(node, parent));
|
|
305
288
|
}
|
|
306
289
|
}
|
|
307
290
|
ts.forEachChild(node, child => {
|
|
@@ -321,6 +304,12 @@ function parseScriptSetupRanges(ts, ast, vueCompilerOptions) {
|
|
|
321
304
|
typeArg: node.typeArguments?.length ? _getStartEnd(node.typeArguments[0]) : undefined,
|
|
322
305
|
};
|
|
323
306
|
}
|
|
307
|
+
function parseCallExpressionAssignment(node, parent) {
|
|
308
|
+
return {
|
|
309
|
+
name: ts.isVariableDeclaration(parent) ? _getNodeText(parent.name) : undefined,
|
|
310
|
+
...parseCallExpression(node),
|
|
311
|
+
};
|
|
312
|
+
}
|
|
324
313
|
function _getStartEnd(node) {
|
|
325
314
|
return getStartEnd(ts, node, ast);
|
|
326
315
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function parseVueCompilerOptions(comments: string[]):
|
|
1
|
+
import type { RawVueCompilerOptions } from '../types';
|
|
2
|
+
export declare function parseVueCompilerOptions(comments: string[]): RawVueCompilerOptions | undefined;
|
package/lib/plugins/file-md.js
CHANGED
|
@@ -6,6 +6,7 @@ const buildMappings_1 = require("../utils/buildMappings");
|
|
|
6
6
|
const parseSfc_1 = require("../utils/parseSfc");
|
|
7
7
|
const codeblockReg = /(`{3,})[\s\S]+?\1/g;
|
|
8
8
|
const inlineCodeblockReg = /`[^\n`]+?`/g;
|
|
9
|
+
const latexBlockReg = /(\${2,})[\s\S]+?\1/g;
|
|
9
10
|
const scriptSetupReg = /\\\<[\s\S]+?\>\n?/g;
|
|
10
11
|
const sfcBlockReg = /\<(script|style)\b[\s\S]*?\>([\s\S]*?)\<\/\1\>/g;
|
|
11
12
|
const angleBracketReg = /\<\S*\:\S*\>/g;
|
|
@@ -31,6 +32,8 @@ const plugin = ({ vueCompilerOptions }) => {
|
|
|
31
32
|
.replace(codeblockReg, (match, quotes) => quotes + ' '.repeat(match.length - quotes.length * 2) + quotes)
|
|
32
33
|
// inline code block
|
|
33
34
|
.replace(inlineCodeblockReg, match => `\`${' '.repeat(match.length - 2)}\``)
|
|
35
|
+
// latex block
|
|
36
|
+
.replace(latexBlockReg, (match, quotes) => quotes + ' '.repeat(match.length - quotes.length * 2) + quotes)
|
|
34
37
|
// # \<script setup>
|
|
35
38
|
.replace(scriptSetupReg, match => ' '.repeat(match.length))
|
|
36
39
|
// <<< https://vitepress.dev/guide/markdown#import-code-snippets
|
|
@@ -60,10 +60,10 @@ const plugin = ctx => {
|
|
|
60
60
|
return data;
|
|
61
61
|
function visit(node) {
|
|
62
62
|
if (node.type === CompilerDOM.NodeTypes.COMMENT) {
|
|
63
|
-
const match = node.loc.source.match(/^<!--\s*@vue-generic\
|
|
63
|
+
const match = node.loc.source.match(/^<!--\s*@vue-generic\s*\{(?<content>[\s\S]*)\}\s*-->$/);
|
|
64
64
|
if (match) {
|
|
65
|
-
const { content } = match.groups
|
|
66
|
-
addFormatCodes(content, node.loc.start.offset +
|
|
65
|
+
const { content } = match.groups;
|
|
66
|
+
addFormatCodes(content, node.loc.start.offset + node.loc.source.indexOf('{') + 1, formatBrackets.generic);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
else if (node.type === CompilerDOM.NodeTypes.ELEMENT) {
|
|
@@ -76,19 +76,37 @@ const plugin = ctx => {
|
|
|
76
76
|
continue;
|
|
77
77
|
}
|
|
78
78
|
if (prop.arg?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && !prop.arg.isStatic) {
|
|
79
|
-
addFormatCodes(prop.arg.
|
|
79
|
+
addFormatCodes(prop.arg.loc.source, prop.arg.loc.start.offset, formatBrackets.normal);
|
|
80
80
|
}
|
|
81
81
|
if (prop.exp?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION
|
|
82
82
|
&& prop.exp.constType !== CompilerDOM.ConstantTypes.CAN_STRINGIFY // style='z-index: 2' will compile to {'z-index':'2'}
|
|
83
83
|
) {
|
|
84
84
|
if (prop.name === 'on' && prop.arg?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
|
|
85
85
|
const ast = (0, utils_1.createTsAst)(ctx.modules.typescript, prop.exp, prop.exp.content);
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
if ((0, elementEvents_1.isCompoundExpression)(ctx.modules.typescript, ast)) {
|
|
87
|
+
addFormatCodes(prop.exp.loc.source, prop.exp.loc.start.offset, formatBrackets.event);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
const lines = prop.exp.content.split('\n');
|
|
91
|
+
const firstLineEmpty = lines[0].trim() === '';
|
|
92
|
+
const lastLineEmpty = lines[lines.length - 1].trim() === '';
|
|
93
|
+
if (lines.length <= 1 || (!firstLineEmpty && !lastLineEmpty)) {
|
|
94
|
+
addFormatCodes(prop.exp.loc.source, prop.exp.loc.start.offset, formatBrackets.normal);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
addFormatCodes(prop.exp.loc.source, prop.exp.loc.start.offset, ['(', ');']);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
else if (prop.name === 'slot') {
|
|
102
|
+
addFormatCodes(prop.exp.loc.source, prop.exp.loc.start.offset, formatBrackets.params);
|
|
103
|
+
}
|
|
104
|
+
else if (prop.rawName === 'v-for') {
|
|
105
|
+
// #2586
|
|
106
|
+
addFormatCodes(prop.exp.loc.source, prop.exp.loc.start.offset, formatBrackets.for);
|
|
89
107
|
}
|
|
90
108
|
else {
|
|
91
|
-
addFormatCodes(prop.exp.
|
|
109
|
+
addFormatCodes(prop.exp.loc.source, prop.exp.loc.start.offset, formatBrackets.normal);
|
|
92
110
|
}
|
|
93
111
|
}
|
|
94
112
|
}
|
|
@@ -100,7 +118,7 @@ const plugin = ctx => {
|
|
|
100
118
|
for (let i = 0; i < node.branches.length; i++) {
|
|
101
119
|
const branch = node.branches[i];
|
|
102
120
|
if (branch.condition?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
|
|
103
|
-
addFormatCodes(branch.condition.
|
|
121
|
+
addFormatCodes(branch.condition.loc.source, branch.condition.loc.start.offset, formatBrackets.if);
|
|
104
122
|
}
|
|
105
123
|
for (const childNode of branch.children) {
|
|
106
124
|
visit(childNode);
|
|
@@ -111,8 +129,14 @@ const plugin = ctx => {
|
|
|
111
129
|
const { leftExpressionRange, leftExpressionText } = (0, vFor_1.parseVForNode)(node);
|
|
112
130
|
const { source } = node.parseResult;
|
|
113
131
|
if (leftExpressionRange && leftExpressionText && source.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
|
|
114
|
-
|
|
115
|
-
|
|
132
|
+
let start = leftExpressionRange.start;
|
|
133
|
+
let end = source.loc.start.offset + source.content.length;
|
|
134
|
+
while (templateContent[start - 1] === ' ' || templateContent[start - 1] === '(') {
|
|
135
|
+
start--;
|
|
136
|
+
}
|
|
137
|
+
while (templateContent[end] === ' ' || templateContent[end] === ')') {
|
|
138
|
+
end++;
|
|
139
|
+
}
|
|
116
140
|
addFormatCodes(templateContent.slice(start, end), start, formatBrackets.for);
|
|
117
141
|
}
|
|
118
142
|
for (const child of node.children) {
|
|
@@ -135,10 +159,27 @@ const plugin = ctx => {
|
|
|
135
159
|
// {{ ... }}
|
|
136
160
|
const [content, start] = (0, templateChild_1.parseInterpolationNode)(node, templateContent);
|
|
137
161
|
const lines = content.split('\n');
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
162
|
+
const firstLineEmpty = lines[0].trim() === '';
|
|
163
|
+
const lastLineEmpty = lines[lines.length - 1].trim() === '';
|
|
164
|
+
if (content.includes('=>')) { // arrow function
|
|
165
|
+
if (lines.length <= 1 || (!firstLineEmpty && !lastLineEmpty)) {
|
|
166
|
+
addFormatCodes(content, start, formatBrackets.normal);
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
addFormatCodes(content, start, ['(', ');']);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
if (lines.length <= 1 || (!firstLineEmpty && !lastLineEmpty)) {
|
|
174
|
+
addFormatCodes(content, start, formatBrackets.curly);
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
addFormatCodes(content, start, [
|
|
178
|
+
firstLineEmpty ? '(' : '(0 +',
|
|
179
|
+
lastLineEmpty ? ');' : '+ 0);'
|
|
180
|
+
]);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
142
183
|
}
|
|
143
184
|
}
|
|
144
185
|
function addFormatCodes(code, offset, wrapper) {
|
package/lib/plugins/vue-tsx.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Mapping } from '@volar/language-core';
|
|
2
2
|
import type { Code, Sfc, VueLanguagePlugin } from '../types';
|
|
3
3
|
export declare const tsCodegen: WeakMap<Sfc, {
|
|
4
|
-
|
|
4
|
+
getScriptRanges: () => {
|
|
5
5
|
exportDefault: (import("../types").TextRange & {
|
|
6
6
|
expression: import("../types").TextRange;
|
|
7
7
|
args: import("../types").TextRange;
|
|
@@ -19,8 +19,8 @@ export declare const tsCodegen: WeakMap<Sfc, {
|
|
|
19
19
|
isDefaultImport?: boolean;
|
|
20
20
|
isNamespace?: boolean;
|
|
21
21
|
}[];
|
|
22
|
-
} | undefined
|
|
23
|
-
|
|
22
|
+
} | undefined;
|
|
23
|
+
getScriptSetupRanges: () => {
|
|
24
24
|
leadingCommentEndOffset: number;
|
|
25
25
|
importSectionEndOffset: number;
|
|
26
26
|
bindings: {
|
|
@@ -46,15 +46,19 @@ export declare const tsCodegen: WeakMap<Sfc, {
|
|
|
46
46
|
typeArg?: import("../types").TextRange;
|
|
47
47
|
} & {
|
|
48
48
|
name?: string;
|
|
49
|
-
destructured?:
|
|
49
|
+
destructured?: Map<string, import("typescript").Expression | undefined>;
|
|
50
50
|
destructuredRest?: string;
|
|
51
51
|
statement: import("../types").TextRange;
|
|
52
|
+
argNode?: import("typescript").Expression;
|
|
52
53
|
}) | undefined;
|
|
53
|
-
withDefaults: {
|
|
54
|
+
withDefaults: (Omit<{
|
|
54
55
|
callExp: import("../types").TextRange;
|
|
55
56
|
exp: import("../types").TextRange;
|
|
56
|
-
arg?: import("../types").TextRange
|
|
57
|
-
|
|
57
|
+
arg?: import("../types").TextRange;
|
|
58
|
+
typeArg?: import("../types").TextRange;
|
|
59
|
+
}, "typeArg"> & {
|
|
60
|
+
argNode?: import("typescript").Expression;
|
|
61
|
+
}) | undefined;
|
|
58
62
|
defineEmits: ({
|
|
59
63
|
callExp: import("../types").TextRange;
|
|
60
64
|
exp: import("../types").TextRange;
|
|
@@ -72,7 +76,6 @@ export declare const tsCodegen: WeakMap<Sfc, {
|
|
|
72
76
|
typeArg?: import("../types").TextRange;
|
|
73
77
|
} & {
|
|
74
78
|
name?: string;
|
|
75
|
-
isObjectBindingPattern?: boolean;
|
|
76
79
|
statement: import("../types").TextRange;
|
|
77
80
|
}) | undefined;
|
|
78
81
|
defineExpose: {
|
|
@@ -111,9 +114,9 @@ export declare const tsCodegen: WeakMap<Sfc, {
|
|
|
111
114
|
} & {
|
|
112
115
|
name?: string;
|
|
113
116
|
})[];
|
|
114
|
-
} | undefined
|
|
115
|
-
|
|
116
|
-
|
|
117
|
+
} | undefined;
|
|
118
|
+
getLang: () => string;
|
|
119
|
+
getGeneratedScript: () => {
|
|
117
120
|
codes: Code[];
|
|
118
121
|
linkedCodeMappings: Mapping<unknown>[];
|
|
119
122
|
generatedTemplate: boolean;
|
|
@@ -127,46 +130,51 @@ export declare const tsCodegen: WeakMap<Sfc, {
|
|
|
127
130
|
readonly PrettifyLocal: string;
|
|
128
131
|
readonly OmitKeepDiscriminatedUnion: string;
|
|
129
132
|
readonly WithDefaults: string;
|
|
130
|
-
readonly
|
|
133
|
+
readonly WithSlots: string;
|
|
131
134
|
readonly PropsChildren: string;
|
|
132
135
|
readonly TypePropsToOption: string;
|
|
133
136
|
readonly OmitIndexSignature: string;
|
|
134
137
|
};
|
|
135
138
|
inlayHints: import("../codegen/inlayHints").InlayHintInfo[];
|
|
136
|
-
}
|
|
137
|
-
|
|
139
|
+
};
|
|
140
|
+
getGeneratedTemplate: () => {
|
|
138
141
|
codes: Code[];
|
|
139
|
-
slots: {
|
|
140
|
-
name: string;
|
|
141
|
-
loc?: number;
|
|
142
|
-
tagRange: [number, number];
|
|
143
|
-
varName: string;
|
|
144
|
-
nodeLoc: any;
|
|
145
|
-
}[];
|
|
146
|
-
dynamicSlots: {
|
|
147
|
-
expVar: string;
|
|
148
|
-
varName: string;
|
|
149
|
-
}[];
|
|
150
142
|
codeFeatures: {
|
|
151
143
|
all: import("../types").VueCodeInformation;
|
|
144
|
+
none: import("../types").VueCodeInformation;
|
|
152
145
|
verification: import("../types").VueCodeInformation;
|
|
153
146
|
completion: import("../types").VueCodeInformation;
|
|
154
147
|
additionalCompletion: import("../types").VueCodeInformation;
|
|
148
|
+
withoutCompletion: import("../types").VueCodeInformation;
|
|
155
149
|
navigation: import("../types").VueCodeInformation;
|
|
156
150
|
navigationWithoutRename: import("../types").VueCodeInformation;
|
|
157
151
|
navigationAndCompletion: import("../types").VueCodeInformation;
|
|
158
152
|
navigationAndAdditionalCompletion: import("../types").VueCodeInformation;
|
|
153
|
+
navigationAndVerification: import("../types").VueCodeInformation;
|
|
159
154
|
withoutNavigation: import("../types").VueCodeInformation;
|
|
160
155
|
withoutHighlight: import("../types").VueCodeInformation;
|
|
156
|
+
withoutHighlightAndNavigation: import("../types").VueCodeInformation;
|
|
161
157
|
withoutHighlightAndCompletion: import("../types").VueCodeInformation;
|
|
162
158
|
withoutHighlightAndCompletionAndNavigation: import("../types").VueCodeInformation;
|
|
163
159
|
};
|
|
160
|
+
resolveCodeFeatures: (features: import("../types").VueCodeInformation) => import("../types").VueCodeInformation;
|
|
161
|
+
slots: {
|
|
162
|
+
name: string;
|
|
163
|
+
offset?: number;
|
|
164
|
+
tagRange: [number, number];
|
|
165
|
+
nodeLoc: any;
|
|
166
|
+
propsVar: string;
|
|
167
|
+
}[];
|
|
168
|
+
dynamicSlots: {
|
|
169
|
+
expVar: string;
|
|
170
|
+
propsVar: string;
|
|
171
|
+
}[];
|
|
172
|
+
dollarVars: Set<string>;
|
|
164
173
|
accessExternalVariables: Map<string, Set<number>>;
|
|
165
174
|
lastGenericComment: {
|
|
166
175
|
content: string;
|
|
167
176
|
offset: number;
|
|
168
177
|
} | undefined;
|
|
169
|
-
hasSlotElements: Set<import("@vue/compiler-dom").ElementNode>;
|
|
170
178
|
blockConditions: string[];
|
|
171
179
|
scopedClasses: {
|
|
172
180
|
source: string;
|
|
@@ -175,27 +183,30 @@ export declare const tsCodegen: WeakMap<Sfc, {
|
|
|
175
183
|
}[];
|
|
176
184
|
emptyClassOffsets: number[];
|
|
177
185
|
inlayHints: import("../codegen/inlayHints").InlayHintInfo[];
|
|
178
|
-
hasSlot: boolean;
|
|
179
186
|
bindingAttrLocs: import("@vue/compiler-dom").SourceLocation[];
|
|
180
187
|
inheritedAttrVars: Set<string>;
|
|
181
|
-
templateRefs: Map<string,
|
|
188
|
+
templateRefs: Map<string, {
|
|
189
|
+
typeExp: string;
|
|
190
|
+
offset: number;
|
|
191
|
+
}>;
|
|
182
192
|
currentComponent: {
|
|
183
|
-
node: import("@vue/compiler-dom").ElementNode;
|
|
184
193
|
ctxVar: string;
|
|
185
194
|
used: boolean;
|
|
186
195
|
} | undefined;
|
|
187
|
-
|
|
188
|
-
|
|
196
|
+
singleRootElTypes: string[];
|
|
197
|
+
singleRootNodes: Set<import("@vue/compiler-dom").ElementNode | null>;
|
|
189
198
|
accessExternalVariable(name: string, offset?: number): void;
|
|
190
199
|
hasLocalVariable: (name: string) => boolean;
|
|
191
200
|
addLocalVariable: (name: string) => void;
|
|
192
201
|
removeLocalVariable: (name: string) => void;
|
|
193
202
|
getInternalVariable: () => string;
|
|
203
|
+
getHoistVariable: (originalVar: string) => string;
|
|
204
|
+
generateHoistVariables: () => Generator<string, void, unknown>;
|
|
194
205
|
ignoreError: () => Generator<Code>;
|
|
195
206
|
expectError: (prevNode: import("@vue/compiler-dom").CommentNode) => Generator<Code>;
|
|
196
207
|
resetDirectiveComments: (endStr: string) => Generator<Code>;
|
|
197
208
|
generateAutoImportCompletion: () => Generator<Code>;
|
|
198
|
-
} | undefined
|
|
209
|
+
} | undefined;
|
|
199
210
|
}>;
|
|
200
211
|
declare const plugin: VueLanguagePlugin;
|
|
201
212
|
export default plugin;
|