Skip to content

Commit 9e967bf

Browse files
committed
fix(language-server): rename requestForwardingCommand to tsserverRequestCommand
1 parent 32c9336 commit 9e967bf

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

extensions/vscode/src/languageClient.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ async function getInitializationOptions(context: vscode.ExtensionContext): Promi
108108
return {
109109
typescript: {
110110
tsdk: (await lsp.getTsdk(context))!.tsdk,
111-
requestForwardingCommand: 'forwardingTsRequest',
111+
tsserverRequestCommand: 'tsserverRequest',
112112
},
113113
};
114114
}

extensions/vscode/src/nodeClientMain.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export const { activate, deactivate } = defineExtension(async () => {
8686

8787
updateProviders(client);
8888

89-
client.onRequest('forwardingTsRequest', async ([command, args]) => {
89+
client.onRequest('tsserverRequest', async ([command, args]) => {
9090
const tsserver = (globalThis as any).__TSSERVER__?.semantic;
9191
if (!tsserver) {
9292
return;

packages/language-server/lib/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export type VueInitializationOptions = {
22
typescript: {
33
tsdk: string;
4-
requestForwardingCommand?: string;
4+
tsserverRequestCommand?: string;
55
};
66
};
77

packages/language-server/node.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ connection.onInitialize(params => {
1818
if (!options.typescript?.tsdk) {
1919
throw new Error('typescript.tsdk is required');
2020
}
21-
if (!options.typescript?.requestForwardingCommand) {
22-
connection.console.warn('typescript.requestForwardingCommand is required since >= 3.0 for complete TS features');
21+
if (!options.typescript?.tsserverRequestCommand) {
22+
connection.console.warn('typescript.tsserverRequestCommand is required since >= 3.0 for complete TS features');
2323
}
2424

2525
const { typescript: ts } = loadTsdkByPath(options.typescript.tsdk, params.locale);
@@ -42,7 +42,7 @@ connection.onInitialize(params => {
4242
{
4343
setup() { },
4444
async getLanguageService(uri) {
45-
if (uri.scheme === 'file' && options.typescript.requestForwardingCommand) {
45+
if (uri.scheme === 'file' && options.typescript.tsserverRequestCommand) {
4646
const fileName = uri.fsPath.replace(/\\/g, '/');
4747
const projectInfo = await sendTsRequest<ts.server.protocol.ProjectInfo>(
4848
ts.server.protocol.CommandTypes.ProjectInfo,
@@ -80,7 +80,7 @@ connection.onInitialize(params => {
8080
simpleLs = undefined;
8181
},
8282
},
83-
getHybridModeLanguageServicePlugins(ts, options.typescript.requestForwardingCommand ? {
83+
getHybridModeLanguageServicePlugins(ts, options.typescript.tsserverRequestCommand ? {
8484
collectExtractProps(...args) {
8585
return sendTsRequest('vue:collectExtractProps', args);
8686
},
@@ -115,7 +115,7 @@ connection.onInitialize(params => {
115115
);
116116

117117
function sendTsRequest<T>(command: string, args: any): Promise<T | null> {
118-
return connection.sendRequest<T>(options.typescript.requestForwardingCommand!, [command, args]);
118+
return connection.sendRequest<T>(options.typescript.tsserverRequestCommand!, [command, args]);
119119
}
120120

121121
function createLs(server: LanguageServer, tsconfig: string | undefined) {

packages/language-server/tests/server.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export async function getLanguageServer(): Promise<{
4444
return null;
4545
});
4646
});
47-
serverHandle.connection.onRequest('forwardingTsRequest', async ([command, args]) => {
47+
serverHandle.connection.onRequest('tsserverRequest', async ([command, args]) => {
4848
const res = await tsserver.message({
4949
seq: seq++,
5050
command: command,
@@ -58,7 +58,7 @@ export async function getLanguageServer(): Promise<{
5858
{
5959
typescript: {
6060
tsdk: path.dirname(require.resolve('typescript/lib/typescript.js')),
61-
requestForwardingCommand: 'forwardingTsRequest',
61+
tsserverRequestCommand: 'tsserverRequest',
6262
},
6363
} satisfies VueInitializationOptions,
6464
{

0 commit comments

Comments
 (0)