@volar/vscode 1.10.10-alpha.0 → 1.10.10
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,9 +1,8 @@
|
|
|
1
|
-
import * as path from 'typesafe-path';
|
|
2
1
|
import * as vscode from 'vscode';
|
|
3
2
|
import type { BaseLanguageClient } from 'vscode-languageclient';
|
|
4
3
|
export declare function activate(cmd: string, context: vscode.ExtensionContext, client: BaseLanguageClient, shouldStatusBarShow: (document: vscode.TextDocument) => boolean, resolveStatusText: (text: string) => string, disableTakeOverMode: boolean): Promise<vscode.Disposable>;
|
|
5
4
|
export declare function getTsdk(context: vscode.ExtensionContext): Promise<{
|
|
6
|
-
tsdk: string
|
|
5
|
+
tsdk: string;
|
|
7
6
|
version: string | undefined;
|
|
8
7
|
isWorkspacePath: boolean;
|
|
9
8
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getTsdk = exports.activate = void 0;
|
|
4
|
-
const path = require("
|
|
4
|
+
const path = require("path-browserify");
|
|
5
5
|
const vscode = require("vscode");
|
|
6
6
|
const common_1 = require("../common");
|
|
7
7
|
const defaultTsdkPath = 'node_modules/typescript/lib';
|
|
@@ -111,26 +111,27 @@ 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;
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
catch { }
|
|
118
118
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
119
|
+
if (vscode.workspace.workspaceFolders) {
|
|
120
|
+
for (const folder of vscode.workspace.workspaceFolders) {
|
|
121
|
+
const tsdkPath = path.join(folder.uri.fsPath.replace(/\\/g, '/'), tsdk);
|
|
122
|
+
try {
|
|
123
|
+
if (require.resolve('./typescript.js', { paths: [tsdkPath] })) {
|
|
124
|
+
return tsdkPath;
|
|
125
|
+
}
|
|
125
126
|
}
|
|
127
|
+
catch { }
|
|
126
128
|
}
|
|
127
|
-
catch { }
|
|
128
129
|
}
|
|
129
130
|
}
|
|
130
131
|
async function getVScodeTsdk() {
|
|
131
132
|
const nightly = vscode.extensions.getExtension('ms-vscode.vscode-typescript-next');
|
|
132
133
|
if (nightly) {
|
|
133
|
-
const libPath = path.join(nightly.extensionPath, '
|
|
134
|
+
const libPath = path.join(nightly.extensionPath.replace(/\\/g, '/'), 'node_modules/typescript/lib');
|
|
134
135
|
return {
|
|
135
136
|
path: libPath,
|
|
136
137
|
version: await getTsVersion(libPath),
|
|
@@ -138,7 +139,7 @@ async function getVScodeTsdk() {
|
|
|
138
139
|
};
|
|
139
140
|
}
|
|
140
141
|
if (vscode.env.appRoot) {
|
|
141
|
-
const libPath = path.join(vscode.env.appRoot, 'extensions/node_modules/typescript/lib')
|
|
142
|
+
const libPath = path.join(vscode.env.appRoot.replace(/\\/g, '/'), 'extensions/node_modules/typescript/lib');
|
|
142
143
|
return {
|
|
143
144
|
path: libPath,
|
|
144
145
|
version: await getTsVersion(libPath),
|
|
@@ -154,7 +155,7 @@ async function getVScodeTsdk() {
|
|
|
154
155
|
};
|
|
155
156
|
}
|
|
156
157
|
function getConfigTsdkPath() {
|
|
157
|
-
return vscode.workspace.getConfiguration('typescript').get('tsdk');
|
|
158
|
+
return vscode.workspace.getConfiguration('typescript').get('tsdk')?.replace(/\\/g, '/');
|
|
158
159
|
}
|
|
159
160
|
function isUseWorkspaceTsdk(context) {
|
|
160
161
|
return context.workspaceState.get('typescript.useWorkspaceTsdk', false);
|
package/out/features/tsconfig.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.activate = void 0;
|
|
4
4
|
const vscode = require("vscode");
|
|
5
5
|
const protocol_1 = require("@volar/language-server/protocol");
|
|
6
|
-
const path = require("
|
|
6
|
+
const path = require("path-browserify");
|
|
7
7
|
async function activate(cmd, client, shouldStatusBarShow) {
|
|
8
8
|
const subscriptions = [];
|
|
9
9
|
const statusBar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right);
|
|
@@ -26,7 +26,7 @@ async function activate(cmd, client, shouldStatusBarShow) {
|
|
|
26
26
|
const tsconfig = await client.sendRequest(protocol_1.GetMatchTsConfigRequest.type, client.code2ProtocolConverter.asTextDocumentIdentifier(vscode.window.activeTextEditor.document));
|
|
27
27
|
if (tsconfig?.uri) {
|
|
28
28
|
currentTsconfigUri = vscode.Uri.parse(tsconfig.uri);
|
|
29
|
-
statusBar.text = path.relative((vscode.workspace.rootPath || '/'), currentTsconfigUri.fsPath);
|
|
29
|
+
statusBar.text = path.relative((vscode.workspace.rootPath?.replace(/\\/g, '/') || '/'), currentTsconfigUri.fsPath.replace(/\\/g, '/'));
|
|
30
30
|
statusBar.command = cmd;
|
|
31
31
|
}
|
|
32
32
|
else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volar/vscode",
|
|
3
|
-
"version": "1.10.10
|
|
3
|
+
"version": "1.10.10",
|
|
4
4
|
"main": "out/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -13,12 +13,13 @@
|
|
|
13
13
|
"directory": "packages/vscode"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@volar/language-server": "1.10.10
|
|
17
|
-
"
|
|
16
|
+
"@volar/language-server": "1.10.10",
|
|
17
|
+
"path-browserify": "^1.0.1",
|
|
18
18
|
"vscode-nls": "^5.2.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/node": "latest",
|
|
22
|
+
"@types/path-browserify": "latest",
|
|
22
23
|
"@types/vscode": "^1.82.0",
|
|
23
24
|
"vscode-languageclient": "^9.0.1"
|
|
24
25
|
},
|
|
@@ -30,5 +31,5 @@
|
|
|
30
31
|
"optional": true
|
|
31
32
|
}
|
|
32
33
|
},
|
|
33
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "c3f1b9e52b738e5e5340ad1aeb827f7ca51bc573"
|
|
34
35
|
}
|