seblj / roslyn.nvim

Roslyn LSP plugin for neovim
MIT License
130 stars 12 forks source link

Override completion error #9

Closed markchristianlacap closed 3 months ago

markchristianlacap commented 3 months ago

The error shows up when typing override and selecting from completion. image image

seblj commented 3 months ago

Hmm. This happens because I receive something in the stdout handler (which I don't expect), and I don't schedule the vim.notify call. That is an easy fix. However, that is just masking up the real error, since something weird is happening when accepting the completion. I get an exception from the language server which causes it to just shut down.

I need to investigate this a bit more, and see if there is some handler that they expect me to implement which I haven't

seblj commented 3 months ago

I think I will push a "fix" for this issue, and then I will just use #7 going forward, which I have a feeling is the same thing as what this really is about.

As I said in the other issue, the "real" issue was pretty hard to debug, but I think I sort of knows what is wrong...

I think the server is sending data which is wrong, in response to a completionItem/resolve request from neovim. This seems to cause nvim-cmp to do something (I have no idea yet what) that in turn makes the server panic...

If I use vim.lsp.completion which is built in to neovim (which is by design far less feature rich than nvim-cmp), it doesn't seem to cause the server to panic. However, it also doesn't insert the snippet as I expect. Reading the spec, it looks like the implementation of vim.lsp.completion "correctly" does not insert the snippet.

I will see if I am able to put of time to investigate more and eventually raise an issue on the server repo, but I cannot guarantee it, and I also am not sure if this will fix everything.

Ideally, using nvim-cmp and accepting the completion shouldn't cause the server to throw an exception, but I also wouldn't blame nvim-cmp (if it even is because of nvim-cmp), because since the response seems to be "wrong", I don't think this is something that nvim-cmp should account for.

So I will be closing this issue, so if you want potential updates, you can subscribe to the other issue, and I will write my findings there if/when I get time to investigate this.