@volar/vue-language-core
Advanced tools
Comparing version 1.6.4 to 1.7.0-alpha.0
@@ -15,3 +15,3 @@ "use strict"; | ||
const mirrorBehaviorMappings = []; | ||
//#region monkey fix: https://github.com/johnsoncodehk/volar/pull/2113 | ||
//#region monkey fix: https://github.com/vuejs/language-tools/pull/2113 | ||
const sfc = { | ||
@@ -105,3 +105,3 @@ script: _sfc.script, | ||
if (usedHelperTypes.ConstructorOverloads) { | ||
// fix https://github.com/johnsoncodehk/volar/issues/926 | ||
// fix https://github.com/vuejs/language-tools/issues/926 | ||
codes.push('type __VLS_UnionToIntersection<U> = __VLS_Prettify<(U extends unknown ? (arg: U) => unknown : never) extends ((arg: infer P) => unknown) ? P : never>;\n'); | ||
@@ -239,3 +239,3 @@ usedPrettify = true; | ||
} | ||
// fix https://github.com/johnsoncodehk/volar/issues/1127 | ||
// fix https://github.com/vuejs/language-tools/issues/1127 | ||
codes.push([ | ||
@@ -439,3 +439,3 @@ '', | ||
if (scriptSetupRanges.propsTypeArg && scriptSetupRanges.withDefaultsArg) { | ||
// fix https://github.com/johnsoncodehk/volar/issues/1187 | ||
// fix https://github.com/vuejs/language-tools/issues/1187 | ||
codes.push(`const __VLS_withDefaultsArg = (function <T>(t: T) { return t })(`); | ||
@@ -442,0 +442,0 @@ addExtraReferenceVirtualCode('scriptSetup', scriptSetupRanges.withDefaultsArg.start, scriptSetupRanges.withDefaultsArg.end); |
@@ -1,4 +0,4 @@ | ||
import type * as embedded from '@volar/language-core'; | ||
import type { Language } from '@volar/language-core'; | ||
import { VueCompilerOptions } from './types'; | ||
import type * as ts from 'typescript/lib/tsserverlibrary'; | ||
export declare function createLanguageModules(ts: typeof import('typescript/lib/tsserverlibrary'), compilerOptions: ts.CompilerOptions, vueCompilerOptions: VueCompilerOptions): embedded.LanguageModule[]; | ||
export declare function createLanguages(ts: typeof import('typescript/lib/tsserverlibrary'), compilerOptions: ts.CompilerOptions, vueCompilerOptions: VueCompilerOptions): Language[]; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createLanguageModules = void 0; | ||
exports.createLanguages = void 0; | ||
const path_1 = require("path"); | ||
@@ -8,3 +8,3 @@ const plugins_1 = require("./plugins"); | ||
const sharedTypes = require("./utils/directorySharedTypes"); | ||
function createLanguageModules(ts, compilerOptions, vueCompilerOptions) { | ||
function createLanguages(ts, compilerOptions, vueCompilerOptions) { | ||
patchResolveModuleNames(ts, vueCompilerOptions); | ||
@@ -14,3 +14,3 @@ const vueLanguagePlugin = (0, plugins_1.getDefaultVueLanguagePlugins)(ts, compilerOptions, vueCompilerOptions); | ||
const languageModule = { | ||
createFile(fileName, snapshot, languageId) { | ||
createVirtualFile(fileName, snapshot, languageId) { | ||
if (languageId === 'vue' | ||
@@ -22,7 +22,8 @@ || (!languageId | ||
}, | ||
updateFile(sourceFile, snapshot) { | ||
updateVirtualFile(sourceFile, snapshot) { | ||
sourceFile.update(snapshot); | ||
}, | ||
proxyLanguageServiceHost(host) { | ||
resolveHost(host) { | ||
return { | ||
...host, | ||
fileExists(fileName) { | ||
@@ -69,6 +70,6 @@ const basename = path_1.posix.basename(fileName); | ||
} | ||
exports.createLanguageModules = createLanguageModules; | ||
exports.createLanguages = createLanguages; | ||
function patchResolveModuleNames(ts, vueCompilerOptions) { | ||
try { | ||
// from https://github.com/johnsoncodehk/volar/pull/1543 | ||
// from https://github.com/vuejs/language-tools/pull/1543 | ||
if (!(ts.__vuePatchResolveModuleNames)) { | ||
@@ -75,0 +76,0 @@ ts.__vuePatchResolveModuleNames = true; |
@@ -11,3 +11,3 @@ "use strict"; | ||
let node = raw; | ||
while (ts.isAsExpression(node.expression) || ts.isParenthesizedExpression(node.expression)) { // fix https://github.com/johnsoncodehk/volar/issues/1882 | ||
while (ts.isAsExpression(node.expression) || ts.isParenthesizedExpression(node.expression)) { // fix https://github.com/vuejs/language-tools/issues/1882 | ||
node = node.expression; | ||
@@ -14,0 +14,0 @@ } |
@@ -28,3 +28,3 @@ "use strict"; | ||
&& !ts.isEmptyStatement(node) | ||
// fix https://github.com/johnsoncodehk/volar/issues/1223 | ||
// fix https://github.com/vuejs/language-tools/issues/1223 | ||
&& !ts.isImportEqualsDeclaration(node)) { | ||
@@ -31,0 +31,0 @@ importSectionEndOffset = node.getStart(ast, true); |
@@ -106,3 +106,3 @@ "use strict"; | ||
} ? (...payload: P) => void | ||
: unknown | '[Type Warning] Volar could not infer $emit event more than 4 overloads without DefineComponent. see https://github.com/johnsoncodehk/volar/issues/60'; | ||
: unknown | '[Type Warning] Volar could not infer $emit event more than 4 overloads without DefineComponent. see https://github.com/vuejs/language-tools/issues/60'; | ||
export declare function asFunctionalComponent<T, K = T extends new (...args: any) => any ? InstanceType<T> : unknown>(t: T, instance?: K): | ||
@@ -139,3 +139,3 @@ T extends new (...args: any) => any | ||
// TODO: not working for overloads > n (n = 8) | ||
// see: https://github.com/johnsoncodehk/volar/issues/60 | ||
// see: https://github.com/vuejs/language-tools/issues/60 | ||
function genConstructorOverloads(name = 'ConstructorOverloads', nums) { | ||
@@ -142,0 +142,0 @@ let code = ''; |
@@ -35,4 +35,4 @@ "use strict"; | ||
for (let i = 0; i < ctxVars.length - 1; i++) { | ||
// fix https://github.com/johnsoncodehk/volar/issues/1205 | ||
// fix https://github.com/johnsoncodehk/volar/issues/1264 | ||
// fix https://github.com/vuejs/language-tools/issues/1205 | ||
// fix https://github.com/vuejs/language-tools/issues/1264 | ||
cb('', ctxVars[i + 1].offset, true); | ||
@@ -127,3 +127,3 @@ if (vueOptions.experimentalUseElementAccessInTemplate) { | ||
if (ts.isPropertyAssignment(prop)) { | ||
// fix https://github.com/johnsoncodehk/volar/issues/1176 | ||
// fix https://github.com/vuejs/language-tools/issues/1176 | ||
if (ts.isComputedPropertyName(prop.name)) { | ||
@@ -134,7 +134,7 @@ walkIdentifiers(ts, prop.name.expression, cb, localVars); | ||
} | ||
// fix https://github.com/johnsoncodehk/volar/issues/1156 | ||
// fix https://github.com/vuejs/language-tools/issues/1156 | ||
else if (ts.isShorthandPropertyAssignment(prop)) { | ||
walkIdentifiers(ts, prop, cb, localVars); | ||
} | ||
// fix https://github.com/johnsoncodehk/volar/issues/1148#issuecomment-1094378126 | ||
// fix https://github.com/vuejs/language-tools/issues/1148#issuecomment-1094378126 | ||
else if (ts.isSpreadAssignment(prop)) { | ||
@@ -147,3 +147,3 @@ // TODO: cannot report "Spread types may only be created from object types.ts(2698)" | ||
else if (ts.isTypeReferenceNode(node)) { | ||
// fix https://github.com/johnsoncodehk/volar/issues/1422 | ||
// fix https://github.com/vuejs/language-tools/issues/1422 | ||
node.forEachChild(node => walkIdentifiersInTypeReference(ts, node, cb)); | ||
@@ -150,0 +150,0 @@ } |
@@ -30,3 +30,3 @@ "use strict"; | ||
const content = ts.parseJsonSourceFileConfigFileContent(config, proxyHost.host, path.dirname(tsConfigPath), {}, tsConfigPath, undefined, extraFileExtensions); | ||
// fix https://github.com/johnsoncodehk/volar/issues/1786 | ||
// fix https://github.com/vuejs/language-tools/issues/1786 | ||
// https://github.com/microsoft/TypeScript/issues/30457 | ||
@@ -33,0 +33,0 @@ // patching ts server broke with outDir + rootDir + composite/incremental |
@@ -26,3 +26,3 @@ "use strict"; | ||
if (error.code === 33 /* CompilerDom.ErrorCodes.X_V_FOR_TEMPLATE_KEY_PLACEMENT */ // :key binding allowed in v-for template child in vue 2 | ||
|| error.code === 29 /* CompilerDom.ErrorCodes.X_V_IF_SAME_KEY */ // fix https://github.com/johnsoncodehk/volar/issues/1638 | ||
|| error.code === 29 /* CompilerDom.ErrorCodes.X_V_IF_SAME_KEY */ // fix https://github.com/vuejs/language-tools/issues/1638 | ||
) { | ||
@@ -29,0 +29,0 @@ return; |
{ | ||
"name": "@volar/vue-language-core", | ||
"version": "1.6.4", | ||
"version": "1.7.0-alpha.0", | ||
"main": "out/index.js", | ||
@@ -16,4 +16,4 @@ "license": "MIT", | ||
"dependencies": { | ||
"@volar/language-core": "1.4.1", | ||
"@volar/source-map": "1.4.1", | ||
"@volar/language-core": "1.5.1", | ||
"@volar/source-map": "1.5.1", | ||
"@vue/compiler-dom": "^3.3.0-beta.3", | ||
@@ -30,3 +30,3 @@ "@vue/compiler-sfc": "^3.3.0-beta.3", | ||
}, | ||
"gitHead": "c3d0c6a719159776f8d1899b35c2500286fe338c" | ||
"gitHead": "03642106a0961897a059fde66ed626e2266d5979" | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
233091
5116
2
+ Added@volar/language-core@1.5.1(transitive)
+ Added@volar/source-map@1.5.1(transitive)
- Removed@volar/language-core@1.4.1(transitive)
- Removed@volar/source-map@1.4.1(transitive)
Updated@volar/language-core@1.5.1
Updated@volar/source-map@1.5.1