python examples for connecting to lsp

This commit is contained in:
ruben beck
2023-07-11 14:21:00 +02:00
parent 4471b81993
commit 30ee455812

View File

@@ -1 +1,28 @@
# Connecting to an LSP
In order to list all available lsp you may connect to you may do the following.
<custom-tabs category="lang">
<div slot="title">python</div>
<section>
```python
try:
lsps = sdk_services.list_lsps()
# Select your desired LSP
except Exception as error:
# Handle error
```
When you have selected an LSP you may then connect to it.
```python
try:
lsp_id = sdk_services.lsp_id()
sdk_services.connect_lsp(lsp_id)
except Exception as error:
# Handle error
```
</section>