jmederosalvarado / roslyn.nvim

Roslyn LSP plugin for neovim
MIT License
203 stars 38 forks source link

New files not getting picked up by LSP #27

Open jakobkhansen opened 6 months ago

jakobkhansen commented 6 months ago

Hello,

this plugin works great, the only issue I am having is that creating a new file requires me to restart Neovim in order for Roslyn to pick up the new file. Creating files with either :e Filename or Neotree plugin seems to not work. I believe Neovim needs to fire some sort of didCreate event to the LSP server, not sure if that is happening. It seems like the Roslyn LSP attaches to the new buffer, but no LSP capabilities are working (diagnostics, hover, etc). Is there any way to fix this?

jakobkhansen commented 6 months ago

FYI: When a new file is created by the LSP (code-action -> Move type to (new file)), there is no difference, it does not work.

But I have discovered that one thing is working, hovering something which is already defined in the current file:

image

So it seems that the LSP server is actually attached and knows of the new file, but stuff like auto-completion, diagnostics and hovering external dependencies (or symbols defined in other files) still does not work until Neovim is restarted. It's almost as if the LSP server is running in some kind of standalone mode for the current file.

WillEhrendreich commented 4 months ago

https://github.com/jmederosalvarado/roslyn.nvim/blob/3e360ea5a15f3cf7ddef02ff003ef24244cdff3a/lua/roslyn/client.lua#L81C2-L87C7

does this have anything to do with it? how should we handle this?