@vue/language-core 2.0.26-alpha.2 → 2.0.28
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/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/codegen/script/component.d.ts +2 -0
- package/lib/codegen/script/component.js +57 -41
- package/lib/codegen/script/globalTypes.js +4 -9
- package/lib/codegen/script/index.js +11 -1
- package/lib/codegen/script/scriptSetup.js +52 -32
- package/lib/codegen/template/element.js +25 -26
- package/lib/codegen/template/elementChildren.js +1 -1
- package/lib/codegen/template/elementEvents.js +10 -1
- package/lib/codegen/template/elementProps.js +1 -1
- package/lib/codegen/template/objectKey.d.ts +1 -0
- package/lib/codegen/template/objectKey.js +34 -0
- package/lib/languageModule.js +8 -7
- package/lib/languagePlugin.d.ts +8 -0
- package/lib/languagePlugin.js +175 -0
- package/lib/parsers/scriptSetupRanges.d.ts +3 -1
- package/lib/parsers/scriptSetupRanges.js +8 -0
- package/lib/plugins/file-dot-setup.d.ts +3 -0
- package/lib/plugins/file-dot-setup.js +34 -0
- package/lib/plugins/file-html.js +14 -3
- package/lib/plugins/file-md.js +14 -3
- package/lib/plugins/file-vue.js +14 -3
- package/lib/plugins/vue-script-js.js +1 -1
- package/lib/plugins/vue-sfc-customblocks.js +1 -1
- package/lib/plugins/vue-sfc-scripts.js +1 -1
- package/lib/plugins/vue-sfc-styles.js +1 -1
- package/lib/plugins/vue-sfc-template.js +1 -1
- package/lib/plugins/vue-template-html.js +1 -1
- package/lib/plugins/vue-template-inline-css.js +1 -1
- package/lib/plugins/vue-template-inline-ts.js +1 -1
- package/lib/plugins/vue-tsx.d.ts +3 -1
- package/lib/plugins/vue-tsx.js +1 -1
- package/lib/plugins.d.ts +2 -26
- package/lib/plugins.js +24 -10
- package/lib/types.d.ts +15 -11
- package/lib/types.js +2 -2
- package/lib/utils/ts.js +7 -20
- package/lib/virtualFile/computedFiles.d.ts +2 -2
- package/lib/virtualFile/computedSfc.d.ts +2 -2
- package/lib/virtualFile/computedVueSfc.d.ts +2 -2
- package/lib/virtualFile/computedVueSfc.js +3 -2
- package/lib/virtualFile/vueFile.d.ts +3 -3
- package/lib/virtualFile/vueFile.js +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { SFCParseResult } from '@vue/compiler-sfc';
|
|
2
2
|
import type * as ts from 'typescript';
|
|
3
|
-
import type { Sfc,
|
|
4
|
-
export declare function computedSfc(ts: typeof import('typescript'), plugins:
|
|
3
|
+
import type { Sfc, VueLanguagePluginReturn } from '../types';
|
|
4
|
+
export declare function computedSfc(ts: typeof import('typescript'), plugins: VueLanguagePluginReturn[], fileName: string, snapshot: () => ts.IScriptSnapshot, parsed: () => SFCParseResult | undefined): Sfc;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { SFCParseResult } from '@vue/compiler-sfc';
|
|
2
2
|
import type * as ts from 'typescript';
|
|
3
|
-
import type {
|
|
4
|
-
export declare function computedVueSfc(plugins:
|
|
3
|
+
import type { VueLanguagePluginReturn } from '../types';
|
|
4
|
+
export declare function computedVueSfc(plugins: VueLanguagePluginReturn[], fileName: string, languageId: string, snapshot: () => ts.IScriptSnapshot): () => SFCParseResult | undefined;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.computedVueSfc = computedVueSfc;
|
|
4
4
|
const computeds_1 = require("computeds");
|
|
5
|
-
function computedVueSfc(plugins, fileName, snapshot) {
|
|
5
|
+
function computedVueSfc(plugins, fileName, languageId, snapshot) {
|
|
6
6
|
let cache;
|
|
7
7
|
return (0, computeds_1.computed)(() => {
|
|
8
8
|
// incremental update
|
|
@@ -23,7 +23,8 @@ function computedVueSfc(plugins, fileName, snapshot) {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
for (const plugin of plugins) {
|
|
26
|
-
const sfc = plugin.parseSFC?.(fileName, snapshot().getText(0, snapshot().getLength()))
|
|
26
|
+
const sfc = plugin.parseSFC?.(fileName, snapshot().getText(0, snapshot().getLength()))
|
|
27
|
+
?? plugin.parseSFC2?.(fileName, languageId, snapshot().getText(0, snapshot().getLength()));
|
|
27
28
|
if (sfc) {
|
|
28
29
|
if (!sfc.errors.length) {
|
|
29
30
|
cache = {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { VirtualCode } from '@volar/language-core';
|
|
2
2
|
import { Signal } from 'computeds';
|
|
3
3
|
import type * as ts from 'typescript';
|
|
4
|
-
import type { VueCompilerOptions,
|
|
4
|
+
import type { VueCompilerOptions, VueLanguagePluginReturn } from '../types';
|
|
5
5
|
export declare class VueVirtualCode implements VirtualCode {
|
|
6
6
|
fileName: string;
|
|
7
7
|
languageId: string;
|
|
8
8
|
initSnapshot: ts.IScriptSnapshot;
|
|
9
9
|
vueCompilerOptions: VueCompilerOptions;
|
|
10
|
-
plugins:
|
|
10
|
+
plugins: VueLanguagePluginReturn[];
|
|
11
11
|
ts: typeof import('typescript');
|
|
12
12
|
id: string;
|
|
13
13
|
_snapshot: Signal<ts.IScriptSnapshot>;
|
|
@@ -18,6 +18,6 @@ export declare class VueVirtualCode implements VirtualCode {
|
|
|
18
18
|
get embeddedCodes(): VirtualCode[];
|
|
19
19
|
get snapshot(): ts.IScriptSnapshot;
|
|
20
20
|
get mappings(): import("@volar/language-core").CodeMapping[];
|
|
21
|
-
constructor(fileName: string, languageId: string, initSnapshot: ts.IScriptSnapshot, vueCompilerOptions: VueCompilerOptions, plugins:
|
|
21
|
+
constructor(fileName: string, languageId: string, initSnapshot: ts.IScriptSnapshot, vueCompilerOptions: VueCompilerOptions, plugins: VueLanguagePluginReturn[], ts: typeof import('typescript'));
|
|
22
22
|
update(newSnapshot: ts.IScriptSnapshot): void;
|
|
23
23
|
}
|
|
@@ -27,7 +27,7 @@ class VueVirtualCode {
|
|
|
27
27
|
// sources
|
|
28
28
|
this.id = 'main';
|
|
29
29
|
// computeds
|
|
30
|
-
this.getVueSfc = (0, computedVueSfc_1.computedVueSfc)(this.plugins, this.fileName, () => this._snapshot());
|
|
30
|
+
this.getVueSfc = (0, computedVueSfc_1.computedVueSfc)(this.plugins, this.fileName, this.languageId, () => this._snapshot());
|
|
31
31
|
this.sfc = (0, computedSfc_1.computedSfc)(this.ts, this.plugins, this.fileName, () => this._snapshot(), this.getVueSfc);
|
|
32
32
|
this.getMappings = (0, computedMappings_1.computedMappings)(() => this._snapshot(), this.sfc);
|
|
33
33
|
this.getEmbeddedCodes = (0, computedFiles_1.computedFiles)(this.plugins, this.fileName, this.sfc);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/language-core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.28",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"**/*.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"directory": "packages/language-core"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@volar/language-core": "~2.4.0-alpha.
|
|
15
|
+
"@volar/language-core": "~2.4.0-alpha.18",
|
|
16
16
|
"@vue/compiler-dom": "^3.4.0",
|
|
17
17
|
"@vue/shared": "^3.4.0",
|
|
18
18
|
"computeds": "^0.0.1",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@types/minimatch": "^5.1.2",
|
|
26
26
|
"@types/node": "latest",
|
|
27
27
|
"@types/path-browserify": "^1.0.1",
|
|
28
|
-
"@volar/typescript": "~2.4.0-alpha.
|
|
28
|
+
"@volar/typescript": "~2.4.0-alpha.18",
|
|
29
29
|
"@vue/compiler-sfc": "^3.4.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"optional": true
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "0cdbd70996f4fc7ac8d511b0d9fdbe20b7a4f6a3"
|
|
40
40
|
}
|