When I implement @server.feature(DOCUMENT_SYMBOL), which returns a List[DocumentSymbol], the server crashes with
ERROR:pygls.protocol:Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pygls/protocol.py", line 364, in _send_data
body = json.dumps(data, default=lambda o: o.__dict__)
File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 238, in dumps
**kw).encode(obj)
File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/usr/local/lib/python3.7/site-packages/pygls/protocol.py", line 364, in <lambda>
body = json.dumps(data, default=lambda o: o.__dict__)
AttributeError: 'mappingproxy' object has no attribute '__dict__'
Hi folks,
When I implement
@server.feature(DOCUMENT_SYMBOL)
, which returns aList[DocumentSymbol]
, the server crashes withWhat needs to be done to fix this error?
Thanks!