You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you for your work. I would still be reading the lsp spec without much comprehension if it wasn't for your client implementation. So I am new to pylspclient and lsp in general but believe there is an issue in lsp_client.py:
(may need to scroll the above to the right - contentChanges needs to be in a list)
I find the msft lsp documentation a bit obtuse but assume that the ending [] in the definition below is saying that it needs to be in a list and when I made that change it worked.
contentChanges: TextDocumentContentChangeEvent[];
The text was updated successfully, but these errors were encountered:
You are right that the function send_notification() receives a list. But there is no need to change contentChanges=[contentChanges] because the contentChanges parameter of the function didChange() is already a list.
(where range_ is constructed from lsp_structs.Position as arguments to lsp_structs.Range. A complete aside but in a couple places you use the variable identifier range which will overwrite I believe the builtin range function but that is an unrelated issue.)
lsp_structs.TextDocumentContentChangeEvent(...) is a list according to the specification but it will produce a dictionary unless you do what I suggested or probably more sensible would be for lsp_structs.TextDocumentContentChangeEvent to return the list. Or am I doing something wrong (although with my change I can now successfully communicate with clangd).
@slzatz Each instance of TextDocumentChangeEvent corresponds to one contiguous change to document. Since it's possible that the document has been changed at multiple places, e.g. a bit at the start and a bit at the end, you can specify a list of them. So the function, as far as I can judge, is correct, but the way you call it is not, and should be like this:
First of all, thank you for your work. I would still be reading the lsp spec without much comprehension if it wasn't for your client implementation. So I am new to pylspclient and lsp in general but believe there is an issue in
lsp_client.py
:Couldn't get it to work until changed the return to:
(may need to scroll the above to the right - contentChanges needs to be in a list)
I find the msft lsp documentation a bit obtuse but assume that the ending [] in the definition below is saying that it needs to be in a list and when I made that change it worked.
The text was updated successfully, but these errors were encountered: