vue-tsc 0.37.0 → 0.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/apis.d.ts +5 -5
- package/out/apis.js +9 -9
- package/out/proxy.js +1 -1
- package/package.json +3 -3
package/out/apis.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type * as ts from 'typescript/lib/tsserverlibrary';
|
|
2
|
-
import type { TypeScriptRuntime } from '@volar/vue-typescript';
|
|
3
|
-
export declare function register(ts: typeof import('typescript/lib/tsserverlibrary'), context: TypeScriptRuntime): {
|
|
2
|
+
import type { TypeScriptRuntime, LanguageServiceHost } from '@volar/vue-typescript';
|
|
3
|
+
export declare function register(ts: typeof import('typescript/lib/tsserverlibrary'), context: TypeScriptRuntime, vueLsHost: LanguageServiceHost): {
|
|
4
4
|
getRootFileNames: () => string[];
|
|
5
5
|
emit: (targetSourceFile?: ts.SourceFile, _writeFile?: ts.WriteFileCallback, cancellationToken?: ts.CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: ts.CustomTransformers) => ts.EmitResult;
|
|
6
|
-
getSyntacticDiagnostics: (sourceFile?: ts.SourceFile, cancellationToken?: ts.CancellationToken) => readonly ts.
|
|
7
|
-
getSemanticDiagnostics: (sourceFile?: ts.SourceFile, cancellationToken?: ts.CancellationToken) => readonly ts.
|
|
6
|
+
getSyntacticDiagnostics: (sourceFile?: ts.SourceFile, cancellationToken?: ts.CancellationToken) => readonly ts.Diagnostic[] | readonly ts.DiagnosticWithLocation[];
|
|
7
|
+
getSemanticDiagnostics: (sourceFile?: ts.SourceFile, cancellationToken?: ts.CancellationToken) => readonly ts.Diagnostic[] | readonly ts.DiagnosticWithLocation[];
|
|
8
8
|
getGlobalDiagnostics: (cancellationToken?: ts.CancellationToken) => readonly ts.Diagnostic[];
|
|
9
|
-
getBindAndCheckDiagnostics: (sourceFile?: ts.SourceFile, cancellationToken?: ts.CancellationToken) => readonly ts.
|
|
9
|
+
getBindAndCheckDiagnostics: (sourceFile?: ts.SourceFile, cancellationToken?: ts.CancellationToken) => readonly ts.Diagnostic[] | readonly ts.DiagnosticWithLocation[];
|
|
10
10
|
};
|
package/out/apis.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.register = void 0;
|
|
4
|
-
function register(ts, context) {
|
|
4
|
+
function register(ts, context, vueLsHost) {
|
|
5
5
|
return {
|
|
6
6
|
getRootFileNames,
|
|
7
7
|
emit,
|
|
@@ -44,7 +44,7 @@ function register(ts, context) {
|
|
|
44
44
|
}
|
|
45
45
|
function emit(targetSourceFile, _writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) {
|
|
46
46
|
var _a;
|
|
47
|
-
const scriptResult = getProgram().emit(targetSourceFile, ((_a =
|
|
47
|
+
const scriptResult = getProgram().emit(targetSourceFile, ((_a = vueLsHost.writeFile) !== null && _a !== void 0 ? _a : ts.sys.writeFile), cancellationToken, emitOnlyDtsFiles, customTransformers);
|
|
48
48
|
return {
|
|
49
49
|
emitSkipped: scriptResult.emitSkipped,
|
|
50
50
|
emittedFiles: scriptResult.emittedFiles,
|
|
@@ -56,7 +56,7 @@ function register(ts, context) {
|
|
|
56
56
|
}
|
|
57
57
|
// transform
|
|
58
58
|
function transformDiagnostics(diagnostics) {
|
|
59
|
-
var _a, _b, _c, _d, _e
|
|
59
|
+
var _a, _b, _c, _d, _e;
|
|
60
60
|
const result = [];
|
|
61
61
|
for (const diagnostic of diagnostics) {
|
|
62
62
|
if (diagnostic.file !== undefined
|
|
@@ -64,23 +64,23 @@ function register(ts, context) {
|
|
|
64
64
|
&& diagnostic.length !== undefined) {
|
|
65
65
|
let founded = false;
|
|
66
66
|
for (const tsOrVueLoc of context.vueFiles.fromEmbeddedLocation(diagnostic.file.fileName, diagnostic.start, diagnostic.start + diagnostic.length, data => !!data.capabilities.diagnostic)) {
|
|
67
|
-
if (!((
|
|
67
|
+
if (!((_a = vueLsHost.fileExists) === null || _a === void 0 ? void 0 : _a.call(vueLsHost, tsOrVueLoc.fileName)))
|
|
68
68
|
continue;
|
|
69
|
-
onMapping(diagnostic, tsOrVueLoc.fileName, tsOrVueLoc.range.start, tsOrVueLoc.range.end, (
|
|
69
|
+
onMapping(diagnostic, tsOrVueLoc.fileName, tsOrVueLoc.range.start, tsOrVueLoc.range.end, (_b = tsOrVueLoc.mapped) === null || _b === void 0 ? void 0 : _b.vueFile.getContent());
|
|
70
70
|
founded = true;
|
|
71
71
|
break;
|
|
72
72
|
}
|
|
73
73
|
// fix https://github.com/johnsoncodehk/volar/issues/1372
|
|
74
74
|
if (!founded) {
|
|
75
75
|
for (const start of context.vueFiles.fromEmbeddedLocation(diagnostic.file.fileName, diagnostic.start, diagnostic.start, data => !!data.capabilities.diagnostic)) {
|
|
76
|
-
if (!((
|
|
76
|
+
if (!((_c = vueLsHost.fileExists) === null || _c === void 0 ? void 0 : _c.call(vueLsHost, start.fileName)))
|
|
77
77
|
continue;
|
|
78
78
|
for (const end of context.vueFiles.fromEmbeddedLocation(diagnostic.file.fileName, diagnostic.start + diagnostic.length, diagnostic.start + diagnostic.length, data => !!data.capabilities.diagnostic)) {
|
|
79
|
-
if (!((
|
|
79
|
+
if (!((_d = vueLsHost.fileExists) === null || _d === void 0 ? void 0 : _d.call(vueLsHost, end.fileName)))
|
|
80
80
|
continue;
|
|
81
81
|
if (start.fileName !== end.fileName)
|
|
82
82
|
continue;
|
|
83
|
-
onMapping(diagnostic, start.fileName, start.range.start, end.range.end, (
|
|
83
|
+
onMapping(diagnostic, start.fileName, start.range.start, end.range.end, (_e = start.mapped) === null || _e === void 0 ? void 0 : _e.vueFile.getContent());
|
|
84
84
|
founded = true;
|
|
85
85
|
break;
|
|
86
86
|
}
|
|
@@ -102,7 +102,7 @@ function register(ts, context) {
|
|
|
102
102
|
: undefined;
|
|
103
103
|
if (!file) {
|
|
104
104
|
if (docText === undefined) {
|
|
105
|
-
const snapshot =
|
|
105
|
+
const snapshot = vueLsHost.getScriptSnapshot(fileName);
|
|
106
106
|
if (snapshot) {
|
|
107
107
|
docText = snapshot.getText(0, snapshot.getLength());
|
|
108
108
|
}
|
package/out/proxy.js
CHANGED
|
@@ -33,7 +33,7 @@ _options, _host, _oldProgram, _configFileParsingDiagnostics) {
|
|
|
33
33
|
isVueTsc: true,
|
|
34
34
|
});
|
|
35
35
|
tsRuntime.update(); // must update before getProgram() to update virtual scripts
|
|
36
|
-
const proxyApis = apis.register(ts, tsRuntime);
|
|
36
|
+
const proxyApis = apis.register(ts, tsRuntime, vueLsHost);
|
|
37
37
|
const program = new Proxy({}, {
|
|
38
38
|
get: (_, property) => {
|
|
39
39
|
tsRuntime.update();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-tsc",
|
|
3
|
-
"version": "0.37.
|
|
3
|
+
"version": "0.37.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"bin",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"vue-tsc": "./bin/vue-tsc.js"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@volar/vue-typescript": "0.37.
|
|
19
|
+
"@volar/vue-typescript": "0.37.1"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"typescript": "*"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "f6bad125e11920bbd95e6b7c335772128bbf11df"
|
|
25
25
|
}
|