toitware / ide-tools

Tools for working with Toit in different IDEs
MIT License
2 stars 2 forks source link

Fix race for the LSP server. #200

Closed floitsch closed 2 years ago

floitsch commented 2 years ago

Sometimes we would see multiple LSP servers because of a race condition. Now we store the promise instead of the actual LSP client. This way we don't accidentally start two clients.

floitsch commented 2 years ago

Note: the easiest way to trigger multiple LSP clients: have multiple editors open at the same time (split layout), and then restart vscode. Each open editor will try to instantiate a client.