@vue-macros/volar
Advanced tools
Comparing version 0.18.12 to 0.18.13
@@ -116,3 +116,3 @@ // src/jsx-directive.ts | ||
source, | ||
attribute.initializer.expression.pos, | ||
attribute.initializer.expression.getStart(sfc[source]?.ast), | ||
import_language_core2.FileRangeCapabilities.full | ||
@@ -124,3 +124,3 @@ ] : "", | ||
const node2 = ts.isJsxElement(child) && child.openingElement.tagName.getText(sfc[source]?.ast) === "template" ? child.children : child; | ||
return [ | ||
return ts.isJsxSelfClosingElement(child) ? "" : [ | ||
sfc[source].content.slice(node2.pos, node2.end), | ||
@@ -198,10 +198,14 @@ source, | ||
const list = attribute.initializer.expression.right; | ||
if (ts.isParenthesizedExpression(item) && ts.isBinaryExpression(item.expression)) { | ||
if (ts.isBinaryExpression(item.expression.left)) { | ||
index = item.expression.left.right; | ||
objectIndex = item.expression.right; | ||
item = item.expression.left.left; | ||
if (ts.isParenthesizedExpression(item)) { | ||
if (ts.isBinaryExpression(item.expression)) { | ||
if (ts.isBinaryExpression(item.expression.left)) { | ||
index = item.expression.left.right; | ||
objectIndex = item.expression.right; | ||
item = item.expression.left.left; | ||
} else { | ||
index = item.expression.right; | ||
item = item.expression.left; | ||
} | ||
} else { | ||
index = item.expression.right; | ||
item = item.expression.left; | ||
item = item.expression; | ||
} | ||
@@ -219,5 +223,5 @@ } | ||
[ | ||
sfc[source].content.slice(list.pos + 1, list.end), | ||
sfc[source].content.slice(list.getStart(sfc[source]?.ast), list.end), | ||
source, | ||
list.pos + 1, | ||
list.getStart(sfc[source]?.ast), | ||
import_language_core3.FileRangeCapabilities.full | ||
@@ -227,21 +231,22 @@ ], | ||
[ | ||
`${sfc[source]?.content.slice(item.pos, item.end)}`, | ||
`${sfc[source]?.content.slice(item.getStart(sfc[source]?.ast), item.end)}`, | ||
source, | ||
item.pos, | ||
item.getStart(sfc[source]?.ast), | ||
import_language_core3.FileRangeCapabilities.full | ||
], | ||
", ", | ||
index ? [ | ||
`, ${sfc[source]?.content.slice(index.pos + 1, index.end)}`, | ||
`${sfc[source]?.content.slice(index.getStart(sfc[source]?.ast), index.end)}`, | ||
source, | ||
index.pos - 1, | ||
index.getStart(sfc[source]?.ast), | ||
import_language_core3.FileRangeCapabilities.full | ||
] : objectIndex ? ", undefined" : "", | ||
objectIndex ? [ | ||
`, ${sfc[source]?.content.slice( | ||
objectIndex.pos + 1, | ||
objectIndex.end | ||
)}`, | ||
source, | ||
objectIndex.pos - 1, | ||
import_language_core3.FileRangeCapabilities.full | ||
] : objectIndex ? "undefined" : "", | ||
...objectIndex ? [ | ||
", ", | ||
[ | ||
`${sfc[source]?.content.slice(objectIndex.getStart(sfc[source]?.ast), objectIndex.end)}`, | ||
source, | ||
objectIndex.getStart(sfc[source]?.ast), | ||
import_language_core3.FileRangeCapabilities.full | ||
] | ||
] : "", | ||
@@ -285,7 +290,7 @@ "]) => " | ||
node.pos, | ||
`${hasScope ? `{` : " "}(`, | ||
`${hasScope ? "{" : " "}(`, | ||
[ | ||
expressionText, | ||
source, | ||
attribute.end - expressionText.length - 1, | ||
attribute.initializer.expression.getStart(sfc[source]?.ast), | ||
import_language_core4.FileRangeCapabilities.full | ||
@@ -603,3 +608,3 @@ ], | ||
for (const child of parent.children) { | ||
if (ts.isJsxElement(child) && getTagName(child) === "template" || ts.isJsxText(child) && !child.getText(sfc[source]?.ast).trim()) | ||
if (getTagName(child) === "template" || ts.isJsxText(child) && !child.getText(sfc[source]?.ast).trim()) | ||
continue; | ||
@@ -606,0 +611,0 @@ const defaultNodes = attributeMap.get(null)?.children || attributeMap.set(null, { children: [] }).get(null).children; |
{ | ||
"name": "@vue-macros/volar", | ||
"version": "0.18.12", | ||
"version": "0.18.13", | ||
"packageManager": "pnpm@8.15.5", | ||
@@ -5,0 +5,0 @@ "description": "Volar plugin for Vue Macros.", |
42446
1279