@volar/vue-typescript
Advanced tools
Comparing version
@@ -5,3 +5,2 @@ "use strict"; | ||
function getProgram(ts, core, vueTsLs) { | ||
const program = vueTsLs.getProgram(); | ||
const proxy = { | ||
@@ -16,3 +15,3 @@ getRootFileNames, | ||
}; | ||
return new Proxy(program, { | ||
return new Proxy({}, { | ||
get: (target, property) => { | ||
@@ -22,7 +21,14 @@ if (property in proxy) { | ||
} | ||
const program = getProgram(); | ||
if (property in program) { | ||
return program[property]; | ||
} | ||
return target[property]; | ||
}, | ||
}); | ||
function getProgram() { | ||
return vueTsLs.getProgram(); | ||
} | ||
function getRootFileNames() { | ||
return program.getRootFileNames().filter(fileName => { var _a, _b; return (_b = (_a = core.typescriptLanguageServiceHost).fileExists) === null || _b === void 0 ? void 0 : _b.call(_a, fileName); }); | ||
return getProgram().getRootFileNames().filter(fileName => { var _a, _b; return (_b = (_a = core.typescriptLanguageServiceHost).fileExists) === null || _b === void 0 ? void 0 : _b.call(_a, fileName); }); | ||
} | ||
@@ -41,3 +47,3 @@ // for vue-tsc --noEmit --watch | ||
function getSourceFileDiagnosticsWorker(sourceFile, cancellationToken, api) { | ||
var _a, _b; | ||
var _a, _b, _c; | ||
if (sourceFile) { | ||
@@ -48,15 +54,15 @@ const mapped = core.mapper.fromEmbeddedFileName(sourceFile.fileName); | ||
return []; | ||
const errors = transformDiagnostics((_a = program === null || program === void 0 ? void 0 : program[api](sourceFile, cancellationToken)) !== null && _a !== void 0 ? _a : []); | ||
const errors = transformDiagnostics((_b = (_a = vueTsLs.getProgram()) === null || _a === void 0 ? void 0 : _a[api](sourceFile, cancellationToken)) !== null && _b !== void 0 ? _b : []); | ||
return errors; | ||
} | ||
} | ||
return transformDiagnostics((_b = program[api](sourceFile, cancellationToken)) !== null && _b !== void 0 ? _b : []); | ||
return transformDiagnostics((_c = getProgram()[api](sourceFile, cancellationToken)) !== null && _c !== void 0 ? _c : []); | ||
} | ||
function getGlobalDiagnostics(cancellationToken) { | ||
var _a; | ||
return transformDiagnostics((_a = program.getGlobalDiagnostics(cancellationToken)) !== null && _a !== void 0 ? _a : []); | ||
return transformDiagnostics((_a = getProgram().getGlobalDiagnostics(cancellationToken)) !== null && _a !== void 0 ? _a : []); | ||
} | ||
function emit(targetSourceFile, _writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { | ||
var _a; | ||
const scriptResult = program.emit(targetSourceFile, ((_a = core.typescriptLanguageServiceHost.writeFile) !== null && _a !== void 0 ? _a : ts.sys.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers); | ||
const scriptResult = getProgram().emit(targetSourceFile, ((_a = core.typescriptLanguageServiceHost.writeFile) !== null && _a !== void 0 ? _a : ts.sys.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers); | ||
return { | ||
@@ -63,0 +69,0 @@ emitSkipped: scriptResult.emitSkipped, |
{ | ||
"name": "@volar/vue-typescript", | ||
"version": "0.39.2", | ||
"version": "0.39.3", | ||
"main": "out/index.js", | ||
@@ -19,7 +19,7 @@ "license": "MIT", | ||
"dependencies": { | ||
"@volar/code-gen": "0.39.2", | ||
"@volar/typescript-faster": "0.39.2", | ||
"@volar/vue-language-core": "0.39.2" | ||
"@volar/code-gen": "0.39.3", | ||
"@volar/typescript-faster": "0.39.3", | ||
"@volar/vue-language-core": "0.39.3" | ||
}, | ||
"gitHead": "eac2dca4206dfa3f92ad50dd53650f924a9e6f94" | ||
"gitHead": "57a7b0f627e58277ec34241ccbe4bf5253f7daf8" | ||
} |
21424
0.92%387
1.57%+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
Updated