@vue/language-core 2.0.29 → 2.1.0
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 +4 -3
- package/index.js +4 -3
- package/lib/codegen/common.d.ts +2 -1
- package/lib/codegen/common.js +16 -5
- package/lib/codegen/globalTypes.d.ts +1 -0
- package/lib/codegen/globalTypes.js +123 -0
- package/lib/codegen/localTypes.d.ts +14 -0
- package/lib/codegen/localTypes.js +120 -0
- package/lib/codegen/script/component.d.ts +1 -4
- package/lib/codegen/script/component.js +112 -63
- package/lib/codegen/script/context.d.ts +14 -10
- package/lib/codegen/script/context.js +5 -107
- package/lib/codegen/script/index.d.ts +3 -2
- package/lib/codegen/script/index.js +37 -53
- package/lib/codegen/script/internalComponent.d.ts +1 -1
- package/lib/codegen/script/internalComponent.js +13 -5
- package/lib/codegen/script/scriptSetup.js +144 -62
- package/lib/codegen/script/template.d.ts +3 -0
- package/lib/codegen/script/template.js +80 -79
- package/lib/codegen/template/context.d.ts +6 -1
- package/lib/codegen/template/context.js +9 -2
- package/lib/codegen/template/element.d.ts +1 -1
- package/lib/codegen/template/element.js +214 -92
- package/lib/codegen/template/elementChildren.js +1 -0
- package/lib/codegen/template/elementDirectives.js +8 -4
- package/lib/codegen/template/elementEvents.js +13 -14
- package/lib/codegen/template/elementProps.js +43 -22
- package/lib/codegen/template/index.d.ts +3 -0
- package/lib/codegen/template/index.js +29 -41
- package/lib/codegen/template/interpolation.d.ts +1 -1
- package/lib/codegen/template/interpolation.js +24 -15
- package/lib/codegen/template/objectProperty.d.ts +1 -1
- package/lib/codegen/template/objectProperty.js +7 -2
- package/lib/codegen/template/styleScopedClasses.d.ts +3 -0
- package/lib/codegen/template/styleScopedClasses.js +72 -0
- package/lib/codegen/template/templateChild.js +5 -1
- package/lib/codegen/types.d.ts +9 -0
- package/lib/codegen/types.js +3 -0
- package/lib/languagePlugin.d.ts +2 -4
- package/lib/languagePlugin.js +4 -57
- package/lib/parsers/scriptRanges.d.ts +1 -0
- package/lib/parsers/scriptRanges.js +5 -0
- package/lib/parsers/scriptSetupRanges.d.ts +17 -3
- package/lib/parsers/scriptSetupRanges.js +127 -44
- package/lib/plugins/file-md.js +9 -6
- package/lib/plugins/vue-root-tags.js +51 -0
- package/lib/plugins/vue-tsx.d.ts +40 -3
- package/lib/plugins/vue-tsx.js +17 -4
- package/lib/plugins.js +2 -0
- package/lib/types.d.ts +14 -10
- package/lib/utils/findDestructuredProps.js +3 -0
- package/lib/utils/parseCssClassNames.js +4 -6
- package/lib/utils/parseCssVars.js +5 -7
- package/lib/utils/parseSfc.js +4 -1
- package/lib/utils/ts.js +8 -2
- package/lib/virtualFile/{computedFiles.d.ts → computedEmbeddedCodes.d.ts} +1 -1
- package/lib/virtualFile/{computedFiles.js → computedEmbeddedCodes.js} +3 -3
- package/lib/virtualFile/computedSfc.d.ts +1 -1
- package/lib/virtualFile/computedSfc.js +14 -3
- package/lib/virtualFile/vueFile.d.ts +13 -3
- package/lib/virtualFile/vueFile.js +17 -9
- package/package.json +4 -4
- package/lib/codegen/script/globalTypes.d.ts +0 -2
- package/lib/codegen/script/globalTypes.js +0 -134
- package/lib/codegen/template/objectKey.js +0 -34
- package/lib/languageModule.d.ts +0 -5
- package/lib/languageModule.js +0 -159
- package/lib/plugins/file-dot-setup.js +0 -34
- package/lib/virtualFile/computedMappings.d.ts +0 -4
- package/lib/virtualFile/computedMappings.js +0 -65
- /package/lib/plugins/{file-dot-setup.d.ts → vue-root-tags.d.ts} +0 -0
- /package/lib/{codegen/template/objectKey.d.ts → utils/findDestructuredProps.d.ts} +0 -0
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.computedMappings = computedMappings;
|
|
4
|
-
const computeds_1 = require("computeds");
|
|
5
|
-
const muggle_string_1 = require("muggle-string");
|
|
6
|
-
const shared_1 = require("../plugins/shared");
|
|
7
|
-
function computedMappings(snapshot, sfc) {
|
|
8
|
-
return (0, computeds_1.computed)(() => {
|
|
9
|
-
const str = [[snapshot().getText(0, snapshot().getLength()), undefined, 0, shared_1.allCodeFeatures]];
|
|
10
|
-
for (const block of [
|
|
11
|
-
sfc.script,
|
|
12
|
-
sfc.scriptSetup,
|
|
13
|
-
sfc.template,
|
|
14
|
-
...sfc.styles,
|
|
15
|
-
...sfc.customBlocks,
|
|
16
|
-
]) {
|
|
17
|
-
if (block) {
|
|
18
|
-
(0, muggle_string_1.replaceSourceRange)(str, undefined, block.startTagEnd, block.endTagStart, '\n\n');
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
const mappings = str
|
|
22
|
-
.filter(s => typeof s !== 'string')
|
|
23
|
-
.map(m => {
|
|
24
|
-
const text = m[0];
|
|
25
|
-
const start = m[2];
|
|
26
|
-
return {
|
|
27
|
-
sourceOffsets: [start],
|
|
28
|
-
generatedOffsets: [start],
|
|
29
|
-
lengths: [text.length],
|
|
30
|
-
data: m[3],
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
|
-
// fix folding range end position failed to mapping
|
|
34
|
-
for (const block of [
|
|
35
|
-
sfc.script,
|
|
36
|
-
sfc.scriptSetup,
|
|
37
|
-
sfc.template,
|
|
38
|
-
...sfc.styles,
|
|
39
|
-
...sfc.customBlocks,
|
|
40
|
-
]) {
|
|
41
|
-
const offsets = [];
|
|
42
|
-
if (block) {
|
|
43
|
-
let content = block.content;
|
|
44
|
-
if (content.endsWith('\r\n')) {
|
|
45
|
-
content = content.slice(0, -2);
|
|
46
|
-
}
|
|
47
|
-
else if (content.endsWith('\n')) {
|
|
48
|
-
content = content.slice(0, -1);
|
|
49
|
-
}
|
|
50
|
-
const offset = content.lastIndexOf('\n') + 1;
|
|
51
|
-
offsets.push(block.startTagEnd + offset);
|
|
52
|
-
}
|
|
53
|
-
if (offsets.length) {
|
|
54
|
-
mappings.push({
|
|
55
|
-
sourceOffsets: offsets,
|
|
56
|
-
generatedOffsets: offsets,
|
|
57
|
-
lengths: offsets.map(() => 0),
|
|
58
|
-
data: { structure: true },
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return mappings;
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=computedMappings.js.map
|
|
File without changes
|
|
File without changes
|