Skip to content

Commit

Permalink
Use JSDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Aug 22, 2024
1 parent 598cfad commit 57eebba
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/language-core/lib/codegen/template/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,11 @@ export function* generateComponent(
const camelizedTag = camelize(node.tag);
if (variableNameRegex.test(camelizedTag)) {
// renaming / find references support
yield `/** @type { [`;
for (const tagOffset of tagOffsets) {
for (const shouldCapitalize of (node.tag[0] === node.tag[0].toUpperCase() ? [false] : [true, false])) {
const expectName = shouldCapitalize ? capitalize(camelizedTag) : camelizedTag;
yield `__VLS_components.`;
yield `typeof __VLS_components.`;
yield* generateCamelized(
shouldCapitalize ? capitalize(node.tag) : node.tag,
tagOffset,
Expand All @@ -162,10 +163,10 @@ export function* generateComponent(
},
}
);
yield `;`;
yield `, `;
}
}
yield `${newLine}`;
yield `] } */${newLine}`;
// auto import support
if (options.edited) {
yield `// @ts-ignore${newLine}`; // #2304
Expand Down

0 comments on commit 57eebba

Please sign in to comment.