Skip to content

Commit

Permalink
Fix notebook document selector not being a list in capabilities (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
smacke authored Oct 9, 2023
1 parent 05698fa commit 6b975be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pylsp/python_lsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def capabilities(self):
"openClose": True,
},
"notebookDocumentSync": {
"notebookSelector": {"cells": [{"language": "python"}]}
"notebookSelector": [{"cells": [{"language": "python"}]}]
},
"workspace": {
"workspaceFolders": {"supported": True, "changeNotifications": True}
Expand Down
3 changes: 2 additions & 1 deletion test/test_notebook_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 6b975be

Please sign in to comment.