@vue/typescript-plugin 2.2.2 → 2.2.6
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/lib/common.js +2 -2
- package/lib/requests/collectExtractProps.js +1 -1
- package/lib/requests/componentInfos.d.ts +4 -6
- package/lib/requests/componentInfos.js +52 -71
- package/lib/utils.js +3 -1
- package/package.json +3 -3
- package/lib/index.d.ts +0 -3
- package/lib/index.js +0 -39
- package/lib/requests/getSlotNames.d.ts +0 -6
- package/lib/requests/getSlotNames.js +0 -30
- package/lib/requests/goToDefinition.d.ts +0 -2
- package/lib/requests/goToDefinition.js +0 -26
package/lib/common.js
CHANGED
|
@@ -102,7 +102,7 @@ function getCompletionEntryDetails(language, asScriptId, getCompletionEntryDetai
|
|
|
102
102
|
const { fileName } = args[6]?.__isAutoImport;
|
|
103
103
|
const sourceScript = language.scripts.get(asScriptId(fileName));
|
|
104
104
|
if (sourceScript?.generated?.root instanceof language_core_1.VueVirtualCode) {
|
|
105
|
-
const sfc = sourceScript.generated.root.
|
|
105
|
+
const sfc = sourceScript.generated.root.vueSfc;
|
|
106
106
|
if (!sfc?.descriptor.script && !sfc?.descriptor.scriptSetup) {
|
|
107
107
|
for (const codeAction of details?.codeActions ?? []) {
|
|
108
108
|
for (const change of codeAction.changes) {
|
|
@@ -173,7 +173,7 @@ function getEncodedSemanticClassifications(ts, language, languageService, asScri
|
|
|
173
173
|
const sourceScript = language.scripts.get(asScriptId(fileName));
|
|
174
174
|
const root = sourceScript?.generated?.root;
|
|
175
175
|
if (root instanceof language_core_1.VueVirtualCode) {
|
|
176
|
-
const { template } = root.
|
|
176
|
+
const { template } = root.sfc;
|
|
177
177
|
if (template) {
|
|
178
178
|
for (const componentSpan of getComponentSpans.call({ typescript: ts, languageService }, root, template, {
|
|
179
179
|
start: span.start - template.startTagEnd,
|
|
@@ -18,7 +18,7 @@ function collectExtractProps(fileName, templateCodeRange) {
|
|
|
18
18
|
const checker = program.getTypeChecker();
|
|
19
19
|
const script = sourceScript.generated?.languagePlugin.typescript?.getServiceScript(root);
|
|
20
20
|
const maps = script ? [...language.maps.forEach(script.code)].map(([_sourceScript, map]) => map) : [];
|
|
21
|
-
const sfc = root
|
|
21
|
+
const { sfc } = root;
|
|
22
22
|
sourceFile.forEachChild(function visit(node) {
|
|
23
23
|
if (ts.isPropertyAccessExpression(node)
|
|
24
24
|
&& ts.isIdentifier(node.expression)
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import * as vue from '@vue/language-core';
|
|
2
2
|
import type * as ts from 'typescript';
|
|
3
3
|
import type { RequestContext } from './types';
|
|
4
|
-
export
|
|
4
|
+
export declare function getComponentProps(this: RequestContext, fileName: string, tag: string): {
|
|
5
5
|
name: string;
|
|
6
|
-
required?:
|
|
7
|
-
deprecated?: boolean;
|
|
6
|
+
required?: true;
|
|
8
7
|
commentMarkdown?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function getComponentProps(this: RequestContext, fileName: string, tag: string): ComponentPropInfo[] | undefined;
|
|
8
|
+
}[] | undefined;
|
|
11
9
|
export declare function getComponentEvents(this: RequestContext, fileName: string, tag: string): string[] | undefined;
|
|
12
|
-
export declare function
|
|
10
|
+
export declare function getTemplateContextProps(this: RequestContext, fileName: string): string[] | undefined;
|
|
13
11
|
export declare function getComponentNames(this: RequestContext, fileName: string): string[] | undefined;
|
|
14
12
|
export declare function _getComponentNames(ts: typeof import('typescript'), tsLs: ts.LanguageService, vueCode: vue.VueVirtualCode): string[];
|
|
15
13
|
export declare function getElementAttrs(this: RequestContext, fileName: string, tagName: string): string[] | undefined;
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getComponentProps = getComponentProps;
|
|
4
4
|
exports.getComponentEvents = getComponentEvents;
|
|
5
|
-
exports.
|
|
5
|
+
exports.getTemplateContextProps = getTemplateContextProps;
|
|
6
6
|
exports.getComponentNames = getComponentNames;
|
|
7
7
|
exports._getComponentNames = _getComponentNames;
|
|
8
8
|
exports.getElementAttrs = getElementAttrs;
|
|
9
9
|
const vue = require("@vue/language-core");
|
|
10
10
|
const shared_1 = require("@vue/shared");
|
|
11
|
-
const path = require("node:path");
|
|
12
11
|
function getComponentProps(fileName, tag) {
|
|
13
12
|
const { typescript: ts, language, languageService, getFileId } = this;
|
|
14
13
|
const volarFile = language.scripts.get(getFileId(fileName));
|
|
@@ -22,10 +21,23 @@ function getComponentProps(fileName, tag) {
|
|
|
22
21
|
if (!components) {
|
|
23
22
|
return [];
|
|
24
23
|
}
|
|
25
|
-
const
|
|
26
|
-
|
|
24
|
+
const name = tag.split('.');
|
|
25
|
+
let componentSymbol = components.type.getProperty(name[0])
|
|
26
|
+
?? components.type.getProperty((0, shared_1.camelize)(name[0]))
|
|
27
|
+
?? components.type.getProperty((0, shared_1.capitalize)((0, shared_1.camelize)(name[0])));
|
|
28
|
+
if (!componentSymbol) {
|
|
27
29
|
return [];
|
|
28
30
|
}
|
|
31
|
+
let componentType = checker.getTypeOfSymbolAtLocation(componentSymbol, components.node);
|
|
32
|
+
for (let i = 1; i < name.length; i++) {
|
|
33
|
+
componentSymbol = componentType.getProperty(name[i]);
|
|
34
|
+
if (componentSymbol) {
|
|
35
|
+
componentType = checker.getTypeOfSymbolAtLocation(componentSymbol, components.node);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
29
41
|
const result = new Map();
|
|
30
42
|
for (const sig of componentType.getCallSignatures()) {
|
|
31
43
|
const propParam = sig.parameters[0];
|
|
@@ -35,13 +47,8 @@ function getComponentProps(fileName, tag) {
|
|
|
35
47
|
for (const prop of props) {
|
|
36
48
|
const name = prop.name;
|
|
37
49
|
const required = !(prop.flags & ts.SymbolFlags.Optional) || undefined;
|
|
38
|
-
const
|
|
39
|
-
result.set(name, {
|
|
40
|
-
name,
|
|
41
|
-
required,
|
|
42
|
-
deprecated,
|
|
43
|
-
commentMarkdown
|
|
44
|
-
});
|
|
50
|
+
const commentMarkdown = generateCommentMarkdown(prop.getDocumentationComment(checker), prop.getJsDocTags()) || undefined;
|
|
51
|
+
result.set(name, { name, required, commentMarkdown });
|
|
45
52
|
}
|
|
46
53
|
}
|
|
47
54
|
}
|
|
@@ -57,13 +64,8 @@ function getComponentProps(fileName, tag) {
|
|
|
57
64
|
}
|
|
58
65
|
const name = prop.name;
|
|
59
66
|
const required = !(prop.flags & ts.SymbolFlags.Optional) || undefined;
|
|
60
|
-
const
|
|
61
|
-
result.set(name, {
|
|
62
|
-
name,
|
|
63
|
-
required,
|
|
64
|
-
deprecated,
|
|
65
|
-
commentMarkdown
|
|
66
|
-
});
|
|
67
|
+
const commentMarkdown = generateCommentMarkdown(prop.getDocumentationComment(checker), prop.getJsDocTags()) || undefined;
|
|
68
|
+
result.set(name, { name, required, commentMarkdown });
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
71
|
}
|
|
@@ -82,10 +84,25 @@ function getComponentEvents(fileName, tag) {
|
|
|
82
84
|
if (!components) {
|
|
83
85
|
return [];
|
|
84
86
|
}
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
+
const name = tag.split('.');
|
|
88
|
+
let componentSymbol = components.type.getProperty(name[0]);
|
|
89
|
+
if (!componentSymbol) {
|
|
90
|
+
componentSymbol = components.type.getProperty((0, shared_1.camelize)(name[0]))
|
|
91
|
+
?? components.type.getProperty((0, shared_1.capitalize)((0, shared_1.camelize)(name[0])));
|
|
92
|
+
}
|
|
93
|
+
if (!componentSymbol) {
|
|
87
94
|
return [];
|
|
88
95
|
}
|
|
96
|
+
let componentType = checker.getTypeOfSymbolAtLocation(componentSymbol, components.node);
|
|
97
|
+
for (let i = 1; i < name.length; i++) {
|
|
98
|
+
componentSymbol = componentType.getProperty(name[i]);
|
|
99
|
+
if (componentSymbol) {
|
|
100
|
+
componentType = checker.getTypeOfSymbolAtLocation(componentSymbol, components.node);
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
return [];
|
|
104
|
+
}
|
|
105
|
+
}
|
|
89
106
|
const result = new Set();
|
|
90
107
|
// for (const sig of componentType.getCallSignatures()) {
|
|
91
108
|
// const emitParam = sig.parameters[1];
|
|
@@ -111,21 +128,17 @@ function getComponentEvents(fileName, tag) {
|
|
|
111
128
|
}
|
|
112
129
|
return [...result];
|
|
113
130
|
}
|
|
114
|
-
function
|
|
131
|
+
function getTemplateContextProps(fileName) {
|
|
115
132
|
const { typescript: ts, language, languageService, getFileId } = this;
|
|
116
133
|
const volarFile = language.scripts.get(getFileId(fileName));
|
|
117
134
|
if (!(volarFile?.generated?.root instanceof vue.VueVirtualCode)) {
|
|
118
135
|
return;
|
|
119
136
|
}
|
|
120
137
|
const vueCode = volarFile.generated.root;
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
return directives.type.getProperties()
|
|
126
|
-
.map(({ name }) => name)
|
|
127
|
-
.filter(name => name.startsWith('v') && name.length >= 2 && name[1] === name[1].toUpperCase())
|
|
128
|
-
.filter(name => !['vBind', 'vIf', 'vOn', 'VOnce', 'vShow', 'VSlot'].includes(name));
|
|
138
|
+
return getVariableType(ts, languageService, vueCode, '__VLS_ctx')
|
|
139
|
+
?.type
|
|
140
|
+
?.getProperties()
|
|
141
|
+
.map(c => c.name);
|
|
129
142
|
}
|
|
130
143
|
function getComponentNames(fileName) {
|
|
131
144
|
const { typescript: ts, language, languageService, getFileId } = this;
|
|
@@ -134,17 +147,20 @@ function getComponentNames(fileName) {
|
|
|
134
147
|
return;
|
|
135
148
|
}
|
|
136
149
|
const vueCode = volarFile.generated.root;
|
|
137
|
-
return
|
|
150
|
+
return getVariableType(ts, languageService, vueCode, '__VLS_components')
|
|
151
|
+
?.type
|
|
152
|
+
?.getProperties()
|
|
153
|
+
.map(c => c.name)
|
|
154
|
+
.filter(entry => !entry.includes('$') && !entry.startsWith('_'))
|
|
155
|
+
?? [];
|
|
138
156
|
}
|
|
139
157
|
function _getComponentNames(ts, tsLs, vueCode) {
|
|
140
|
-
|
|
158
|
+
return getVariableType(ts, tsLs, vueCode, '__VLS_components')
|
|
141
159
|
?.type
|
|
142
160
|
?.getProperties()
|
|
143
161
|
.map(c => c.name)
|
|
144
162
|
.filter(entry => !entry.includes('$') && !entry.startsWith('_'))
|
|
145
163
|
?? [];
|
|
146
|
-
names.push(getSelfComponentName(vueCode.fileName));
|
|
147
|
-
return names;
|
|
148
164
|
}
|
|
149
165
|
function getElementAttrs(fileName, tagName) {
|
|
150
166
|
const { typescript: ts, language, languageService, getFileId } = this;
|
|
@@ -155,9 +171,7 @@ function getElementAttrs(fileName, tagName) {
|
|
|
155
171
|
const program = languageService.getProgram();
|
|
156
172
|
let tsSourceFile;
|
|
157
173
|
if (tsSourceFile = program.getSourceFile(fileName)) {
|
|
158
|
-
const typeNode = tsSourceFile.statements
|
|
159
|
-
.filter(ts.isTypeAliasDeclaration)
|
|
160
|
-
.find(node => node.name.getText() === '__VLS_IntrinsicElementsCompletion');
|
|
174
|
+
const typeNode = tsSourceFile.statements.find((node) => ts.isTypeAliasDeclaration(node) && node.name.getText() === '__VLS_IntrinsicElementsCompletion');
|
|
161
175
|
const checker = program.getTypeChecker();
|
|
162
176
|
if (checker && typeNode) {
|
|
163
177
|
const type = checker.getTypeFromTypeNode(typeNode.type);
|
|
@@ -170,31 +184,6 @@ function getElementAttrs(fileName, tagName) {
|
|
|
170
184
|
}
|
|
171
185
|
return [];
|
|
172
186
|
}
|
|
173
|
-
function getComponentType(ts, languageService, vueCode, components, fileName, tag) {
|
|
174
|
-
const program = languageService.getProgram();
|
|
175
|
-
const checker = program.getTypeChecker();
|
|
176
|
-
const name = tag.split('.');
|
|
177
|
-
let componentSymbol = components.type.getProperty(name[0])
|
|
178
|
-
?? components.type.getProperty((0, shared_1.camelize)(name[0]))
|
|
179
|
-
?? components.type.getProperty((0, shared_1.capitalize)((0, shared_1.camelize)(name[0])));
|
|
180
|
-
let componentType;
|
|
181
|
-
if (!componentSymbol) {
|
|
182
|
-
const name = getSelfComponentName(fileName);
|
|
183
|
-
if (name === (0, shared_1.capitalize)((0, shared_1.camelize)(tag))) {
|
|
184
|
-
componentType = getVariableType(ts, languageService, vueCode, '__VLS_self')?.type;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
else {
|
|
188
|
-
componentType = checker.getTypeOfSymbolAtLocation(componentSymbol, components.node);
|
|
189
|
-
for (let i = 1; i < name.length; i++) {
|
|
190
|
-
componentSymbol = componentType.getProperty(name[i]);
|
|
191
|
-
if (componentSymbol) {
|
|
192
|
-
componentType = checker.getTypeOfSymbolAtLocation(componentSymbol, components.node);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
return componentType;
|
|
197
|
-
}
|
|
198
187
|
function getVariableType(ts, languageService, vueCode, name) {
|
|
199
188
|
const program = languageService.getProgram();
|
|
200
189
|
let tsSourceFile;
|
|
@@ -209,10 +198,6 @@ function getVariableType(ts, languageService, vueCode, name) {
|
|
|
209
198
|
}
|
|
210
199
|
}
|
|
211
200
|
}
|
|
212
|
-
function getSelfComponentName(fileName) {
|
|
213
|
-
const baseName = path.basename(fileName);
|
|
214
|
-
return (0, shared_1.capitalize)((0, shared_1.camelize)(baseName.slice(0, baseName.lastIndexOf('.'))));
|
|
215
|
-
}
|
|
216
201
|
function searchVariableDeclarationNode(ts, sourceFile, name) {
|
|
217
202
|
let componentsNode;
|
|
218
203
|
walk(sourceFile);
|
|
@@ -232,12 +217,8 @@ function searchVariableDeclarationNode(ts, sourceFile, name) {
|
|
|
232
217
|
function generateCommentMarkdown(parts, jsDocTags) {
|
|
233
218
|
const parsedComment = _symbolDisplayPartsToMarkdown(parts);
|
|
234
219
|
const parsedJsDoc = _jsDocTagInfoToMarkdown(jsDocTags);
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
return {
|
|
238
|
-
content,
|
|
239
|
-
deprecated
|
|
240
|
-
};
|
|
220
|
+
let result = [parsedComment, parsedJsDoc].filter(str => !!str).join('\n\n');
|
|
221
|
+
return result;
|
|
241
222
|
}
|
|
242
223
|
function _symbolDisplayPartsToMarkdown(parts) {
|
|
243
224
|
return parts.map(part => {
|
package/lib/utils.js
CHANGED
|
@@ -153,7 +153,9 @@ class NamedPipeServer {
|
|
|
153
153
|
else if (type === 'componentPropsUpdated') {
|
|
154
154
|
const components = this.componentNamesAndProps.get(fileName) ?? {};
|
|
155
155
|
const [name, props] = data;
|
|
156
|
-
|
|
156
|
+
if (name in components) {
|
|
157
|
+
components[name] = props;
|
|
158
|
+
}
|
|
157
159
|
}
|
|
158
160
|
else {
|
|
159
161
|
console.error('Unknown notification type:', type);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/typescript-plugin",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"**/*.js",
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@volar/typescript": "~2.4.11",
|
|
17
|
-
"@vue/language-core": "2.2.
|
|
17
|
+
"@vue/language-core": "2.2.6",
|
|
18
18
|
"@vue/shared": "^3.5.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/node": "^22.10.4"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "f2088e256dc0220db9549d28d9f865a5711dcfbe"
|
|
24
24
|
}
|
package/lib/index.d.ts
DELETED
package/lib/index.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { createLanguageServicePlugin } from '@volar/typescript/lib/quickstart/createLanguageServicePlugin';
|
|
2
|
-
import * as vue from '@vue/language-core';
|
|
3
|
-
import { proxyLanguageServiceForVue } from './common';
|
|
4
|
-
import { startNamedPipeServer } from './server';
|
|
5
|
-
const windowsPathReg = /\\/g;
|
|
6
|
-
const vueCompilerOptions = new WeakMap();
|
|
7
|
-
const plugin = createLanguageServicePlugin((ts, info) => {
|
|
8
|
-
const vueOptions = getVueCompilerOptions();
|
|
9
|
-
const languagePlugin = vue.createVueLanguagePlugin(ts, info.languageServiceHost.getCompilationSettings(), vueOptions, id => id);
|
|
10
|
-
vueCompilerOptions.set(info.project, vueOptions);
|
|
11
|
-
return {
|
|
12
|
-
languagePlugins: [languagePlugin],
|
|
13
|
-
setup: language => {
|
|
14
|
-
info.languageService = proxyLanguageServiceForVue(ts, language, info.languageService, vueOptions, fileName => fileName);
|
|
15
|
-
if (info.project.projectKind === ts.server.ProjectKind.Configured
|
|
16
|
-
|| info.project.projectKind === ts.server.ProjectKind.Inferred) {
|
|
17
|
-
startNamedPipeServer(ts, info, language, info.project.projectKind);
|
|
18
|
-
}
|
|
19
|
-
// #3963
|
|
20
|
-
const timer = setInterval(() => {
|
|
21
|
-
if (info.project['program']) {
|
|
22
|
-
clearInterval(timer);
|
|
23
|
-
info.project['program'].__vue__ = { language };
|
|
24
|
-
}
|
|
25
|
-
}, 50);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
function getVueCompilerOptions() {
|
|
29
|
-
if (info.project.projectKind === ts.server.ProjectKind.Configured) {
|
|
30
|
-
const tsconfig = info.project.getProjectName();
|
|
31
|
-
return vue.createParsedCommandLine(ts, ts.sys, tsconfig.replace(windowsPathReg, '/')).vueOptions;
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
return vue.createParsedCommandLineByJson(ts, ts.sys, info.languageServiceHost.getCurrentDirectory(), {}).vueOptions;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
export default plugin;
|
|
39
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSlotNames = getSlotNames;
|
|
4
|
-
const language_core_1 = require("@vue/language-core");
|
|
5
|
-
function getSlotNames(fileName) {
|
|
6
|
-
const { typescript: ts, language, languageService, getFileId } = this;
|
|
7
|
-
const sourceScript = language.scripts.get(getFileId(fileName));
|
|
8
|
-
if (!sourceScript?.generated) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
const root = sourceScript.generated.root;
|
|
12
|
-
if (!(root instanceof language_core_1.VueVirtualCode)) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
const program = languageService.getProgram();
|
|
16
|
-
const tsSourceFile = program.getSourceFile(fileName);
|
|
17
|
-
if (!tsSourceFile) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const checker = program.getTypeChecker();
|
|
21
|
-
const typeNode = tsSourceFile.statements
|
|
22
|
-
.filter(ts.isTypeAliasDeclaration)
|
|
23
|
-
.find(node => node.name.getText() === '__VLS_Slots');
|
|
24
|
-
if (typeNode) {
|
|
25
|
-
const attrs = checker.getTypeFromTypeNode(typeNode.type).getProperties();
|
|
26
|
-
return attrs.map(attr => attr.name);
|
|
27
|
-
}
|
|
28
|
-
return [];
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=getSlotNames.js.map
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.goToDefinition = goToDefinition;
|
|
4
|
-
const vue = require("@vue/language-core");
|
|
5
|
-
const componentInfos_1 = require("./componentInfos");
|
|
6
|
-
function goToDefinition(fileName, tag) {
|
|
7
|
-
const { typescript: ts, language, languageService, getFileId } = this;
|
|
8
|
-
const volarFile = language.scripts.get(getFileId(fileName));
|
|
9
|
-
if (!(volarFile?.generated?.root instanceof vue.VueVirtualCode)) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
const vueCode = volarFile.generated.root;
|
|
13
|
-
const components = (0, componentInfos_1.getVariableType)(ts, languageService, vueCode, '__VLS_components');
|
|
14
|
-
if (!components) {
|
|
15
|
-
return '';
|
|
16
|
-
}
|
|
17
|
-
const componentType = (0, componentInfos_1.getComponentType)(ts, languageService, vueCode, components, fileName, tag);
|
|
18
|
-
if (!componentType) {
|
|
19
|
-
return '';
|
|
20
|
-
}
|
|
21
|
-
const decls = componentType.symbol.declarations ?? [];
|
|
22
|
-
for (const decl of decls) {
|
|
23
|
-
return decl.getSourceFile().fileName;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=goToDefinition.js.map
|