From bafd2877a4bd57f187f0d039c2c71539a303f4d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20B=C3=A4umer?= Date: Wed, 22 May 2024 14:50:39 +0200 Subject: [PATCH] Fix parameter ordering (#1485) --- README.md | 1 + client/package-lock.json | 4 ++-- client/package.json | 2 +- client/src/browser/main.ts | 12 ++++++------ 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 4f3e00a0..8ad288ee 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ After cloning the repository, run `npm install` to install dependencies and `npm - added proposed CodeActionKind.RefactorMove - snippet support in Workspace edits - support to control the parallelism of the dispatch requests and notification. This is a breaking change since it allows notification handlers to return a promise to control this. +- make client browser implementation consistent with the node implementation in terms of arguments. This is a breaking change since it re-ordered parameter declarations. ## 3.17.5 Protocol, 9.0.1 Client and 9.0.1 Server diff --git a/client/package-lock.json b/client/package-lock.json index 4a92ec36..29df0fd0 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -1,12 +1,12 @@ { "name": "vscode-languageclient", - "version": "10.0.0-next.6", + "version": "10.0.0-next.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "vscode-languageclient", - "version": "10.0.0-next.6", + "version": "10.0.0-next.7", "license": "MIT", "dependencies": { "minimatch": "^9.0.3", diff --git a/client/package.json b/client/package.json index 9dbfae6f..d029afd6 100644 --- a/client/package.json +++ b/client/package.json @@ -1,7 +1,7 @@ { "name": "vscode-languageclient", "description": "VSCode Language client implementation", - "version": "10.0.0-next.6", + "version": "10.0.0-next.7", "author": "Microsoft Corporation", "license": "MIT", "engines": { diff --git a/client/src/browser/main.ts b/client/src/browser/main.ts index 9d8e74cf..b9493551 100644 --- a/client/src/browser/main.ts +++ b/client/src/browser/main.ts @@ -14,23 +14,23 @@ export type ServerOptions = Worker | (() => Promise) export class LanguageClient extends BaseLanguageClient { - private readonly options: ServerOptions; + private readonly serverOptions: ServerOptions; - constructor(id: string, name: string, clientOptions: LanguageClientOptions, options: ServerOptions) { + constructor(id: string, name: string, serverOptions: ServerOptions, clientOptions: LanguageClientOptions) { super(id, name, clientOptions); - this.options = options; + this.serverOptions = serverOptions; } protected async createMessageTransports(_encoding: string): Promise { - if (typeof this.options === 'function') { - const result = await this.options(); + if (typeof this.serverOptions === 'function') { + const result = await this.serverOptions(); if (result instanceof Worker) { return this.createMessageTransportsFromWorker(result); } else { return result; } } else { - return this.createMessageTransportsFromWorker(this.options); + return this.createMessageTransportsFromWorker(this.serverOptions); } }