Skip to content

Commit 95e411d

Browse files
authored
Fixes #985: request: document how to migrate from breaking change of removing onReady (#988)
1 parent 23a5b16 commit 95e411d

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,17 @@ After cloning the repository, run `npm install` to install dependencies and `npm
3838

3939
Library specific changes are:
4040

41-
- cleanup of client `start` and `stop` methods. Both methods now return a promise since these methods are async. This is a breaking change since start returned a disposable before. Extensions should now implement a deactivate function in their extension main file and correctly return the `stop` promise from the deactivate call. As a consequence the `onReady()` got removed since extensions can await the `start()` call (even multiple times).
41+
- cleanup of client `start` and `stop` methods. Both methods now return a promise since these methods are async. This is a breaking change since start returned a disposable before. Extensions should now implement a deactivate function in their extension main file and correctly return the `stop` promise from the deactivate call. As a consequence the `onReady()` got removed since extensions can await the `start()` call now. Old code like this
42+
```typescript
43+
const client: LanguageClient = ...;
44+
client.start();
45+
await client.onReady();
46+
```
47+
should become:
48+
```typescript
49+
const client: LanguageClient = ...;
50+
await client.start();
51+
```
4252
- notification and request handler registration can now happen before the client is started. This ensures that no messages from the server are missed.
4353
- if an extension sends a notification or request before the client got started the client will auto start.
4454
- all `sendNotification` methods now return a promise. Returning a promise was necessary since the actual writing of the message to the underlying transport is async and a client for example could not determine if a notification was handed off to the transport. This is a breaking change in the sense that it might result in floating promise and might be flagged by a linter.

0 commit comments

Comments
 (0)