@volar/typescript 2.4.4 → 2.4.5
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 +3 -0
- package/lib/node/proxyLanguageService.js +12 -4
- package/package.json +4 -4
package/index.d.ts
CHANGED
|
@@ -43,6 +43,9 @@ interface TypeScriptGenericOptions {
|
|
|
43
43
|
*/
|
|
44
44
|
interface TypeScriptNonTSPluginOptions {
|
|
45
45
|
getExtraServiceScripts?(fileName: string, root: VirtualCode): TypeScriptExtraServiceScript[];
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated Remove in 2.5.0
|
|
48
|
+
*/
|
|
46
49
|
resolveLanguageServiceHost?(host: ts.LanguageServiceHost): ts.LanguageServiceHost;
|
|
47
50
|
}
|
|
48
51
|
export interface TypeScriptServiceScript {
|
|
@@ -755,8 +755,13 @@ function getCompletionsAtPosition(language, getCompletionsAtPosition) {
|
|
|
755
755
|
return undefined;
|
|
756
756
|
}
|
|
757
757
|
if (serviceScript) {
|
|
758
|
-
|
|
758
|
+
let mainResult;
|
|
759
|
+
const additionalResults = [];
|
|
759
760
|
for (const [generatedOffset, mapping] of (0, transform_1.toGeneratedOffsets)(language, serviceScript, sourceScript, position, language_core_1.isCompletionEnabled)) {
|
|
761
|
+
const isAdditional = typeof mapping.data.completion === 'object' && mapping.data.completion.isAdditional;
|
|
762
|
+
if (!isAdditional && mainResult?.entries.length) {
|
|
763
|
+
continue;
|
|
764
|
+
}
|
|
760
765
|
const result = getCompletionsAtPosition(targetScript.id, generatedOffset, options, formattingSettings);
|
|
761
766
|
if (!result) {
|
|
762
767
|
continue;
|
|
@@ -769,14 +774,17 @@ function getCompletionsAtPosition(language, getCompletionsAtPosition) {
|
|
|
769
774
|
}
|
|
770
775
|
result.optionalReplacementSpan = result.optionalReplacementSpan
|
|
771
776
|
&& (0, transform_1.transformTextSpan)(sourceScript, language, serviceScript, result.optionalReplacementSpan, language_core_1.isCompletionEnabled)?.[1];
|
|
772
|
-
const isAdditional = typeof mapping.data.completion === 'object' && mapping.data.completion.isAdditional;
|
|
773
777
|
if (isAdditional) {
|
|
774
|
-
|
|
778
|
+
additionalResults.push(result);
|
|
775
779
|
}
|
|
776
780
|
else {
|
|
777
|
-
|
|
781
|
+
mainResult = result;
|
|
778
782
|
}
|
|
779
783
|
}
|
|
784
|
+
const results = additionalResults;
|
|
785
|
+
if (mainResult) {
|
|
786
|
+
results.unshift(mainResult);
|
|
787
|
+
}
|
|
780
788
|
if (results.length) {
|
|
781
789
|
return {
|
|
782
790
|
...results[0],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volar/typescript",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"**/*.js",
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
"directory": "packages/typescript"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@volar/language-core": "2.4.
|
|
15
|
+
"@volar/language-core": "2.4.5",
|
|
16
16
|
"path-browserify": "^1.0.1",
|
|
17
17
|
"vscode-uri": "^3.0.8"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@types/node": "latest",
|
|
21
21
|
"@types/path-browserify": "latest",
|
|
22
|
-
"@volar/language-service": "2.4.
|
|
22
|
+
"@volar/language-service": "2.4.5"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "eb9864da6a36535195b906ae33aca3c0f95286a5"
|
|
25
25
|
}
|