nwolverson / purescript-language-server

MIT License
184 stars 42 forks source link

WorkspaceEdit contains both changes and documentChanges #52

Closed autozimu closed 5 years ago

autozimu commented 5 years ago

According to specification,

The edit should either provide changes or documentChanges

My understanding is these two fields should be exclusive, i.e., when one of the fields is filled in, the other should be empty.

Right now, this server produces output contains both fields filled, which caused https://github.com/autozimu/LanguageClient-neovim/issues/724

sriharshachilakapati commented 5 years ago

I just went through the specification out of curiosity, and found this text at https://microsoft.github.io/language-server-protocol/specification#workspaceedit

The edit should either provide changes or documentChanges. If the client can handle versioned document edits and if documentChanges are present, the latter are preferred over changes.

My understanding is that the server should send out at least one of changes or documentChanges.

This is because the second statement implies that if documentChanges are present, they should be preferred. There is no restriction that one of them should be null.

I think that the fix made to the client is the correct one.

autozimu commented 5 years ago

You're right.