python-lsp / python-lsp-server

Fork of the python-language-server project, maintained by the Spyder IDE team and the community
MIT License
1.76k stars 186 forks source link

notebookDocumentSync notebookSelector type error #453

Closed xueerli closed 9 months ago

xueerli commented 9 months ago

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notebookDocumentSyncOptions

The notebookSelector should be an array type. But now the object is returned. image

ccordoba12 commented 9 months ago

Hey @xueerli, thanks for reporting. Although the LSP docs are not so clear about it, taking a look at the Python implementation of the protocol, I think you're right:

https://github.com/microsoft/lsprotocol/blob/3371f9ecc1b3ad952d9757c27562b3ea4dcc1381/packages/python/lsprotocol/types.py#L6709-L6740

https://github.com/microsoft/lsprotocol/blob/3371f9ecc1b3ad952d9757c27562b3ea4dcc1381/tests/python/test_cattrs_special_cases.py#L270-L280

@smacke, could you take a look at this one? Thanks!

smacke commented 9 months ago

Looks like a bug; https://github.com/python-lsp/python-lsp-server/pull/454 should fix.