Clarify responses to rename request. by doriath · Pull Request #616 · microsoft/language-server-protocol (original) (raw)

Why?

First, let me explain why I would like to add this clarification here. ~2 months ago I was playing with RLS (Rust language server) and vim-lsp (client for vim) and I found that rename was not a great user experience.

Here is why:

This means that when I tried to rename something and it failed, I had no message telling me that something failed. From the client (vim-lsp) perspective, it is not clear how to interpret the null response - was there just nothing to do, or was there some error and rename was not performed.

Alternative

In my Pull Request, I went with the proposal of treating null as "nothing has to be done". The alternative approach could be to use it as generic "rename failed" indication.

If this one is preferred, I would propose:

After writing this explanation, I am slightly starting to lean toward the alternative proposal, but I will wait for the feedback first.