@vue/language-service 1.7.11 → 1.7.13
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/helpers.d.ts +4 -4
- package/out/helpers.js +7 -25
- package/out/ideFeatures/nameCasing.d.ts +5 -4
- package/out/ideFeatures/nameCasing.js +9 -15
- package/out/languageService.js +2 -2
- package/out/plugins/vue-template.js +9 -16
- package/out/types.js +2 -2
- package/package.json +7 -7
package/out/helpers.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import * as vue from '@vue/language-core';
|
|
1
2
|
import * as embedded from '@volar/language-core';
|
|
2
3
|
import type * as ts from 'typescript/lib/tsserverlibrary';
|
|
3
|
-
export declare function checkPropsOfTag(ts: typeof import('typescript/lib/tsserverlibrary'), tsLs: ts.LanguageService, sourceFile: embedded.VirtualFile, tag: string,
|
|
4
|
-
export declare function checkEventsOfTag(ts: typeof import('typescript/lib/tsserverlibrary'), tsLs: ts.LanguageService, sourceFile: embedded.VirtualFile, tag: string,
|
|
5
|
-
export declare function checkComponentNames(ts: typeof import('typescript/lib/tsserverlibrary'), tsLs: ts.LanguageService, sourceFile: embedded.VirtualFile,
|
|
6
|
-
export declare function checkNativeTags(ts: typeof import('typescript/lib/tsserverlibrary'), tsLs: ts.LanguageService, tsLsHost: ts.LanguageServiceHost): Set<string>;
|
|
4
|
+
export declare function checkPropsOfTag(ts: typeof import('typescript/lib/tsserverlibrary'), tsLs: ts.LanguageService, sourceFile: embedded.VirtualFile, tag: string, vueCompilerOptions: vue.VueCompilerOptions, requiredOnly?: boolean): string[];
|
|
5
|
+
export declare function checkEventsOfTag(ts: typeof import('typescript/lib/tsserverlibrary'), tsLs: ts.LanguageService, sourceFile: embedded.VirtualFile, tag: string, vueCompilerOptions: vue.VueCompilerOptions): string[];
|
|
6
|
+
export declare function checkComponentNames(ts: typeof import('typescript/lib/tsserverlibrary'), tsLs: ts.LanguageService, sourceFile: embedded.VirtualFile, vueCompilerOptions: vue.VueCompilerOptions): string[];
|
|
7
7
|
export declare function getElementAttrs(ts: typeof import('typescript/lib/tsserverlibrary'), tsLs: ts.LanguageService, tsLsHost: ts.LanguageServiceHost, tagName: string): string[];
|
|
8
8
|
type Tags = Map<string, {
|
|
9
9
|
offsets: number[];
|
package/out/helpers.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTemplateTagsAndAttrs = exports.getElementAttrs = exports.
|
|
3
|
+
exports.getTemplateTagsAndAttrs = exports.getElementAttrs = exports.checkComponentNames = exports.checkEventsOfTag = exports.checkPropsOfTag = void 0;
|
|
4
4
|
const vue = require("@vue/language-core");
|
|
5
5
|
const embedded = require("@volar/language-core");
|
|
6
6
|
const reactivity_1 = require("@vue/reactivity");
|
|
7
7
|
const language_core_1 = require("@vue/language-core");
|
|
8
8
|
const shared_1 = require("@vue/shared");
|
|
9
|
-
function checkPropsOfTag(ts, tsLs, sourceFile, tag,
|
|
9
|
+
function checkPropsOfTag(ts, tsLs, sourceFile, tag, vueCompilerOptions, requiredOnly = false) {
|
|
10
10
|
const checker = tsLs.getProgram().getTypeChecker();
|
|
11
11
|
const components = getComponentsType(ts, tsLs, sourceFile);
|
|
12
12
|
if (!components)
|
|
13
13
|
return [];
|
|
14
14
|
const name = tag.split('.');
|
|
15
15
|
let componentSymbol = components.componentsType.getProperty(name[0]);
|
|
16
|
-
if (!componentSymbol && !nativeTags.
|
|
16
|
+
if (!componentSymbol && !vueCompilerOptions.nativeTags.includes(name[0])) {
|
|
17
17
|
componentSymbol = components.componentsType.getProperty((0, shared_1.camelize)(name[0]))
|
|
18
18
|
?? components.componentsType.getProperty((0, shared_1.capitalize)((0, shared_1.camelize)(name[0])));
|
|
19
19
|
}
|
|
@@ -61,14 +61,14 @@ function checkPropsOfTag(ts, tsLs, sourceFile, tag, nativeTags, requiredOnly = f
|
|
|
61
61
|
return [...result];
|
|
62
62
|
}
|
|
63
63
|
exports.checkPropsOfTag = checkPropsOfTag;
|
|
64
|
-
function checkEventsOfTag(ts, tsLs, sourceFile, tag,
|
|
64
|
+
function checkEventsOfTag(ts, tsLs, sourceFile, tag, vueCompilerOptions) {
|
|
65
65
|
const checker = tsLs.getProgram().getTypeChecker();
|
|
66
66
|
const components = getComponentsType(ts, tsLs, sourceFile);
|
|
67
67
|
if (!components)
|
|
68
68
|
return [];
|
|
69
69
|
const name = tag.split('.');
|
|
70
70
|
let componentSymbol = components.componentsType.getProperty(name[0]);
|
|
71
|
-
if (!componentSymbol && !nativeTags.
|
|
71
|
+
if (!componentSymbol && !vueCompilerOptions.nativeTags.includes(name[0])) {
|
|
72
72
|
componentSymbol = components.componentsType.getProperty((0, shared_1.camelize)(name[0]))
|
|
73
73
|
?? components.componentsType.getProperty((0, shared_1.capitalize)((0, shared_1.camelize)(name[0])));
|
|
74
74
|
}
|
|
@@ -110,34 +110,16 @@ function checkEventsOfTag(ts, tsLs, sourceFile, tag, nativeTags) {
|
|
|
110
110
|
return [...result];
|
|
111
111
|
}
|
|
112
112
|
exports.checkEventsOfTag = checkEventsOfTag;
|
|
113
|
-
function checkComponentNames(ts, tsLs, sourceFile,
|
|
113
|
+
function checkComponentNames(ts, tsLs, sourceFile, vueCompilerOptions) {
|
|
114
114
|
return getComponentsType(ts, tsLs, sourceFile)
|
|
115
115
|
?.componentsType
|
|
116
116
|
?.getProperties()
|
|
117
117
|
.map(c => c.name)
|
|
118
118
|
.filter(entry => entry.indexOf('$') === -1 && !entry.startsWith('_'))
|
|
119
|
-
.filter(entry => !nativeTags.
|
|
119
|
+
.filter(entry => !vueCompilerOptions.nativeTags.includes(entry))
|
|
120
120
|
?? [];
|
|
121
121
|
}
|
|
122
122
|
exports.checkComponentNames = checkComponentNames;
|
|
123
|
-
function checkNativeTags(ts, tsLs, tsLsHost) {
|
|
124
|
-
const sharedTypesFileName = tsLsHost.getCurrentDirectory() + '/' + language_core_1.sharedTypes.baseName;
|
|
125
|
-
const result = new Set();
|
|
126
|
-
let tsSourceFile;
|
|
127
|
-
if (tsSourceFile = tsLs.getProgram()?.getSourceFile(sharedTypesFileName)) {
|
|
128
|
-
const typeNode = tsSourceFile.statements.find((node) => ts.isTypeAliasDeclaration(node) && node.name.getText() === '__VLS_IntrinsicElements');
|
|
129
|
-
const checker = tsLs.getProgram()?.getTypeChecker();
|
|
130
|
-
if (checker && typeNode) {
|
|
131
|
-
const type = checker.getTypeFromTypeNode(typeNode.type);
|
|
132
|
-
const props = type.getProperties();
|
|
133
|
-
for (const prop of props) {
|
|
134
|
-
result.add(prop.name);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
return result;
|
|
139
|
-
}
|
|
140
|
-
exports.checkNativeTags = checkNativeTags;
|
|
141
123
|
function getElementAttrs(ts, tsLs, tsLsHost, tagName) {
|
|
142
124
|
const sharedTypesFileName = tsLsHost.getCurrentDirectory() + '/' + language_core_1.sharedTypes.baseName;
|
|
143
125
|
let tsSourceFile;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { ServiceContext } from '@volar/language-service';
|
|
2
|
+
import * as vue from '@vue/language-core';
|
|
2
3
|
import type * as vscode from 'vscode-languageserver-protocol';
|
|
3
4
|
import { AttrNameCasing, TagNameCasing } from '../types';
|
|
4
5
|
import type { Provide } from 'volar-service-typescript';
|
|
5
|
-
export declare function convertTagName(ts: typeof import('typescript/lib/tsserverlibrary'), context: ServiceContext<Provide>, uri: string, casing: TagNameCasing): Promise<vscode.TextEdit[] | undefined>;
|
|
6
|
-
export declare function convertAttrName(ts: typeof import('typescript/lib/tsserverlibrary'), context: ServiceContext, uri: string, casing: AttrNameCasing): Promise<vscode.TextEdit[] | undefined>;
|
|
7
|
-
export declare function getNameCasing(ts: typeof import('typescript/lib/tsserverlibrary'), context: ServiceContext, uri: string): Promise<{
|
|
6
|
+
export declare function convertTagName(ts: typeof import('typescript/lib/tsserverlibrary'), context: ServiceContext<Provide>, uri: string, casing: TagNameCasing, vueCompilerOptions: vue.VueCompilerOptions): Promise<vscode.TextEdit[] | undefined>;
|
|
7
|
+
export declare function convertAttrName(ts: typeof import('typescript/lib/tsserverlibrary'), context: ServiceContext, uri: string, casing: AttrNameCasing, vueCompilerOptions: vue.VueCompilerOptions): Promise<vscode.TextEdit[] | undefined>;
|
|
8
|
+
export declare function getNameCasing(ts: typeof import('typescript/lib/tsserverlibrary'), context: ServiceContext, uri: string, vueCompilerOptions: vue.VueCompilerOptions): Promise<{
|
|
8
9
|
tag: TagNameCasing;
|
|
9
10
|
attr: AttrNameCasing;
|
|
10
11
|
}>;
|
|
11
|
-
export declare function detect(ts: typeof import('typescript/lib/tsserverlibrary'), context: ServiceContext, uri: string): {
|
|
12
|
+
export declare function detect(ts: typeof import('typescript/lib/tsserverlibrary'), context: ServiceContext, uri: string, vueCompilerOptions: vue.VueCompilerOptions): {
|
|
12
13
|
tag: TagNameCasing[];
|
|
13
14
|
attr: AttrNameCasing[];
|
|
14
15
|
};
|
|
@@ -5,7 +5,7 @@ const shared_1 = require("@vue/shared");
|
|
|
5
5
|
const helpers_1 = require("../helpers");
|
|
6
6
|
const vue = require("@vue/language-core");
|
|
7
7
|
const types_1 = require("../types");
|
|
8
|
-
async function convertTagName(ts, context, uri, casing) {
|
|
8
|
+
async function convertTagName(ts, context, uri, casing, vueCompilerOptions) {
|
|
9
9
|
const rootFile = context.documents.getSourceByUri(uri)?.root;
|
|
10
10
|
if (!(rootFile instanceof vue.VueFile))
|
|
11
11
|
return;
|
|
@@ -13,12 +13,10 @@ async function convertTagName(ts, context, uri, casing) {
|
|
|
13
13
|
if (!desc.template)
|
|
14
14
|
return;
|
|
15
15
|
const languageService = context.inject('typescript/languageService');
|
|
16
|
-
const languageServiceHost = context.inject('typescript/languageServiceHost');
|
|
17
16
|
const template = desc.template;
|
|
18
17
|
const document = context.documents.getDocumentByFileName(rootFile.snapshot, rootFile.fileName);
|
|
19
18
|
const edits = [];
|
|
20
|
-
const
|
|
21
|
-
const components = (0, helpers_1.checkComponentNames)(ts, languageService, rootFile, nativeTags);
|
|
19
|
+
const components = (0, helpers_1.checkComponentNames)(ts, languageService, rootFile, vueCompilerOptions);
|
|
22
20
|
const tags = (0, helpers_1.getTemplateTagsAndAttrs)(rootFile);
|
|
23
21
|
for (const [tagName, { offsets }] of tags) {
|
|
24
22
|
const componentName = components.find(component => component === tagName || (0, shared_1.hyphenate)(component) === tagName);
|
|
@@ -39,7 +37,7 @@ async function convertTagName(ts, context, uri, casing) {
|
|
|
39
37
|
return edits;
|
|
40
38
|
}
|
|
41
39
|
exports.convertTagName = convertTagName;
|
|
42
|
-
async function convertAttrName(ts, context, uri, casing) {
|
|
40
|
+
async function convertAttrName(ts, context, uri, casing, vueCompilerOptions) {
|
|
43
41
|
const rootFile = context.documents.getSourceByUri(uri)?.root;
|
|
44
42
|
if (!(rootFile instanceof vue.VueFile))
|
|
45
43
|
return;
|
|
@@ -47,17 +45,15 @@ async function convertAttrName(ts, context, uri, casing) {
|
|
|
47
45
|
if (!desc.template)
|
|
48
46
|
return;
|
|
49
47
|
const languageService = context.inject('typescript/languageService');
|
|
50
|
-
const languageServiceHost = context.inject('typescript/languageServiceHost');
|
|
51
48
|
const template = desc.template;
|
|
52
49
|
const document = context.documents.getDocumentByFileName(rootFile.snapshot, rootFile.fileName);
|
|
53
50
|
const edits = [];
|
|
54
|
-
const
|
|
55
|
-
const components = (0, helpers_1.checkComponentNames)(ts, languageService, rootFile, nativeTags);
|
|
51
|
+
const components = (0, helpers_1.checkComponentNames)(ts, languageService, rootFile, vueCompilerOptions);
|
|
56
52
|
const tags = (0, helpers_1.getTemplateTagsAndAttrs)(rootFile);
|
|
57
53
|
for (const [tagName, { attrs }] of tags) {
|
|
58
54
|
const componentName = components.find(component => component === tagName || (0, shared_1.hyphenate)(component) === tagName);
|
|
59
55
|
if (componentName) {
|
|
60
|
-
const props = (0, helpers_1.checkPropsOfTag)(ts, languageService, rootFile, componentName,
|
|
56
|
+
const props = (0, helpers_1.checkPropsOfTag)(ts, languageService, rootFile, componentName, vueCompilerOptions);
|
|
61
57
|
for (const [attrName, { offsets }] of attrs) {
|
|
62
58
|
const propName = props.find(prop => prop === attrName || (0, shared_1.hyphenate)(prop) === attrName);
|
|
63
59
|
if (propName) {
|
|
@@ -79,8 +75,8 @@ async function convertAttrName(ts, context, uri, casing) {
|
|
|
79
75
|
return edits;
|
|
80
76
|
}
|
|
81
77
|
exports.convertAttrName = convertAttrName;
|
|
82
|
-
async function getNameCasing(ts, context, uri) {
|
|
83
|
-
const detected = detect(ts, context, uri);
|
|
78
|
+
async function getNameCasing(ts, context, uri, vueCompilerOptions) {
|
|
79
|
+
const detected = detect(ts, context, uri, vueCompilerOptions);
|
|
84
80
|
const [attr, tag] = await Promise.all([
|
|
85
81
|
context.env.getConfiguration?.('vue.complete.casing.props', uri),
|
|
86
82
|
context.env.getConfiguration?.('vue.complete.casing.tags', uri),
|
|
@@ -93,7 +89,7 @@ async function getNameCasing(ts, context, uri) {
|
|
|
93
89
|
};
|
|
94
90
|
}
|
|
95
91
|
exports.getNameCasing = getNameCasing;
|
|
96
|
-
function detect(ts, context, uri) {
|
|
92
|
+
function detect(ts, context, uri, vueCompilerOptions) {
|
|
97
93
|
const rootFile = context.documents.getSourceByUri(uri)?.root;
|
|
98
94
|
if (!(rootFile instanceof vue.VueFile)) {
|
|
99
95
|
return {
|
|
@@ -102,7 +98,6 @@ function detect(ts, context, uri) {
|
|
|
102
98
|
};
|
|
103
99
|
}
|
|
104
100
|
const languageService = context.inject('typescript/languageService');
|
|
105
|
-
const languageServiceHost = context.inject('typescript/languageServiceHost');
|
|
106
101
|
return {
|
|
107
102
|
tag: getTagNameCase(rootFile),
|
|
108
103
|
attr: getAttrNameCase(rootFile),
|
|
@@ -129,8 +124,7 @@ function detect(ts, context, uri) {
|
|
|
129
124
|
return result;
|
|
130
125
|
}
|
|
131
126
|
function getTagNameCase(file) {
|
|
132
|
-
const
|
|
133
|
-
const components = (0, helpers_1.checkComponentNames)(ts, languageService, file, nativeTags);
|
|
127
|
+
const components = (0, helpers_1.checkComponentNames)(ts, languageService, file, vueCompilerOptions);
|
|
134
128
|
const tagNames = (0, helpers_1.getTemplateTagsAndAttrs)(file);
|
|
135
129
|
const result = [];
|
|
136
130
|
let anyComponentUsed = false;
|
package/out/languageService.js
CHANGED
|
@@ -64,7 +64,7 @@ function resolvePlugins(services, vueCompilerOptions, settings) {
|
|
|
64
64
|
}
|
|
65
65
|
// fix #2458
|
|
66
66
|
if (source) {
|
|
67
|
-
casing ??= await (0, nameCasing_1.getNameCasing)(ts, _context, _context.env.fileNameToUri(source.fileName));
|
|
67
|
+
casing ??= await (0, nameCasing_1.getNameCasing)(ts, _context, _context.env.fileNameToUri(source.fileName), vueCompilerOptions);
|
|
68
68
|
if (casing.tag === types_1.TagNameCasing.Kebab) {
|
|
69
69
|
for (const item of result.items) {
|
|
70
70
|
item.filterText = (0, shared_1.hyphenate)(item.filterText ?? item.label);
|
|
@@ -106,7 +106,7 @@ function resolvePlugins(services, vueCompilerOptions, settings) {
|
|
|
106
106
|
item.textEdit.newText = newName;
|
|
107
107
|
const source = _context.documents.getVirtualFileByUri(itemData.uri)[1];
|
|
108
108
|
if (source) {
|
|
109
|
-
const casing = await (0, nameCasing_1.getNameCasing)(ts, _context, _context.env.fileNameToUri(source.fileName));
|
|
109
|
+
const casing = await (0, nameCasing_1.getNameCasing)(ts, _context, _context.env.fileNameToUri(source.fileName), vueCompilerOptions);
|
|
110
110
|
if (casing.tag === types_1.TagNameCasing.Kebab) {
|
|
111
111
|
item.textEdit.newText = (0, shared_1.hyphenate)(item.textEdit.newText);
|
|
112
112
|
}
|
|
@@ -78,16 +78,14 @@ exports.default = (options) => (_context, modules) => {
|
|
|
78
78
|
if (!enabled)
|
|
79
79
|
return;
|
|
80
80
|
const languageService = _context.inject('typescript/languageService');
|
|
81
|
-
const languageServiceHost = _context.inject('typescript/languageServiceHost');
|
|
82
81
|
const result = [];
|
|
83
82
|
for (const [_, map] of _context.documents.getMapsByVirtualFileUri(document.uri)) {
|
|
84
83
|
const virtualFile = _context.documents.getSourceByUri(map.sourceFileDocument.uri)?.root;
|
|
85
84
|
const scanner = options.getScanner(htmlOrPugService, document);
|
|
86
85
|
if (virtualFile && virtualFile instanceof vue.VueFile && scanner) {
|
|
87
86
|
// visualize missing required props
|
|
88
|
-
const casing = await (0, nameCasing_1.getNameCasing)(ts, _context, map.sourceFileDocument.uri);
|
|
89
|
-
const
|
|
90
|
-
const components = (0, helpers_1.checkComponentNames)(ts, languageService, virtualFile, nativeTags);
|
|
87
|
+
const casing = await (0, nameCasing_1.getNameCasing)(ts, _context, map.sourceFileDocument.uri, options.vueCompilerOptions);
|
|
88
|
+
const components = (0, helpers_1.checkComponentNames)(ts, languageService, virtualFile, options.vueCompilerOptions);
|
|
91
89
|
const componentProps = {};
|
|
92
90
|
let token;
|
|
93
91
|
let current;
|
|
@@ -99,7 +97,7 @@ exports.default = (options) => (_context, modules) => {
|
|
|
99
97
|
: components.find(component => component === tagName || (0, shared_1.hyphenate)(component) === tagName);
|
|
100
98
|
const checkTag = tagName.indexOf('.') >= 0 ? tagName : component;
|
|
101
99
|
if (checkTag) {
|
|
102
|
-
componentProps[checkTag] ??= (0, helpers_1.checkPropsOfTag)(ts, languageService, virtualFile, checkTag,
|
|
100
|
+
componentProps[checkTag] ??= (0, helpers_1.checkPropsOfTag)(ts, languageService, virtualFile, checkTag, options.vueCompilerOptions, true);
|
|
103
101
|
current = {
|
|
104
102
|
unburnedRequiredProps: [...componentProps[checkTag]],
|
|
105
103
|
labelOffset: scanner.getTokenOffset() + scanner.getTokenLength(),
|
|
@@ -227,13 +225,11 @@ exports.default = (options) => (_context, modules) => {
|
|
|
227
225
|
if (!scanner)
|
|
228
226
|
return;
|
|
229
227
|
const languageService = _context.inject('typescript/languageService');
|
|
230
|
-
const languageServiceHost = _context.inject('typescript/languageServiceHost');
|
|
231
228
|
for (const [_, map] of _context.documents.getMapsByVirtualFileUri(document.uri)) {
|
|
232
229
|
const virtualFile = _context.documents.getSourceByUri(map.sourceFileDocument.uri)?.root;
|
|
233
230
|
if (!virtualFile || !(virtualFile instanceof vue.VueFile))
|
|
234
231
|
continue;
|
|
235
|
-
const
|
|
236
|
-
const templateScriptData = (0, helpers_1.checkComponentNames)(ts, languageService, virtualFile, nativeTags);
|
|
232
|
+
const templateScriptData = (0, helpers_1.checkComponentNames)(ts, languageService, virtualFile, options.vueCompilerOptions);
|
|
237
233
|
const components = new Set([
|
|
238
234
|
...templateScriptData,
|
|
239
235
|
...templateScriptData.map(shared_1.hyphenate),
|
|
@@ -271,7 +267,7 @@ exports.default = (options) => (_context, modules) => {
|
|
|
271
267
|
async function provideHtmlData(map, vueSourceFile) {
|
|
272
268
|
const languageService = _context.inject('typescript/languageService');
|
|
273
269
|
const languageServiceHost = _context.inject('typescript/languageServiceHost');
|
|
274
|
-
const casing = await (0, nameCasing_1.getNameCasing)(ts, _context, map.sourceFileDocument.uri);
|
|
270
|
+
const casing = await (0, nameCasing_1.getNameCasing)(ts, _context, map.sourceFileDocument.uri, options.vueCompilerOptions);
|
|
275
271
|
if (builtInData.tags) {
|
|
276
272
|
for (const tag of builtInData.tags) {
|
|
277
273
|
if (tag.name === 'slot')
|
|
@@ -288,14 +284,13 @@ exports.default = (options) => (_context, modules) => {
|
|
|
288
284
|
}
|
|
289
285
|
}
|
|
290
286
|
}
|
|
291
|
-
const nativeTags = (0, helpers_1.checkNativeTags)(ts, languageService, languageServiceHost);
|
|
292
287
|
options.updateCustomData(htmlOrPugService, [
|
|
293
288
|
html.newHTMLDataProvider('vue-template-built-in', builtInData),
|
|
294
289
|
{
|
|
295
290
|
getId: () => 'vue-template',
|
|
296
291
|
isApplicable: () => true,
|
|
297
292
|
provideTags: () => {
|
|
298
|
-
const components = (0, helpers_1.checkComponentNames)(ts, languageService, vueSourceFile,
|
|
293
|
+
const components = (0, helpers_1.checkComponentNames)(ts, languageService, vueSourceFile, options.vueCompilerOptions)
|
|
299
294
|
.filter(name => name !== 'Transition'
|
|
300
295
|
&& name !== 'TransitionGroup'
|
|
301
296
|
&& name !== 'KeepAlive'
|
|
@@ -331,8 +326,8 @@ exports.default = (options) => (_context, modules) => {
|
|
|
331
326
|
},
|
|
332
327
|
provideAttributes: (tag) => {
|
|
333
328
|
const attrs = (0, helpers_1.getElementAttrs)(ts, languageService, languageServiceHost, tag);
|
|
334
|
-
const props = new Set((0, helpers_1.checkPropsOfTag)(ts, languageService, vueSourceFile, tag,
|
|
335
|
-
const events = (0, helpers_1.checkEventsOfTag)(ts, languageService, vueSourceFile, tag,
|
|
329
|
+
const props = new Set((0, helpers_1.checkPropsOfTag)(ts, languageService, vueSourceFile, tag, options.vueCompilerOptions));
|
|
330
|
+
const events = (0, helpers_1.checkEventsOfTag)(ts, languageService, vueSourceFile, tag, options.vueCompilerOptions);
|
|
336
331
|
const attributes = [];
|
|
337
332
|
for (const prop of [...props, ...attrs]) {
|
|
338
333
|
const isGlobal = !props.has(prop);
|
|
@@ -411,10 +406,8 @@ exports.default = (options) => (_context, modules) => {
|
|
|
411
406
|
}
|
|
412
407
|
function afterHtmlCompletion(completionList, map, vueSourceFile) {
|
|
413
408
|
const languageService = _context.inject('typescript/languageService');
|
|
414
|
-
const languageServiceHost = _context.inject('typescript/languageServiceHost');
|
|
415
409
|
const replacement = getReplacement(completionList, map.sourceFileDocument);
|
|
416
|
-
const
|
|
417
|
-
const componentNames = new Set((0, helpers_1.checkComponentNames)(ts, languageService, vueSourceFile, nativeTags).map(shared_1.hyphenate));
|
|
410
|
+
const componentNames = new Set((0, helpers_1.checkComponentNames)(ts, languageService, vueSourceFile, options.vueCompilerOptions).map(shared_1.hyphenate));
|
|
418
411
|
if (replacement) {
|
|
419
412
|
const isEvent = replacement.text.startsWith('v-on:') || replacement.text.startsWith('@');
|
|
420
413
|
const isProp = replacement.text.startsWith('v-bind:') || replacement.text.startsWith(':');
|
package/out/types.js
CHANGED
|
@@ -19,12 +19,12 @@ var TagNameCasing;
|
|
|
19
19
|
(function (TagNameCasing) {
|
|
20
20
|
TagNameCasing[TagNameCasing["Kebab"] = 0] = "Kebab";
|
|
21
21
|
TagNameCasing[TagNameCasing["Pascal"] = 1] = "Pascal";
|
|
22
|
-
})(TagNameCasing
|
|
22
|
+
})(TagNameCasing || (exports.TagNameCasing = TagNameCasing = {}));
|
|
23
23
|
var AttrNameCasing;
|
|
24
24
|
(function (AttrNameCasing) {
|
|
25
25
|
AttrNameCasing[AttrNameCasing["Kebab"] = 0] = "Kebab";
|
|
26
26
|
AttrNameCasing[AttrNameCasing["Camel"] = 1] = "Camel";
|
|
27
|
-
})(AttrNameCasing
|
|
27
|
+
})(AttrNameCasing || (exports.AttrNameCasing = AttrNameCasing = {}));
|
|
28
28
|
// only export types of depend packages
|
|
29
29
|
__exportStar(require("@volar/language-service/out/types"), exports);
|
|
30
30
|
__exportStar(require("@vue/language-core/out/types"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/language-service",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.13",
|
|
4
4
|
"main": "out/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"update-html-data": "node ./scripts/update-html-data.js"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@volar/language-core": "1.7.
|
|
21
|
-
"@volar/language-service": "1.7.
|
|
22
|
-
"@volar/typescript": "1.7.
|
|
20
|
+
"@volar/language-core": "1.7.5",
|
|
21
|
+
"@volar/language-service": "1.7.5",
|
|
22
|
+
"@volar/typescript": "1.7.5",
|
|
23
23
|
"@vue/compiler-dom": "^3.3.0",
|
|
24
|
-
"@vue/language-core": "1.7.
|
|
24
|
+
"@vue/language-core": "1.7.13",
|
|
25
25
|
"@vue/reactivity": "^3.3.0",
|
|
26
26
|
"@vue/shared": "^3.3.0",
|
|
27
27
|
"volar-service-css": "0.0.7",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"vscode-languageserver-textdocument": "^1.0.8"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@volar/kit": "1.7.
|
|
39
|
+
"@volar/kit": "1.7.5",
|
|
40
40
|
"vscode-languageserver-protocol": "^3.17.3",
|
|
41
41
|
"vscode-uri": "^3.0.7"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "32d5d5e4414f97b0dc28cd727a9cecf60acd4e97"
|
|
44
44
|
}
|