Skip to content

Commit

Permalink
Fix parameter ordering (#1485)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaeumer committed May 22, 2024
1 parent 5743f5e commit bafd287
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
12 changes: 6 additions & 6 deletions client/src/browser/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ export type ServerOptions = Worker | (() => Promise<Worker | MessageTransports>)

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<MessageTransports> {
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);
}
}

Expand Down

0 comments on commit bafd287

Please sign in to comment.