@volar/typescript 2.2.1 → 2.2.2
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.
|
@@ -193,18 +193,54 @@ function decorateLanguageService(language, languageService) {
|
|
|
193
193
|
const fileName = filePath.replace(windowsPathReg, '/');
|
|
194
194
|
const [serviceScript, sourceScript, map] = (0, utils_1.getServiceScript)(language, fileName);
|
|
195
195
|
if (serviceScript) {
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
196
|
+
const infos = [];
|
|
197
|
+
for (const [generatePosition, mapping] of (0, transform_1.toGeneratedOffsets)(sourceScript, map, position)) {
|
|
198
|
+
if (!(0, language_core_1.isHoverEnabled)(mapping.data)) {
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
const info = getQuickInfoAtPosition(fileName, generatePosition);
|
|
202
|
+
if (info) {
|
|
203
|
+
const textSpan = (0, transform_1.transformTextSpan)(sourceScript, map, info.textSpan, language_core_1.isHoverEnabled);
|
|
201
204
|
if (textSpan) {
|
|
202
|
-
|
|
203
|
-
...
|
|
205
|
+
infos.push({
|
|
206
|
+
...info,
|
|
204
207
|
textSpan,
|
|
205
|
-
};
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
if (infos.length === 1) {
|
|
213
|
+
return infos[0];
|
|
214
|
+
}
|
|
215
|
+
else if (infos.length >= 2) {
|
|
216
|
+
const combine = { ...infos[0] };
|
|
217
|
+
combine.displayParts = combine.displayParts?.slice();
|
|
218
|
+
combine.documentation = combine.documentation?.slice();
|
|
219
|
+
combine.tags = combine.tags?.slice();
|
|
220
|
+
for (let i = 1; i < infos.length; i++) {
|
|
221
|
+
const { displayParts, documentation, tags } = infos[i];
|
|
222
|
+
if (!combine.displayParts) {
|
|
223
|
+
combine.displayParts = displayParts;
|
|
224
|
+
}
|
|
225
|
+
else if (displayParts?.length) {
|
|
226
|
+
combine.displayParts.push({ ...displayParts[0], text: '\n\n' + displayParts[0].text });
|
|
227
|
+
combine.displayParts.push(...displayParts.slice(1));
|
|
228
|
+
}
|
|
229
|
+
if (!combine.documentation) {
|
|
230
|
+
combine.documentation = documentation;
|
|
231
|
+
}
|
|
232
|
+
else if (documentation?.length) {
|
|
233
|
+
combine.documentation.push({ ...documentation[0], text: '\n\n' + documentation[0].text });
|
|
234
|
+
combine.documentation.push(...documentation.slice(1));
|
|
235
|
+
}
|
|
236
|
+
if (!combine.tags) {
|
|
237
|
+
combine.tags = tags;
|
|
238
|
+
}
|
|
239
|
+
else if (tags?.length) {
|
|
240
|
+
combine.tags.push(...tags);
|
|
206
241
|
}
|
|
207
242
|
}
|
|
243
|
+
return combine;
|
|
208
244
|
}
|
|
209
245
|
}
|
|
210
246
|
else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volar/typescript",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"**/*.js",
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
"directory": "packages/typescript"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@volar/language-core": "2.2.
|
|
15
|
+
"@volar/language-core": "2.2.2",
|
|
16
16
|
"path-browserify": "^1.0.1"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/node": "latest",
|
|
20
20
|
"@types/path-browserify": "latest",
|
|
21
|
-
"@volar/language-service": "2.2.
|
|
21
|
+
"@volar/language-service": "2.2.2"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "8aa41e4c2ab1e954b8c777f789b7a948972e77aa"
|
|
24
24
|
}
|