From 30ee45581278c4650fcbea34137d7cd8d0f9e6d7 Mon Sep 17 00:00:00 2001 From: ruben beck Date: Tue, 11 Jul 2023 14:21:00 +0200 Subject: [PATCH] python examples for connecting to lsp --- src/guide/connecting_lsp.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/guide/connecting_lsp.md b/src/guide/connecting_lsp.md index 2c96e0c..ae3512c 100644 --- a/src/guide/connecting_lsp.md +++ b/src/guide/connecting_lsp.md @@ -1 +1,28 @@ # Connecting to an LSP + +In order to list all available lsp you may connect to you may do the following. + + +
python
+
+ +```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 +``` + +
\ No newline at end of file