Skip to content

Commit 6b975be

Browse files
authored
Fix notebook document selector not being a list in capabilities (#454)
1 parent 05698fa commit 6b975be

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pylsp/python_lsp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ def capabilities(self):
295295
"openClose": True,
296296
},
297297
"notebookDocumentSync": {
298-
"notebookSelector": {"cells": [{"language": "python"}]}
298+
"notebookSelector": [{"cells": [{"language": "python"}]}]
299299
},
300300
"workspace": {
301301
"workspaceFolders": {"supported": True, "changeNotifications": True}

test/test_notebook_document.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ def test_initialize(client_server_pair):
3333
},
3434
).result(timeout=CALL_TIMEOUT_IN_SECONDS)
3535
assert server.workspace is not None
36-
assert "notebookDocumentSync" in response["capabilities"].keys()
36+
selector = response["capabilities"]["notebookDocumentSync"]["notebookSelector"]
37+
assert isinstance(selector, list)
3738

3839

3940
@pytest.mark.skipif(IS_WIN, reason="Flaky on Windows")

0 commit comments

Comments
 (0)