openlawlibrary / pygls

A pythonic generic language server
https://pygls.readthedocs.io/en/latest/
Apache License 2.0
585 stars 104 forks source link

AttributeError("'ConfigurationParams' object has no attribute 'partial_result_token'") #307

Closed HankBO closed 1 year ago

HankBO commented 1 year ago

When debugging json extension example in pygls' package, an error appeared in async def show_configuration_async: Screen Shot 2022-12-30 at 09 56 51

Tracking back to the root cause: json-extension - server.py - line 237: config = await ls.get_configuration_async( pygls - server.py - line 397: return self.lsp.get_configuration_async(params) pygls - protocol.py: line 457: body = json.dumps(data, default=self._serialize_message)

The exception for calling json.dumps is: AttributeError("'ConfigurationParams' object has no attribute 'partial_result_token'") Screen Shot 2022-12-30 at 09 50 19

alcarney commented 1 year ago

Looks like it should be WorkspaceConfigurationParams

I'm in the process of putting together a PR with some tests to catch this going forward, but if you change it on your end in the meantime, hopefully that will be enough to fix it for you 🤞

tombh commented 1 year ago

Released in https://pypi.org/project/pygls/1.0.1