@volar/vscode 1.4.0 → 1.4.1
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.
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import * as path from 'typesafe-path';
|
|
1
2
|
import * as vscode from 'vscode';
|
|
2
3
|
import { BaseLanguageClient } from 'vscode-languageclient';
|
|
3
4
|
export declare function activate(cmd: string, context: vscode.ExtensionContext, client: BaseLanguageClient, shouldStatusBarShow: (document: vscode.TextDocument) => boolean, resolveStatusText: (text: string) => string, disableTakeOverMode: boolean, cdn?: string): Promise<vscode.Disposable>;
|
|
4
5
|
export declare function getTsdk(context: vscode.ExtensionContext): Promise<{
|
|
5
|
-
tsdk: string;
|
|
6
|
+
tsdk: string | path.PosixPath;
|
|
6
7
|
version: string | undefined;
|
|
7
8
|
isWorkspacePath: boolean;
|
|
8
9
|
}>;
|
|
@@ -78,7 +78,7 @@ async function activate(cmd, context, client, shouldStatusBarShow, resolveStatus
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
async function reloadServers() {
|
|
81
|
-
const tsPaths = getTsdk(context);
|
|
81
|
+
const tsPaths = await getTsdk(context);
|
|
82
82
|
const newInitOptions = {
|
|
83
83
|
...client.clientOptions.initializationOptions,
|
|
84
84
|
typescript: tsPaths,
|
|
@@ -111,7 +111,7 @@ function resolveWorkspaceTsdk(tsdk) {
|
|
|
111
111
|
if (path.isAbsolute(tsdk)) {
|
|
112
112
|
try {
|
|
113
113
|
if (require.resolve('./typescript.js', { paths: [tsdk] })) {
|
|
114
|
-
return tsdk;
|
|
114
|
+
return tsdk.replace(/\\/g, '/');
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
catch { }
|
|
@@ -121,7 +121,7 @@ function resolveWorkspaceTsdk(tsdk) {
|
|
|
121
121
|
const _path = path.join(folder, tsdk);
|
|
122
122
|
try {
|
|
123
123
|
if (require.resolve('./typescript.js', { paths: [_path] })) {
|
|
124
|
-
return _path;
|
|
124
|
+
return _path.replace(/\\/g, '/');
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
catch { }
|
|
@@ -130,15 +130,15 @@ function resolveWorkspaceTsdk(tsdk) {
|
|
|
130
130
|
async function getVScodeTsdk() {
|
|
131
131
|
const nightly = vscode.extensions.getExtension('ms-vscode.vscode-typescript-next');
|
|
132
132
|
if (nightly) {
|
|
133
|
-
const
|
|
133
|
+
const libPath = path.join(nightly.extensionPath, 'node_modules/typescript/lib').replace(/\\/g, '/');
|
|
134
134
|
return {
|
|
135
|
-
path,
|
|
136
|
-
version: await getTsVersion(
|
|
135
|
+
path: libPath,
|
|
136
|
+
version: await getTsVersion(libPath),
|
|
137
137
|
isWeb: false,
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
140
|
if (vscode.env.appRoot) {
|
|
141
|
-
const libPath = path.join(vscode.env.appRoot, 'extensions/node_modules/typescript/lib');
|
|
141
|
+
const libPath = path.join(vscode.env.appRoot, 'extensions/node_modules/typescript/lib').replace(/\\/g, '/');
|
|
142
142
|
return {
|
|
143
143
|
path: libPath,
|
|
144
144
|
version: await getTsVersion(libPath),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volar/vscode",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"main": "out/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"directory": "packages/vscode"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@volar/language-server": "1.4.
|
|
17
|
-
"@volar/source-map": "1.4.
|
|
16
|
+
"@volar/language-server": "1.4.1",
|
|
17
|
+
"@volar/source-map": "1.4.1",
|
|
18
18
|
"typesafe-path": "^0.2.2",
|
|
19
19
|
"vscode-nls": "^5.2.0"
|
|
20
20
|
},
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"@types/vscode": "*",
|
|
27
27
|
"vscode-languageclient": "*"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "2c8a783542ace3292649a04490919b515e387b9e"
|
|
30
30
|
}
|