@volar/vue-code-gen
Advanced tools
Comparing version 0.34.9 to 0.34.10
@@ -24,3 +24,5 @@ "use strict"; | ||
&& !isTypeExport | ||
&& !ts.isEmptyStatement(node)) { | ||
&& !ts.isEmptyStatement(node) | ||
// fix https://github.com/johnsoncodehk/volar/issues/1223 | ||
&& !ts.isImportEqualsDeclaration(node)) { | ||
importSectionEndOffset = node.getStart(ast); | ||
@@ -27,0 +29,0 @@ foundNonImportExportNode = true; |
import type * as ts from 'typescript/lib/tsserverlibrary'; | ||
export declare function walkInterpolationFragment(ts: typeof import('typescript/lib/tsserverlibrary'), code: string, cb: (fragment: string, offset: number | undefined) => void, localVars: Record<string, number>, identifiers: Set<string>): void; | ||
export declare function walkInterpolationFragment(ts: typeof import('typescript/lib/tsserverlibrary'), code: string, cb: (fragment: string, offset: number | undefined, beforeCtxAccess?: { | ||
ctxText: string; | ||
varLength: number; | ||
}) => void, localVars: Record<string, number>, identifiers: Set<string>): void; | ||
export declare function colletVars(ts: typeof import('typescript/lib/tsserverlibrary'), node: ts.Node, result: string[]): void; |
@@ -28,2 +28,3 @@ "use strict"; | ||
// localVarOffsets = localVarOffsets.sort((a, b) => a - b); | ||
let lastCtxAccess; | ||
if (ctxVars.length) { | ||
@@ -38,13 +39,15 @@ if (ctxVars[0].isShorthand) { | ||
for (let i = 0; i < ctxVars.length - 1; i++) { | ||
cb('__VLS_ctx.', undefined); | ||
writeCtxAccess(ctxVars[i].text.length); | ||
if (ctxVars[i + 1].isShorthand) { | ||
cb(code.substring(ctxVars[i].offset, ctxVars[i + 1].offset + ctxVars[i + 1].text.length), ctxVars[i].offset); | ||
cb(code.substring(ctxVars[i].offset, ctxVars[i + 1].offset + ctxVars[i + 1].text.length), ctxVars[i].offset, lastCtxAccess); | ||
cb(': ', undefined); | ||
} | ||
else { | ||
cb(code.substring(ctxVars[i].offset, ctxVars[i + 1].offset), ctxVars[i].offset); | ||
cb(code.substring(ctxVars[i].offset, ctxVars[i + 1].offset), ctxVars[i].offset, lastCtxAccess); | ||
} | ||
lastCtxAccess = undefined; | ||
} | ||
cb('__VLS_ctx.', undefined); | ||
cb(code.substring(ctxVars[ctxVars.length - 1].offset), ctxVars[ctxVars.length - 1].offset); | ||
writeCtxAccess(ctxVars[ctxVars.length - 1].text.length); | ||
cb(code.substring(ctxVars[ctxVars.length - 1].offset), ctxVars[ctxVars.length - 1].offset, lastCtxAccess); | ||
lastCtxAccess = undefined; | ||
} | ||
@@ -54,2 +57,9 @@ else { | ||
} | ||
function writeCtxAccess(varLength) { | ||
cb('__VLS_ctx.', undefined); | ||
lastCtxAccess = { | ||
ctxText: '__VLS_ctx.', | ||
varLength, | ||
}; | ||
} | ||
} | ||
@@ -56,0 +66,0 @@ exports.walkInterpolationFragment = walkInterpolationFragment; |
{ | ||
"name": "@volar/vue-code-gen", | ||
"version": "0.34.9", | ||
"version": "0.34.10", | ||
"main": "out/index.js", | ||
@@ -19,4 +19,4 @@ "license": "MIT", | ||
"dependencies": { | ||
"@volar/code-gen": "0.34.9", | ||
"@volar/source-map": "0.34.9", | ||
"@volar/code-gen": "0.34.10", | ||
"@volar/source-map": "0.34.10", | ||
"@vue/compiler-core": "^3.2.31", | ||
@@ -26,3 +26,3 @@ "@vue/compiler-dom": "^3.2.31", | ||
}, | ||
"gitHead": "80523163eb73755da2b136be15c871e7a4c5ce6e" | ||
"gitHead": "0c9b6df3a2cefa25bbac9a38003eae729a772dd5" | ||
} |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
142242
3135
+ Added@volar/code-gen@0.34.10(transitive)
+ Added@volar/source-map@0.34.10(transitive)
- Removed@volar/code-gen@0.34.9(transitive)
- Removed@volar/source-map@0.34.9(transitive)
Updated@volar/code-gen@0.34.10
Updated@volar/source-map@0.34.10