diff --git a/pylsp/python_lsp.py b/pylsp/python_lsp.py index 3eeb2f7f..e2b541d5 100644 --- a/pylsp/python_lsp.py +++ b/pylsp/python_lsp.py @@ -295,7 +295,7 @@ def capabilities(self): "openClose": True, }, "notebookDocumentSync": { - "notebookSelector": {"cells": [{"language": "python"}]} + "notebookSelector": [{"cells": [{"language": "python"}]}] }, "workspace": { "workspaceFolders": {"supported": True, "changeNotifications": True} diff --git a/test/test_notebook_document.py b/test/test_notebook_document.py index e8e7ac75..6050b58f 100644 --- a/test/test_notebook_document.py +++ b/test/test_notebook_document.py @@ -33,7 +33,8 @@ def test_initialize(client_server_pair): }, ).result(timeout=CALL_TIMEOUT_IN_SECONDS) assert server.workspace is not None - assert "notebookDocumentSync" in response["capabilities"].keys() + selector = response["capabilities"]["notebookDocumentSync"]["notebookSelector"] + assert isinstance(selector, list) @pytest.mark.skipif(IS_WIN, reason="Flaky on Windows")