tailwind-typescript-plugin 1.4.0-beta.19 → 1.4.0-beta.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/CHANGELOG.md +6 -0
- package/lib/extractors/VueAttributeExtractor.d.ts +87 -1
- package/lib/extractors/VueAttributeExtractor.d.ts.map +1 -1
- package/lib/extractors/VueAttributeExtractor.js +707 -7
- package/lib/extractors/VueAttributeExtractor.js.map +1 -1
- package/lib/extractors/VueExpressionExtractor.d.ts +21 -0
- package/lib/extractors/VueExpressionExtractor.d.ts.map +1 -0
- package/lib/extractors/VueExpressionExtractor.js +51 -0
- package/lib/extractors/VueExpressionExtractor.js.map +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [1.4.0-beta.20](https://github.com/IvanRodriCalleja/tailwind-typescript-plugin/compare/v1.4.0-beta.19...v1.4.0-beta.20) (2025-12-22)
|
|
2
|
+
|
|
3
|
+
### 🐛 Bug Fixes
|
|
4
|
+
|
|
5
|
+
* add [Vue] prefix to Vue test describe blocks ([4ed74e0](https://github.com/IvanRodriCalleja/tailwind-typescript-plugin/commit/4ed74e0471d1defbfbf13e64298f312942784e0a))
|
|
6
|
+
|
|
1
7
|
## [1.4.0-beta.19](https://github.com/IvanRodriCalleja/tailwind-typescript-plugin/compare/v1.4.0-beta.18...v1.4.0-beta.19) (2025-12-21)
|
|
2
8
|
|
|
3
9
|
### ✨ Features
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as ts from 'typescript/lib/tsserverlibrary';
|
|
2
|
-
import { ClassNameInfo, ExtractionContext } from '../core/types';
|
|
2
|
+
import { ClassNameInfo, ExtractionContext, UtilityFunction } from '../core/types';
|
|
3
3
|
import { BaseExtractor } from './BaseExtractor';
|
|
4
4
|
/**
|
|
5
5
|
* Extracts class names from Vue template class attributes
|
|
@@ -25,9 +25,95 @@ import { BaseExtractor } from './BaseExtractor';
|
|
|
25
25
|
export declare class VueAttributeExtractor extends BaseExtractor {
|
|
26
26
|
private expressionExtractor;
|
|
27
27
|
constructor();
|
|
28
|
+
/**
|
|
29
|
+
* Override to handle Vue's __VLS_ctx pattern.
|
|
30
|
+
*
|
|
31
|
+
* Vue generates code like __VLS_ctx.clsx(...) for template expressions
|
|
32
|
+
* where clsx is imported in the script section. We need to check if the
|
|
33
|
+
* function name (not __VLS_ctx) is directly imported.
|
|
34
|
+
*/
|
|
35
|
+
protected shouldValidateFunctionCall(callExpression: ts.CallExpression, utilityFunctions: UtilityFunction[], context?: ExtractionContext): boolean;
|
|
28
36
|
canHandle(node: ts.Node, context: ExtractionContext): boolean;
|
|
29
37
|
private hasClassSpreadProperty;
|
|
30
38
|
extract(node: ts.Node, context: ExtractionContext): ClassNameInfo[];
|
|
31
39
|
private extractClassesFromValue;
|
|
40
|
+
/**
|
|
41
|
+
* Extract classes from __VLS_ctx patterns by resolving variable/function references.
|
|
42
|
+
*
|
|
43
|
+
* Vue's generated code transforms template expressions in two ways:
|
|
44
|
+
* - :class="myClass" becomes class: (__VLS_ctx.myClass) - property access
|
|
45
|
+
* - :class="getClasses()" becomes class: (__VLS_ctx.getClasses()) - call expression
|
|
46
|
+
*
|
|
47
|
+
* The symbol resolves to a property assignment in Vue's generated code like:
|
|
48
|
+
* `return { myClass: myClass as typeof myClass }` or
|
|
49
|
+
* `return { getClasses: getClasses as typeof getClasses }`
|
|
50
|
+
* We need to follow the reference chain to find the actual declaration.
|
|
51
|
+
*
|
|
52
|
+
* IMPORTANT: We use the TEMPLATE position (the propertyName in __VLS_ctx.propertyName)
|
|
53
|
+
* for diagnostics because Volar only maps diagnostics from the template-generated section,
|
|
54
|
+
* not from the script section. Script section positions have valid mappings but Volar
|
|
55
|
+
* doesn't apply them for diagnostics.
|
|
56
|
+
*/
|
|
57
|
+
private extractFromVlsCtxReference;
|
|
58
|
+
/**
|
|
59
|
+
* Extract classes from a PropertySignature by getting the type.
|
|
60
|
+
*
|
|
61
|
+
* In Volar 3.x, script variables are exposed via a type like:
|
|
62
|
+
* type __VLS_SetupExposed = { myClass: typeof myClass; }
|
|
63
|
+
*
|
|
64
|
+
* We prioritize finding the actual variable declaration to use original positions,
|
|
65
|
+
* so errors point to the actual class strings in the script section.
|
|
66
|
+
*/
|
|
67
|
+
private extractFromPropertySignatureType;
|
|
68
|
+
/**
|
|
69
|
+
* Parse a class string into ClassNameInfo array.
|
|
70
|
+
* Uses the identifier position for diagnostics (mapped by Volar).
|
|
71
|
+
*/
|
|
72
|
+
private parseClassString;
|
|
73
|
+
/**
|
|
74
|
+
* Extract classes from a __VLS_ctx.functionName() call by resolving the function.
|
|
75
|
+
*/
|
|
76
|
+
private extractFromVlsCtxFunctionCall;
|
|
77
|
+
/**
|
|
78
|
+
* Extract classes from a function referenced via PropertySignature.
|
|
79
|
+
* In Volar 3.x: `type __VLS_SetupExposed = { getClasses: typeof getClasses; }`
|
|
80
|
+
*/
|
|
81
|
+
private extractFromPropertySignatureFunction;
|
|
82
|
+
/**
|
|
83
|
+
* Extract classes from a TypeScript type (for union types, string literals, etc.)
|
|
84
|
+
*/
|
|
85
|
+
private extractClassesFromType;
|
|
86
|
+
/**
|
|
87
|
+
* Resolve a function identifier to its declaration and extract classes from return statements.
|
|
88
|
+
*/
|
|
89
|
+
private resolveFunctionIdentifier;
|
|
90
|
+
/**
|
|
91
|
+
* Resolve classes from a property assignment initializer.
|
|
92
|
+
* Handles patterns like `myClass as typeof myClass` or just `myClass`.
|
|
93
|
+
*/
|
|
94
|
+
private resolvePropertyAssignmentClasses;
|
|
95
|
+
/**
|
|
96
|
+
* Resolve classes from an identifier by finding its declaration.
|
|
97
|
+
*/
|
|
98
|
+
private resolveIdentifierClasses;
|
|
99
|
+
/**
|
|
100
|
+
* Extract classes from a computed() call expression.
|
|
101
|
+
* Handles: const classes = computed(() => ['flex', 'items-center'])
|
|
102
|
+
*/
|
|
103
|
+
private extractFromComputedCall;
|
|
104
|
+
/**
|
|
105
|
+
* Extract classes from a function declaration's return statements.
|
|
106
|
+
* Handles: function getClasses() { return ['flex', 'items-center']; }
|
|
107
|
+
*/
|
|
108
|
+
private extractFromFunctionDeclaration;
|
|
109
|
+
/**
|
|
110
|
+
* Extract classes from a function body (block or expression).
|
|
111
|
+
* Handles both arrow function expressions and function blocks.
|
|
112
|
+
*/
|
|
113
|
+
private extractFromFunctionBody;
|
|
114
|
+
/**
|
|
115
|
+
* Extract classes from an expression (array, object, string, etc.)
|
|
116
|
+
*/
|
|
117
|
+
private extractFromExpression;
|
|
32
118
|
}
|
|
33
119
|
//# sourceMappingURL=VueAttributeExtractor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VueAttributeExtractor.d.ts","sourceRoot":"","sources":["../../src/extractors/VueAttributeExtractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"VueAttributeExtractor.d.ts","sourceRoot":"","sources":["../../src/extractors/VueAttributeExtractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,qBAAsB,SAAQ,aAAa;IACvD,OAAO,CAAC,mBAAmB,CAAyB;;IAOpD;;;;;;OAMG;cACgB,0BAA0B,CAC5C,cAAc,EAAE,EAAE,CAAC,cAAc,EACjC,gBAAgB,EAAE,eAAe,EAAE,EACnC,OAAO,CAAC,EAAE,iBAAiB,GACzB,OAAO;IA+BV,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO;IA4B7D,OAAO,CAAC,sBAAsB;IAsB9B,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,iBAAiB,GAAG,aAAa,EAAE;IA4CnE,OAAO,CAAC,uBAAuB;IAqK/B;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,0BAA0B;IAkKlC;;;;;;;;OAQG;IACH,OAAO,CAAC,gCAAgC;IAgIxC;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAiCxB;;OAEG;IACH,OAAO,CAAC,6BAA6B;IA2ErC;;;OAGG;IACH,OAAO,CAAC,oCAAoC;IAkD5C;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAgC9B;;OAEG;IACH,OAAO,CAAC,yBAAyB;IA0CjC;;;OAGG;IACH,OAAO,CAAC,gCAAgC;IA6BxC;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAoEhC;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAiD/B;;;OAGG;IACH,OAAO,CAAC,8BAA8B;IAoBtC;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IA2C/B;;OAEG;IACH,OAAO,CAAC,qBAAqB;CA0F7B"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VueAttributeExtractor = void 0;
|
|
4
4
|
const BaseExtractor_1 = require("./BaseExtractor");
|
|
5
|
-
const
|
|
5
|
+
const VueExpressionExtractor_1 = require("./VueExpressionExtractor");
|
|
6
6
|
/**
|
|
7
7
|
* Extracts class names from Vue template class attributes
|
|
8
8
|
*
|
|
@@ -27,7 +27,43 @@ const ExpressionExtractor_1 = require("./ExpressionExtractor");
|
|
|
27
27
|
class VueAttributeExtractor extends BaseExtractor_1.BaseExtractor {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
this.expressionExtractor = new
|
|
30
|
+
this.expressionExtractor = new VueExpressionExtractor_1.VueExpressionExtractor();
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Override to handle Vue's __VLS_ctx pattern.
|
|
34
|
+
*
|
|
35
|
+
* Vue generates code like __VLS_ctx.clsx(...) for template expressions
|
|
36
|
+
* where clsx is imported in the script section. We need to check if the
|
|
37
|
+
* function name (not __VLS_ctx) is directly imported.
|
|
38
|
+
*/
|
|
39
|
+
shouldValidateFunctionCall(callExpression, utilityFunctions, context) {
|
|
40
|
+
// First, check if this is a __VLS_ctx.functionName() pattern
|
|
41
|
+
if (context) {
|
|
42
|
+
const expr = callExpression.expression;
|
|
43
|
+
if (context.typescript.isPropertyAccessExpression(expr)) {
|
|
44
|
+
const objectExpr = expr.expression;
|
|
45
|
+
if (context.typescript.isIdentifier(objectExpr) && objectExpr.text === '__VLS_ctx') {
|
|
46
|
+
const functionName = expr.name.text;
|
|
47
|
+
// Check each utility function configuration
|
|
48
|
+
for (const utilityFunc of utilityFunctions) {
|
|
49
|
+
if (typeof utilityFunc === 'string') {
|
|
50
|
+
if (utilityFunc === functionName) {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else if (utilityFunc.name === functionName) {
|
|
55
|
+
// Check if the function is directly imported from expected module
|
|
56
|
+
if (this.isImportedFrom(functionName, utilityFunc.from, context)) {
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
// Fall back to base implementation for non-Vue patterns
|
|
66
|
+
return super.shouldValidateFunctionCall(callExpression, utilityFunctions, context);
|
|
31
67
|
}
|
|
32
68
|
canHandle(node, context) {
|
|
33
69
|
// We handle call expressions that look like Vue's generated element calls
|
|
@@ -187,25 +223,689 @@ class VueAttributeExtractor extends BaseExtractor_1.BaseExtractor {
|
|
|
187
223
|
return classNames;
|
|
188
224
|
}
|
|
189
225
|
// Array literal: class: ['flex', 'items-center']
|
|
226
|
+
// Vue wraps expressions in parentheses: class: (['flex', 'items-center'])
|
|
227
|
+
let arrayExpr;
|
|
190
228
|
if (context.typescript.isArrayLiteralExpression(value)) {
|
|
229
|
+
arrayExpr = value;
|
|
230
|
+
}
|
|
231
|
+
else if (context.typescript.isParenthesizedExpression(value)) {
|
|
232
|
+
const inner = value.expression;
|
|
233
|
+
if (context.typescript.isArrayLiteralExpression(inner)) {
|
|
234
|
+
arrayExpr = inner;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
if (arrayExpr) {
|
|
191
238
|
const addAttributeId = (classes) => classes.map(c => ({ ...c, attributeId }));
|
|
192
|
-
return addAttributeId(this.expressionExtractor.extract(
|
|
239
|
+
return addAttributeId(this.expressionExtractor.extract(arrayExpr, context));
|
|
193
240
|
}
|
|
194
241
|
// Template literal or other expressions - delegate to expression extractor
|
|
242
|
+
// Vue wraps expressions in parentheses: class: (`flex items-center`)
|
|
243
|
+
let templateExpr;
|
|
195
244
|
if (context.typescript.isTemplateExpression(value) ||
|
|
196
245
|
context.typescript.isNoSubstitutionTemplateLiteral(value)) {
|
|
246
|
+
templateExpr = value;
|
|
247
|
+
}
|
|
248
|
+
else if (context.typescript.isParenthesizedExpression(value)) {
|
|
249
|
+
const inner = value.expression;
|
|
250
|
+
if (context.typescript.isTemplateExpression(inner) ||
|
|
251
|
+
context.typescript.isNoSubstitutionTemplateLiteral(inner)) {
|
|
252
|
+
templateExpr = inner;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
if (templateExpr) {
|
|
197
256
|
const addAttributeId = (classes) => classes.map(c => ({ ...c, attributeId }));
|
|
198
|
-
return addAttributeId(this.expressionExtractor.extract(
|
|
257
|
+
return addAttributeId(this.expressionExtractor.extract(templateExpr, context));
|
|
199
258
|
}
|
|
200
259
|
// Call expression (utility functions like cn, clsx)
|
|
260
|
+
// Vue wraps expressions in parentheses: class: (__VLS_ctx.clsx(...))
|
|
261
|
+
let callExpr;
|
|
201
262
|
if (context.typescript.isCallExpression(value)) {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
263
|
+
callExpr = value;
|
|
264
|
+
}
|
|
265
|
+
else if (context.typescript.isParenthesizedExpression(value)) {
|
|
266
|
+
const inner = value.expression;
|
|
267
|
+
if (context.typescript.isCallExpression(inner)) {
|
|
268
|
+
callExpr = inner;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
if (callExpr && this.shouldValidateFunctionCall(callExpr, context.utilityFunctions, context)) {
|
|
272
|
+
const addAttributeId = (classes) => classes.map(c => ({ ...c, attributeId }));
|
|
273
|
+
return addAttributeId(this.expressionExtractor.extract(callExpr, context));
|
|
274
|
+
}
|
|
275
|
+
// Handle __VLS_ctx.propertyName patterns for variable/computed/function references
|
|
276
|
+
// Vue generates: class: (__VLS_ctx.myClass) for :class="myClass"
|
|
277
|
+
const resolvedClasses = this.extractFromVlsCtxReference(value, context, attributeId);
|
|
278
|
+
if (resolvedClasses.length > 0) {
|
|
279
|
+
return resolvedClasses;
|
|
280
|
+
}
|
|
281
|
+
return classNames;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Extract classes from __VLS_ctx patterns by resolving variable/function references.
|
|
285
|
+
*
|
|
286
|
+
* Vue's generated code transforms template expressions in two ways:
|
|
287
|
+
* - :class="myClass" becomes class: (__VLS_ctx.myClass) - property access
|
|
288
|
+
* - :class="getClasses()" becomes class: (__VLS_ctx.getClasses()) - call expression
|
|
289
|
+
*
|
|
290
|
+
* The symbol resolves to a property assignment in Vue's generated code like:
|
|
291
|
+
* `return { myClass: myClass as typeof myClass }` or
|
|
292
|
+
* `return { getClasses: getClasses as typeof getClasses }`
|
|
293
|
+
* We need to follow the reference chain to find the actual declaration.
|
|
294
|
+
*
|
|
295
|
+
* IMPORTANT: We use the TEMPLATE position (the propertyName in __VLS_ctx.propertyName)
|
|
296
|
+
* for diagnostics because Volar only maps diagnostics from the template-generated section,
|
|
297
|
+
* not from the script section. Script section positions have valid mappings but Volar
|
|
298
|
+
* doesn't apply them for diagnostics.
|
|
299
|
+
*/
|
|
300
|
+
extractFromVlsCtxReference(value, context, attributeId) {
|
|
301
|
+
const { typescript, typeChecker } = context;
|
|
302
|
+
if (!typeChecker) {
|
|
303
|
+
return [];
|
|
304
|
+
}
|
|
305
|
+
// Unwrap parenthesized expression if present
|
|
306
|
+
let expr = value;
|
|
307
|
+
if (typescript.isParenthesizedExpression(expr)) {
|
|
308
|
+
expr = expr.expression;
|
|
309
|
+
}
|
|
310
|
+
// Handle call expressions: __VLS_ctx.getClasses()
|
|
311
|
+
if (typescript.isCallExpression(expr)) {
|
|
312
|
+
const calleeExpr = expr.expression;
|
|
313
|
+
if (typescript.isPropertyAccessExpression(calleeExpr)) {
|
|
314
|
+
const objectExpr = calleeExpr.expression;
|
|
315
|
+
if (typescript.isIdentifier(objectExpr) && objectExpr.text === '__VLS_ctx') {
|
|
316
|
+
const functionName = calleeExpr.name;
|
|
317
|
+
if (typescript.isIdentifier(functionName)) {
|
|
318
|
+
// Use the function name position in template for diagnostics
|
|
319
|
+
const templatePosition = functionName.getStart();
|
|
320
|
+
const templateLength = functionName.text.length;
|
|
321
|
+
return this.extractFromVlsCtxFunctionCall(functionName, context, attributeId, templatePosition, templateLength);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return [];
|
|
326
|
+
}
|
|
327
|
+
// Check if this is a __VLS_ctx.propertyName pattern (property access)
|
|
328
|
+
if (!typescript.isPropertyAccessExpression(expr)) {
|
|
329
|
+
return [];
|
|
330
|
+
}
|
|
331
|
+
const objectExpr = expr.expression;
|
|
332
|
+
if (!typescript.isIdentifier(objectExpr) || objectExpr.text !== '__VLS_ctx') {
|
|
333
|
+
return [];
|
|
334
|
+
}
|
|
335
|
+
// Get the property name identifier (e.g., 'myClass' from __VLS_ctx.myClass)
|
|
336
|
+
const propertyName = expr.name;
|
|
337
|
+
// Vue's generated code uses regular identifiers, not private identifiers
|
|
338
|
+
if (!typescript.isIdentifier(propertyName)) {
|
|
339
|
+
return [];
|
|
340
|
+
}
|
|
341
|
+
// IMPORTANT: Use the template position (propertyName) for diagnostics
|
|
342
|
+
// This position has a valid Volar mapping that will be applied in the IDE
|
|
343
|
+
const templatePosition = propertyName.getStart();
|
|
344
|
+
const templateLength = propertyName.text.length;
|
|
345
|
+
// Use the type checker to resolve the symbol
|
|
346
|
+
const symbol = typeChecker.getSymbolAtLocation(propertyName);
|
|
347
|
+
if (!symbol) {
|
|
348
|
+
return [];
|
|
349
|
+
}
|
|
350
|
+
const declarations = symbol.getDeclarations();
|
|
351
|
+
if (!declarations || declarations.length === 0) {
|
|
352
|
+
return [];
|
|
353
|
+
}
|
|
354
|
+
const classNames = [];
|
|
355
|
+
// Keep original positions - diagnostic will point to where class is defined
|
|
356
|
+
const addAttributeId = (classes) => classes.map(c => ({
|
|
357
|
+
...c,
|
|
358
|
+
attributeId
|
|
359
|
+
}));
|
|
360
|
+
for (const declaration of declarations) {
|
|
361
|
+
// Handle variable declarations: const myClass = 'flex items-center'
|
|
362
|
+
if (typescript.isVariableDeclaration(declaration)) {
|
|
363
|
+
const initializer = declaration.initializer;
|
|
364
|
+
if (initializer) {
|
|
365
|
+
// Check if this is a computed() call
|
|
366
|
+
if (typescript.isCallExpression(initializer)) {
|
|
367
|
+
const computedClasses = this.extractFromComputedCall(initializer, context, attributeId, templatePosition, templateLength);
|
|
368
|
+
if (computedClasses.length > 0) {
|
|
369
|
+
classNames.push(...computedClasses);
|
|
370
|
+
continue;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
// For regular variables, extract classes from the initializer
|
|
374
|
+
// Keep original position from string literal
|
|
375
|
+
classNames.push(...addAttributeId(this.extractFromExpression(initializer, context)));
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
// Handle function declarations: function getClasses() { return [...] }
|
|
379
|
+
else if (typescript.isFunctionDeclaration(declaration)) {
|
|
380
|
+
const funcClasses = this.extractFromFunctionDeclaration(declaration, context, attributeId, templatePosition, templateLength);
|
|
381
|
+
classNames.push(...funcClasses);
|
|
382
|
+
}
|
|
383
|
+
// Handle property assignments in Vue's generated code:
|
|
384
|
+
// `return { myClass: myClass as typeof myClass }`
|
|
385
|
+
// The declaration is the PropertyAssignment, and we need to follow the reference
|
|
386
|
+
else if (typescript.isPropertyAssignment(declaration)) {
|
|
387
|
+
const initializer = declaration.initializer;
|
|
388
|
+
// Follow the reference: `myClass as typeof myClass` or just `myClass`
|
|
389
|
+
const resolvedClasses = this.resolvePropertyAssignmentClasses(initializer, context, attributeId, templatePosition, templateLength);
|
|
390
|
+
classNames.push(...resolvedClasses);
|
|
391
|
+
}
|
|
392
|
+
// Handle shorthand property assignments: `return { myClass }`
|
|
393
|
+
else if (typescript.isShorthandPropertyAssignment(declaration)) {
|
|
394
|
+
// The name itself is the reference to the variable
|
|
395
|
+
const resolvedClasses = this.resolveIdentifierClasses(declaration.name, context, attributeId, templatePosition, templateLength);
|
|
396
|
+
classNames.push(...resolvedClasses);
|
|
397
|
+
}
|
|
398
|
+
// Handle property signatures in Volar 3.x:
|
|
399
|
+
// type __VLS_SetupExposed = { myClass: typeof myClass; }
|
|
400
|
+
// The type is a string literal type that contains the class value
|
|
401
|
+
else if (typescript.isPropertySignature(declaration)) {
|
|
402
|
+
const resolvedClasses = this.extractFromPropertySignatureType(propertyName, context, attributeId);
|
|
403
|
+
classNames.push(...resolvedClasses);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
return classNames;
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Extract classes from a PropertySignature by getting the type.
|
|
410
|
+
*
|
|
411
|
+
* In Volar 3.x, script variables are exposed via a type like:
|
|
412
|
+
* type __VLS_SetupExposed = { myClass: typeof myClass; }
|
|
413
|
+
*
|
|
414
|
+
* We prioritize finding the actual variable declaration to use original positions,
|
|
415
|
+
* so errors point to the actual class strings in the script section.
|
|
416
|
+
*/
|
|
417
|
+
extractFromPropertySignatureType(identifier, context, attributeId) {
|
|
418
|
+
const { typescript, typeChecker } = context;
|
|
419
|
+
if (!typeChecker) {
|
|
420
|
+
return [];
|
|
421
|
+
}
|
|
422
|
+
// For computed/functions, we need to use template position since
|
|
423
|
+
// the actual class values are in dynamic expressions
|
|
424
|
+
const templatePosition = identifier.getStart();
|
|
425
|
+
const templateLength = identifier.text.length;
|
|
426
|
+
// PRIORITY 1: Try to find the actual variable declaration via PropertySignature's typeof
|
|
427
|
+
// This allows us to use original positions for string literals in the script section
|
|
428
|
+
const symbol = typeChecker.getSymbolAtLocation(identifier);
|
|
429
|
+
if (symbol) {
|
|
430
|
+
const declarations = symbol.getDeclarations();
|
|
431
|
+
if (declarations) {
|
|
432
|
+
for (const decl of declarations) {
|
|
433
|
+
if (typescript.isPropertySignature(decl) && decl.type) {
|
|
434
|
+
// Check if the type is a TypeQuery (typeof expression)
|
|
435
|
+
if (typescript.isTypeQueryNode(decl.type)) {
|
|
436
|
+
// The exprName contains the identifier we need to resolve
|
|
437
|
+
const exprName = decl.type.exprName;
|
|
438
|
+
if (typescript.isIdentifier(exprName)) {
|
|
439
|
+
// Get the symbol for this identifier
|
|
440
|
+
const varSymbol = typeChecker.getSymbolAtLocation(exprName);
|
|
441
|
+
if (varSymbol) {
|
|
442
|
+
const varDeclarations = varSymbol.getDeclarations();
|
|
443
|
+
if (varDeclarations) {
|
|
444
|
+
for (const varDecl of varDeclarations) {
|
|
445
|
+
if (typescript.isVariableDeclaration(varDecl) && varDecl.initializer) {
|
|
446
|
+
// Check if it's a computed() call - use ORIGINAL position
|
|
447
|
+
// so errors point to actual class strings in script
|
|
448
|
+
if (typescript.isCallExpression(varDecl.initializer)) {
|
|
449
|
+
const computedClasses = this.extractFromComputedCall(varDecl.initializer, context, attributeId
|
|
450
|
+
// Don't pass templatePosition - use original positions
|
|
451
|
+
);
|
|
452
|
+
if (computedClasses.length > 0) {
|
|
453
|
+
return computedClasses;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
// For string literals, use ORIGINAL position from script
|
|
457
|
+
// This makes errors point to the actual invalid class
|
|
458
|
+
const classes = this.extractFromExpression(varDecl.initializer, context);
|
|
459
|
+
if (classes.length > 0) {
|
|
460
|
+
return classes.map(c => ({ ...c, attributeId }));
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
// PRIORITY 2: Fall back to type-based extraction with template position
|
|
473
|
+
// This handles cases where we can't find the actual declaration
|
|
474
|
+
const type = typeChecker.getTypeAtLocation(identifier);
|
|
475
|
+
// Check if it's a string literal type (simple string variable)
|
|
476
|
+
if (type.isStringLiteral()) {
|
|
477
|
+
const classValue = type.value;
|
|
478
|
+
return this.parseClassString(classValue, identifier, context, attributeId);
|
|
479
|
+
}
|
|
480
|
+
// For union types (e.g., ternary expressions), collect all string literal types
|
|
481
|
+
if (type.isUnion()) {
|
|
482
|
+
const classNames = [];
|
|
483
|
+
for (const unionType of type.types) {
|
|
484
|
+
if (unionType.isStringLiteral()) {
|
|
485
|
+
classNames.push(...this.parseClassString(unionType.value, identifier, context, attributeId));
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
if (classNames.length > 0) {
|
|
489
|
+
return classNames;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
// PRIORITY 3: Fallback via type.getSymbol() for non-PropertySignature cases
|
|
493
|
+
const typeSymbol = type.getSymbol();
|
|
494
|
+
if (typeSymbol) {
|
|
495
|
+
const declarations = typeSymbol.getDeclarations();
|
|
496
|
+
if (declarations) {
|
|
497
|
+
for (const decl of declarations) {
|
|
498
|
+
if (typescript.isVariableDeclaration(decl) && decl.initializer) {
|
|
499
|
+
// Check if it's a computed() call
|
|
500
|
+
if (typescript.isCallExpression(decl.initializer)) {
|
|
501
|
+
const computedClasses = this.extractFromComputedCall(decl.initializer, context, attributeId, templatePosition, templateLength);
|
|
502
|
+
if (computedClasses.length > 0) {
|
|
503
|
+
return computedClasses;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
// Otherwise extract from the initializer directly
|
|
507
|
+
const classes = this.extractFromExpression(decl.initializer, context);
|
|
508
|
+
return classes.map(c => ({
|
|
509
|
+
...c,
|
|
510
|
+
attributeId,
|
|
511
|
+
absoluteStart: templatePosition,
|
|
512
|
+
length: templateLength,
|
|
513
|
+
line: context.sourceFile.getLineAndCharacterOfPosition(templatePosition).line + 1
|
|
514
|
+
}));
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
return [];
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Parse a class string into ClassNameInfo array.
|
|
523
|
+
* Uses the identifier position for diagnostics (mapped by Volar).
|
|
524
|
+
*/
|
|
525
|
+
parseClassString(classValue, identifier, context, attributeId) {
|
|
526
|
+
const classNames = [];
|
|
527
|
+
if (!classValue || classValue.length === 0) {
|
|
528
|
+
return classNames;
|
|
529
|
+
}
|
|
530
|
+
// Use identifier position for all diagnostics (Volar will map this)
|
|
531
|
+
const position = identifier.getStart();
|
|
532
|
+
const line = context.sourceFile.getLineAndCharacterOfPosition(position).line + 1;
|
|
533
|
+
const parts = classValue.split(/\s+/);
|
|
534
|
+
for (const part of parts) {
|
|
535
|
+
if (part && part.trim()) {
|
|
536
|
+
classNames.push({
|
|
537
|
+
className: part.trim(),
|
|
538
|
+
absoluteStart: position,
|
|
539
|
+
length: identifier.text.length,
|
|
540
|
+
line,
|
|
541
|
+
file: context.sourceFile.fileName,
|
|
542
|
+
attributeId
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
return classNames;
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* Extract classes from a __VLS_ctx.functionName() call by resolving the function.
|
|
550
|
+
*/
|
|
551
|
+
extractFromVlsCtxFunctionCall(functionName, context, attributeId, templatePosition, templateLength) {
|
|
552
|
+
const { typescript, typeChecker } = context;
|
|
553
|
+
if (!typeChecker) {
|
|
554
|
+
return [];
|
|
555
|
+
}
|
|
556
|
+
// Get the symbol for the function name
|
|
557
|
+
const symbol = typeChecker.getSymbolAtLocation(functionName);
|
|
558
|
+
if (!symbol) {
|
|
559
|
+
return [];
|
|
560
|
+
}
|
|
561
|
+
const declarations = symbol.getDeclarations();
|
|
562
|
+
if (!declarations || declarations.length === 0) {
|
|
563
|
+
return [];
|
|
564
|
+
}
|
|
565
|
+
const classNames = [];
|
|
566
|
+
for (const declaration of declarations) {
|
|
567
|
+
// Handle property assignment in Vue's return: `return { getClasses: getClasses as typeof getClasses }`
|
|
568
|
+
if (typescript.isPropertyAssignment(declaration)) {
|
|
569
|
+
const initializer = declaration.initializer;
|
|
570
|
+
// Unwrap type assertion: `getClasses as typeof getClasses` -> `getClasses`
|
|
571
|
+
let expr = initializer;
|
|
572
|
+
if (typescript.isAsExpression(expr)) {
|
|
573
|
+
expr = expr.expression;
|
|
574
|
+
}
|
|
575
|
+
// Resolve the identifier to the actual function
|
|
576
|
+
if (typescript.isIdentifier(expr)) {
|
|
577
|
+
const funcClasses = this.resolveFunctionIdentifier(expr, context, attributeId, templatePosition, templateLength);
|
|
578
|
+
classNames.push(...funcClasses);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
// Handle shorthand property: `return { getClasses }`
|
|
582
|
+
else if (typescript.isShorthandPropertyAssignment(declaration)) {
|
|
583
|
+
const funcClasses = this.resolveFunctionIdentifier(declaration.name, context, attributeId, templatePosition, templateLength);
|
|
584
|
+
classNames.push(...funcClasses);
|
|
585
|
+
}
|
|
586
|
+
// Handle property signature in Volar 3.x:
|
|
587
|
+
// type __VLS_SetupExposed = { getClasses: typeof getClasses; }
|
|
588
|
+
else if (typescript.isPropertySignature(declaration)) {
|
|
589
|
+
// The type is `typeof getClasses`, which refers to the actual function
|
|
590
|
+
// We need to get the type and find the function declaration
|
|
591
|
+
const funcClasses = this.extractFromPropertySignatureFunction(functionName, context, attributeId);
|
|
592
|
+
classNames.push(...funcClasses);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
return classNames;
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* Extract classes from a function referenced via PropertySignature.
|
|
599
|
+
* In Volar 3.x: `type __VLS_SetupExposed = { getClasses: typeof getClasses; }`
|
|
600
|
+
*/
|
|
601
|
+
extractFromPropertySignatureFunction(functionName, context, attributeId) {
|
|
602
|
+
const { typescript, typeChecker } = context;
|
|
603
|
+
if (!typeChecker) {
|
|
604
|
+
return [];
|
|
605
|
+
}
|
|
606
|
+
// Get the type at the function name location
|
|
607
|
+
const type = typeChecker.getTypeAtLocation(functionName);
|
|
608
|
+
// Try to find the actual function via type's symbol FIRST
|
|
609
|
+
// This gives us access to the function body for analysis
|
|
610
|
+
const typeSymbol = type.getSymbol();
|
|
611
|
+
if (typeSymbol) {
|
|
612
|
+
const funcDeclarations = typeSymbol.getDeclarations();
|
|
613
|
+
if (funcDeclarations) {
|
|
614
|
+
for (const decl of funcDeclarations) {
|
|
615
|
+
if (typescript.isFunctionDeclaration(decl) && decl.body) {
|
|
616
|
+
// Don't pass templatePosition - use original positions
|
|
617
|
+
// so errors point to actual class strings in script
|
|
618
|
+
return this.extractFromFunctionBody(decl.body, context, attributeId);
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
// Fallback: try to extract from return type if it's a tuple of literals
|
|
624
|
+
const callSignatures = type.getCallSignatures();
|
|
625
|
+
if (callSignatures.length === 0) {
|
|
626
|
+
return [];
|
|
627
|
+
}
|
|
628
|
+
const returnType = callSignatures[0].getReturnType();
|
|
629
|
+
// For array types like string[], check if elements are string literal types
|
|
630
|
+
if (typeChecker.isArrayType(returnType)) {
|
|
631
|
+
const typeArgs = returnType.typeArguments;
|
|
632
|
+
if (typeArgs && typeArgs.length > 0) {
|
|
633
|
+
const elementType = typeArgs[0];
|
|
634
|
+
return this.extractClassesFromType(elementType, functionName, context, attributeId);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
return [];
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* Extract classes from a TypeScript type (for union types, string literals, etc.)
|
|
641
|
+
*/
|
|
642
|
+
extractClassesFromType(type, identifier, context, attributeId) {
|
|
643
|
+
const { typeChecker } = context;
|
|
644
|
+
if (!typeChecker) {
|
|
645
|
+
return [];
|
|
646
|
+
}
|
|
647
|
+
const classNames = [];
|
|
648
|
+
// For union types, collect all string literal types
|
|
649
|
+
if (type.isUnion()) {
|
|
650
|
+
for (const unionType of type.types) {
|
|
651
|
+
if (unionType.isStringLiteral()) {
|
|
652
|
+
classNames.push(...this.parseClassString(unionType.value, identifier, context, attributeId));
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
// For single string literal type
|
|
657
|
+
else if (type.isStringLiteral()) {
|
|
658
|
+
classNames.push(...this.parseClassString(type.value, identifier, context, attributeId));
|
|
659
|
+
}
|
|
660
|
+
return classNames;
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Resolve a function identifier to its declaration and extract classes from return statements.
|
|
664
|
+
*/
|
|
665
|
+
resolveFunctionIdentifier(identifier, context, attributeId, templatePosition, templateLength) {
|
|
666
|
+
const { typescript, typeChecker } = context;
|
|
667
|
+
if (!typeChecker) {
|
|
668
|
+
return [];
|
|
669
|
+
}
|
|
670
|
+
const symbol = typeChecker.getSymbolAtLocation(identifier);
|
|
671
|
+
if (!symbol) {
|
|
672
|
+
return [];
|
|
673
|
+
}
|
|
674
|
+
const declarations = symbol.getDeclarations();
|
|
675
|
+
if (!declarations || declarations.length === 0) {
|
|
676
|
+
return [];
|
|
677
|
+
}
|
|
678
|
+
const classNames = [];
|
|
679
|
+
for (const declaration of declarations) {
|
|
680
|
+
if (typescript.isFunctionDeclaration(declaration)) {
|
|
681
|
+
classNames.push(...this.extractFromFunctionDeclaration(declaration, context, attributeId, templatePosition, templateLength));
|
|
205
682
|
}
|
|
206
683
|
}
|
|
207
684
|
return classNames;
|
|
208
685
|
}
|
|
686
|
+
/**
|
|
687
|
+
* Resolve classes from a property assignment initializer.
|
|
688
|
+
* Handles patterns like `myClass as typeof myClass` or just `myClass`.
|
|
689
|
+
*/
|
|
690
|
+
resolvePropertyAssignmentClasses(initializer, context, attributeId, templatePosition, templateLength) {
|
|
691
|
+
const { typescript } = context;
|
|
692
|
+
// Unwrap type assertions: `myClass as typeof myClass` -> `myClass`
|
|
693
|
+
let expr = initializer;
|
|
694
|
+
if (typescript.isAsExpression(expr)) {
|
|
695
|
+
expr = expr.expression;
|
|
696
|
+
}
|
|
697
|
+
// If it's an identifier, resolve it to the actual variable
|
|
698
|
+
if (typescript.isIdentifier(expr)) {
|
|
699
|
+
return this.resolveIdentifierClasses(expr, context, attributeId, templatePosition, templateLength);
|
|
700
|
+
}
|
|
701
|
+
return [];
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* Resolve classes from an identifier by finding its declaration.
|
|
705
|
+
*/
|
|
706
|
+
resolveIdentifierClasses(identifier, context, attributeId, templatePosition, templateLength) {
|
|
707
|
+
const { typescript, typeChecker } = context;
|
|
708
|
+
if (!typeChecker) {
|
|
709
|
+
return [];
|
|
710
|
+
}
|
|
711
|
+
const symbol = typeChecker.getSymbolAtLocation(identifier);
|
|
712
|
+
if (!symbol) {
|
|
713
|
+
return [];
|
|
714
|
+
}
|
|
715
|
+
const declarations = symbol.getDeclarations();
|
|
716
|
+
if (!declarations || declarations.length === 0) {
|
|
717
|
+
return [];
|
|
718
|
+
}
|
|
719
|
+
const classNames = [];
|
|
720
|
+
// Keep original positions - diagnostic will point to where class is defined
|
|
721
|
+
const addAttributeId = (classes) => classes.map(c => ({
|
|
722
|
+
...c,
|
|
723
|
+
attributeId
|
|
724
|
+
}));
|
|
725
|
+
for (const declaration of declarations) {
|
|
726
|
+
if (typescript.isVariableDeclaration(declaration)) {
|
|
727
|
+
const init = declaration.initializer;
|
|
728
|
+
if (init) {
|
|
729
|
+
// Check for computed() calls
|
|
730
|
+
if (typescript.isCallExpression(init)) {
|
|
731
|
+
const computedClasses = this.extractFromComputedCall(init, context, attributeId, templatePosition, templateLength);
|
|
732
|
+
if (computedClasses.length > 0) {
|
|
733
|
+
classNames.push(...computedClasses);
|
|
734
|
+
continue;
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
// Extract classes from the initializer - keep original position
|
|
738
|
+
classNames.push(...addAttributeId(this.extractFromExpression(init, context)));
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
else if (typescript.isFunctionDeclaration(declaration)) {
|
|
742
|
+
classNames.push(...this.extractFromFunctionDeclaration(declaration, context, attributeId, templatePosition, templateLength));
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
return classNames;
|
|
746
|
+
}
|
|
747
|
+
/**
|
|
748
|
+
* Extract classes from a computed() call expression.
|
|
749
|
+
* Handles: const classes = computed(() => ['flex', 'items-center'])
|
|
750
|
+
*/
|
|
751
|
+
extractFromComputedCall(callExpr, context, attributeId, templatePosition, templateLength) {
|
|
752
|
+
const { typescript } = context;
|
|
753
|
+
// Check if this is a call to 'computed'
|
|
754
|
+
const calleeExpr = callExpr.expression;
|
|
755
|
+
if (!typescript.isIdentifier(calleeExpr) || calleeExpr.text !== 'computed') {
|
|
756
|
+
return [];
|
|
757
|
+
}
|
|
758
|
+
// Get the callback argument
|
|
759
|
+
if (callExpr.arguments.length === 0) {
|
|
760
|
+
return [];
|
|
761
|
+
}
|
|
762
|
+
const callback = callExpr.arguments[0];
|
|
763
|
+
// Handle arrow functions: computed(() => [...])
|
|
764
|
+
if (typescript.isArrowFunction(callback)) {
|
|
765
|
+
return this.extractFromFunctionBody(callback.body, context, attributeId, templatePosition, templateLength);
|
|
766
|
+
}
|
|
767
|
+
// Handle regular functions: computed(function() { return [...] })
|
|
768
|
+
if (typescript.isFunctionExpression(callback)) {
|
|
769
|
+
if (callback.body) {
|
|
770
|
+
return this.extractFromFunctionBody(callback.body, context, attributeId, templatePosition, templateLength);
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
return [];
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* Extract classes from a function declaration's return statements.
|
|
777
|
+
* Handles: function getClasses() { return ['flex', 'items-center']; }
|
|
778
|
+
*/
|
|
779
|
+
extractFromFunctionDeclaration(funcDecl, context, attributeId, templatePosition, templateLength) {
|
|
780
|
+
if (!funcDecl.body) {
|
|
781
|
+
return [];
|
|
782
|
+
}
|
|
783
|
+
return this.extractFromFunctionBody(funcDecl.body, context, attributeId, templatePosition, templateLength);
|
|
784
|
+
}
|
|
785
|
+
/**
|
|
786
|
+
* Extract classes from a function body (block or expression).
|
|
787
|
+
* Handles both arrow function expressions and function blocks.
|
|
788
|
+
*/
|
|
789
|
+
extractFromFunctionBody(body, context, attributeId, templatePosition, templateLength) {
|
|
790
|
+
const { typescript } = context;
|
|
791
|
+
const classNames = [];
|
|
792
|
+
// If template position is provided, override positions for Volar mapping
|
|
793
|
+
const processClasses = (classes) => {
|
|
794
|
+
if (templatePosition !== undefined && templateLength !== undefined) {
|
|
795
|
+
return classes.map(c => ({
|
|
796
|
+
...c,
|
|
797
|
+
attributeId,
|
|
798
|
+
absoluteStart: templatePosition,
|
|
799
|
+
length: templateLength,
|
|
800
|
+
line: context.sourceFile.getLineAndCharacterOfPosition(templatePosition).line + 1
|
|
801
|
+
}));
|
|
802
|
+
}
|
|
803
|
+
return classes.map(c => ({ ...c, attributeId }));
|
|
804
|
+
};
|
|
805
|
+
// Handle concise arrow function: () => ['flex', 'items-center']
|
|
806
|
+
if (!typescript.isBlock(body)) {
|
|
807
|
+
// The body is an expression, extract classes from it
|
|
808
|
+
classNames.push(...processClasses(this.extractFromExpression(body, context)));
|
|
809
|
+
return classNames;
|
|
810
|
+
}
|
|
811
|
+
// Handle block body: look for return statements
|
|
812
|
+
const visitNode = (node) => {
|
|
813
|
+
if (typescript.isReturnStatement(node) && node.expression) {
|
|
814
|
+
classNames.push(...processClasses(this.extractFromExpression(node.expression, context)));
|
|
815
|
+
}
|
|
816
|
+
typescript.forEachChild(node, visitNode);
|
|
817
|
+
};
|
|
818
|
+
typescript.forEachChild(body, visitNode);
|
|
819
|
+
return classNames;
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* Extract classes from an expression (array, object, string, etc.)
|
|
823
|
+
*/
|
|
824
|
+
extractFromExpression(expr, context) {
|
|
825
|
+
const { typescript } = context;
|
|
826
|
+
const classNames = [];
|
|
827
|
+
// String literal: 'flex items-center'
|
|
828
|
+
if (typescript.isStringLiteral(expr)) {
|
|
829
|
+
const fullText = expr.text;
|
|
830
|
+
if (fullText.length === 0) {
|
|
831
|
+
return classNames;
|
|
832
|
+
}
|
|
833
|
+
const stringContentStart = expr.getStart() + 1;
|
|
834
|
+
let offset = 0;
|
|
835
|
+
const parts = fullText.split(/(\s+)/);
|
|
836
|
+
for (const part of parts) {
|
|
837
|
+
if (part && !/^\s+$/.test(part)) {
|
|
838
|
+
classNames.push({
|
|
839
|
+
className: part,
|
|
840
|
+
absoluteStart: stringContentStart + offset,
|
|
841
|
+
length: part.length,
|
|
842
|
+
line: context.sourceFile.getLineAndCharacterOfPosition(stringContentStart + offset).line +
|
|
843
|
+
1,
|
|
844
|
+
file: context.sourceFile.fileName
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
offset += part.length;
|
|
848
|
+
}
|
|
849
|
+
return classNames;
|
|
850
|
+
}
|
|
851
|
+
// Array literal: ['flex', 'items-center', { 'bg-red-500': isActive }]
|
|
852
|
+
if (typescript.isArrayLiteralExpression(expr)) {
|
|
853
|
+
for (const element of expr.elements) {
|
|
854
|
+
if (element === undefined)
|
|
855
|
+
continue;
|
|
856
|
+
if (typescript.isStringLiteral(element)) {
|
|
857
|
+
classNames.push(...this.extractFromExpression(element, context));
|
|
858
|
+
}
|
|
859
|
+
else if (typescript.isObjectLiteralExpression(element)) {
|
|
860
|
+
classNames.push(...this.extractFromExpression(element, context));
|
|
861
|
+
}
|
|
862
|
+
else if (typescript.isSpreadElement(element)) {
|
|
863
|
+
classNames.push(...this.extractFromExpression(element.expression, context));
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
return classNames;
|
|
867
|
+
}
|
|
868
|
+
// Object literal: { 'flex': true, 'bg-red-500': isActive }
|
|
869
|
+
if (typescript.isObjectLiteralExpression(expr)) {
|
|
870
|
+
for (const prop of expr.properties) {
|
|
871
|
+
if (typescript.isPropertyAssignment(prop)) {
|
|
872
|
+
const propName = prop.name;
|
|
873
|
+
let className;
|
|
874
|
+
let start;
|
|
875
|
+
if (typescript.isStringLiteral(propName)) {
|
|
876
|
+
className = propName.text;
|
|
877
|
+
start = propName.getStart() + 1;
|
|
878
|
+
}
|
|
879
|
+
else if (typescript.isIdentifier(propName)) {
|
|
880
|
+
className = propName.text;
|
|
881
|
+
start = propName.getStart();
|
|
882
|
+
}
|
|
883
|
+
if (className && start !== undefined) {
|
|
884
|
+
classNames.push({
|
|
885
|
+
className,
|
|
886
|
+
absoluteStart: start,
|
|
887
|
+
length: className.length,
|
|
888
|
+
line: context.sourceFile.getLineAndCharacterOfPosition(start).line + 1,
|
|
889
|
+
file: context.sourceFile.fileName
|
|
890
|
+
});
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
else if (typescript.isShorthandPropertyAssignment(prop)) {
|
|
894
|
+
const className = prop.name.text;
|
|
895
|
+
const start = prop.name.getStart();
|
|
896
|
+
classNames.push({
|
|
897
|
+
className,
|
|
898
|
+
absoluteStart: start,
|
|
899
|
+
length: className.length,
|
|
900
|
+
line: context.sourceFile.getLineAndCharacterOfPosition(start).line + 1,
|
|
901
|
+
file: context.sourceFile.fileName
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
return classNames;
|
|
906
|
+
}
|
|
907
|
+
return classNames;
|
|
908
|
+
}
|
|
209
909
|
}
|
|
210
910
|
exports.VueAttributeExtractor = VueAttributeExtractor;
|
|
211
911
|
//# sourceMappingURL=VueAttributeExtractor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VueAttributeExtractor.js","sourceRoot":"","sources":["../../src/extractors/VueAttributeExtractor.ts"],"names":[],"mappings":";;;AAGA,mDAAgD;AAChD,+DAA4D;AAE5D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,qBAAsB,SAAQ,6BAAa;IAGvD;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,mBAAmB,GAAG,IAAI,yCAAmB,EAAE,CAAC;IACtD,CAAC;IAED,SAAS,CAAC,IAAa,EAAE,OAA0B;QAClD,0EAA0E;QAC1E,iEAAiE;QACjE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;YAChD,OAAO,KAAK,CAAC;QACd,CAAC;QAED,2EAA2E;QAC3E,iFAAiF;QACjF,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACnC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,UAAU,CAAC,EAAE,CAAC;YACtD,OAAO,KAAK,CAAC;QACd,CAAC;QAED,mFAAmF;QACnF,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjC,OAAO,KAAK,CAAC;QACd,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACnC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,yBAAyB,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7D,OAAO,KAAK,CAAC;QACd,CAAC;QAED,oDAAoD;QACpD,OAAO,IAAI,CAAC,sBAAsB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAEO,sBAAsB,CAC7B,GAA+B,E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a,EAAE,KAAK;4BACpB,MAAM,EAAE,SAAS,CAAC,MAAM;4BACxB,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,6BAA6B,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC;4BACtE,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ;yBACjC,CAAC,CAAC;oBACJ,CAAC;gBACF,CAAC;qBAAM,IAAI,UAAU,CAAC,6BAA6B,CAAC,IAAI,CAAC,EAAE,CAAC;oBAC3D,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;oBACjC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACnC,UAAU,CAAC,IAAI,CAAC;wBACf,SAAS;wBACT,aAAa,EAAE,KAAK;wBACpB,MAAM,EAAE,SAAS,CAAC,MAAM;wBACxB,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,6BAA6B,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC;wBACtE,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ;qBACjC,CAAC,CAAC;gBACJ,CAAC;YACF,CAAC;YACD,OAAO,UAAU,CAAC;QACnB,CAAC;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;CACD;AA3qCD,sDA2qCC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as ts from 'typescript/lib/tsserverlibrary';
|
|
2
|
+
import { ExtractionContext, UtilityFunction } from '../core/types';
|
|
3
|
+
import { ExpressionExtractor } from './ExpressionExtractor';
|
|
4
|
+
/**
|
|
5
|
+
* Vue-specific expression extractor that handles Vue's __VLS_ctx pattern.
|
|
6
|
+
*
|
|
7
|
+
* When @vue/language-tools transforms Vue SFC templates, imported functions
|
|
8
|
+
* are accessed through __VLS_ctx (e.g., __VLS_ctx.clsx(...) instead of clsx(...)).
|
|
9
|
+
* This extractor recognizes this pattern and validates the underlying import.
|
|
10
|
+
*/
|
|
11
|
+
export declare class VueExpressionExtractor extends ExpressionExtractor {
|
|
12
|
+
/**
|
|
13
|
+
* Override to handle Vue's __VLS_ctx pattern.
|
|
14
|
+
*
|
|
15
|
+
* Vue generates code like __VLS_ctx.clsx(...) for template expressions
|
|
16
|
+
* where clsx is imported in the script section. We need to check if the
|
|
17
|
+
* function name (not __VLS_ctx) is directly imported.
|
|
18
|
+
*/
|
|
19
|
+
protected shouldValidateFunctionCall(callExpression: ts.CallExpression, utilityFunctions: UtilityFunction[], context?: ExtractionContext): boolean;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=VueExpressionExtractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VueExpressionExtractor.d.ts","sourceRoot":"","sources":["../../src/extractors/VueExpressionExtractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;;;GAMG;AACH,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC9D;;;;;;OAMG;cACgB,0BAA0B,CAC5C,cAAc,EAAE,EAAE,CAAC,cAAc,EACjC,gBAAgB,EAAE,eAAe,EAAE,EACnC,OAAO,CAAC,EAAE,iBAAiB,GACzB,OAAO;CA8BV"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VueExpressionExtractor = void 0;
|
|
4
|
+
const ExpressionExtractor_1 = require("./ExpressionExtractor");
|
|
5
|
+
/**
|
|
6
|
+
* Vue-specific expression extractor that handles Vue's __VLS_ctx pattern.
|
|
7
|
+
*
|
|
8
|
+
* When @vue/language-tools transforms Vue SFC templates, imported functions
|
|
9
|
+
* are accessed through __VLS_ctx (e.g., __VLS_ctx.clsx(...) instead of clsx(...)).
|
|
10
|
+
* This extractor recognizes this pattern and validates the underlying import.
|
|
11
|
+
*/
|
|
12
|
+
class VueExpressionExtractor extends ExpressionExtractor_1.ExpressionExtractor {
|
|
13
|
+
/**
|
|
14
|
+
* Override to handle Vue's __VLS_ctx pattern.
|
|
15
|
+
*
|
|
16
|
+
* Vue generates code like __VLS_ctx.clsx(...) for template expressions
|
|
17
|
+
* where clsx is imported in the script section. We need to check if the
|
|
18
|
+
* function name (not __VLS_ctx) is directly imported.
|
|
19
|
+
*/
|
|
20
|
+
shouldValidateFunctionCall(callExpression, utilityFunctions, context) {
|
|
21
|
+
// First, check if this is a __VLS_ctx.functionName() pattern
|
|
22
|
+
if (context) {
|
|
23
|
+
const expr = callExpression.expression;
|
|
24
|
+
if (context.typescript.isPropertyAccessExpression(expr)) {
|
|
25
|
+
const objectExpr = expr.expression;
|
|
26
|
+
if (context.typescript.isIdentifier(objectExpr) && objectExpr.text === '__VLS_ctx') {
|
|
27
|
+
const functionName = expr.name.text;
|
|
28
|
+
// Check each utility function configuration
|
|
29
|
+
for (const utilityFunc of utilityFunctions) {
|
|
30
|
+
if (typeof utilityFunc === 'string') {
|
|
31
|
+
if (utilityFunc === functionName) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else if (utilityFunc.name === functionName) {
|
|
36
|
+
// Check if the function is directly imported from expected module
|
|
37
|
+
if (this.isImportedFrom(functionName, utilityFunc.from, context)) {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// Fall back to base implementation for non-Vue patterns
|
|
47
|
+
return super.shouldValidateFunctionCall(callExpression, utilityFunctions, context);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.VueExpressionExtractor = VueExpressionExtractor;
|
|
51
|
+
//# sourceMappingURL=VueExpressionExtractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VueExpressionExtractor.js","sourceRoot":"","sources":["../../src/extractors/VueExpressionExtractor.ts"],"names":[],"mappings":";;;AAGA,+DAA4D;AAE5D;;;;;;GAMG;AACH,MAAa,sBAAuB,SAAQ,yCAAmB;IAC9D;;;;;;OAMG;IACgB,0BAA0B,CAC5C,cAAiC,EACjC,gBAAmC,EACnC,OAA2B;QAE3B,6DAA6D;QAC7D,IAAI,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,GAAG,cAAc,CAAC,UAAU,CAAC;YACvC,IAAI,OAAO,CAAC,UAAU,CAAC,0BAA0B,CAAC,IAAI,CAAC,EAAE,CAAC;gBACzD,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;gBACnC,IAAI,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;oBACpF,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;oBAEpC,4CAA4C;oBAC5C,KAAK,MAAM,WAAW,IAAI,gBAAgB,EAAE,CAAC;wBAC5C,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;4BACrC,IAAI,WAAW,KAAK,YAAY,EAAE,CAAC;gCAClC,OAAO,IAAI,CAAC;4BACb,CAAC;wBACF,CAAC;6BAAM,IAAI,WAAW,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;4BAC9C,kEAAkE;4BAClE,IAAI,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;gCAClE,OAAO,IAAI,CAAC;4BACb,CAAC;wBACF,CAAC;oBACF,CAAC;oBACD,OAAO,KAAK,CAAC;gBACd,CAAC;YACF,CAAC;QACF,CAAC;QAED,wDAAwD;QACxD,OAAO,KAAK,CAAC,0BAA0B,CAAC,cAAc,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACpF,CAAC;CACD;AA1CD,wDA0CC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tailwind-typescript-plugin",
|
|
3
|
-
"version": "1.4.0-beta.
|
|
3
|
+
"version": "1.4.0-beta.20",
|
|
4
4
|
"description": "TypeScript Language Service plugin that validates Tailwind CSS class names in JSX/TSX files. Catches typos and invalid classes in real-time with support for tailwind-variants and class-variance-authority.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|