OmniSharp / omnisharp-roslyn

OmniSharp server (HTTP, STDIO) based on Roslyn workspaces
MIT License
1.75k stars 420 forks source link

Omnisharp server won't initalize correctly with several sln files #2299

Open tilupe opened 2 years ago

tilupe commented 2 years ago

Hi,

I am not sure if this is the right place to ask, but I didn't find another suited place yet.

Problem: My omnisharp-roslyn server won't start correcty in one of my projects which has several .sln files.

Setup: I am using WSL2 with Ubuntu und use there neovim with built in Lsp.

Context: I setup the lsp-server correctly with neovim since in the projects where I have only one .sln file everything works nicely (only that goToImplementation is not yet supported ;)

In the logs I don't know exactly what to look for, but what I saw was: It starts with Logs like "Successfully loaded project file", then come "OmniSharp.MSBuild.ProjectManager: Update project", after this come "Found package reference 'Foo', but none of the versions in the lock file" and then only come "Tried to send request or notification before initialization was completed and will be sent later OmniSharp.Extensions.JsonRpc.Client.OutgoingNotification".

I remeber that when I used omnisharp-vim, it always asked me which solution file I wanted to use when opening this project, but with the omnisharp-roslyn server I wouln't know where to specifiy this. This is why I think it has to to with the several .sln files. The root directory is correct.

Any ideas? Do you need more other information? or could this be a nvim-lsp-config problem?

Thanks in advance for looking at my problem.

KiLLeRRaT commented 2 years ago

I'm seeing the same problem. It's when I have multiple solution files in my root directory.

cdimitroulas commented 2 years ago

I've also seen the same issue in a codebase which had multiple solution files. When we unified them into a single solution file for the whole repository, I stopped seeing issues.

tylimbach commented 5 months ago

I'm seeing the same issue above when launching omnisharp in a directory with multiple solutions, using neovim's built in LSP. My LSP does not attach to the buffer, but it will iterate through each csproj to load, followed by the same "Tried to send request or notification before initialization was completed and will be sent later" messages as mentioned above. I tested a singular csproj and sln within a root_dir, and that works fine.

This also appears to cause a memory leak, as my RAM usage of the .NET host crawls up indefinitely, using up nearly all of my 32GB RAM.

csharp_ls doesn't have any of these problems, it processes all csproj in the whole repo just fine. I'd love for omnisharp to work here instead.

Is there any plan to fix this or a real workaround?