csharp-language-server
csharp-language-server copied to clipboard
Uncontrolled error when no `.csproj` file is found
I've installed csharp-language-server using mason.
But when I open a C# file I get the next errors
I've got dotnet and .NET 7.0.9 installed. I'm missing something?
Hey @Zeioth Could you get the full log of the from neovim? Last screenshot indicates some sort of a crash but heading lines are missing. I am not an expert in neovim so I am not sure how to show errors from lsp integration exactly..
@razzmatazz I've been able to get the full log by using :redir > ~/mylog.log and then :messages after opening a C# file.
Ok it seems to be saying it requires a .csproj file.
I have another another project with a .csproj, so I can test it: Opening a file of this project shows the next message instead:
LSP[csharp_ls][Info] csharp-ls: initializing, csharp-ls version 0.8.0.0; cwd: "/home/zeioth/.local/share/nvim/lazy/compiler.nvim/tests/examples/cs/build-dotnet"
LSP[csharp_ls][Info] csharp-ls: csharp-ls is released under MIT license and is not affiliated with Microsoft Corp.; see https://github.com/razzmatazz/csharp-language-server
LSP[csharp_ls][Info] csharp-ls: MSBuildLocator: will register ".NET Core SDK", Version=7.0.109 as default instance
LSP[csharp_ls][Log] csharp-ls: attempting to find and load solution based on cwd ("/home/zeioth/.local/share/nvim/lazy/compiler.nvim/tests/examples/cs/build-dotnet")..
LSP[csharp_ls][Log] csharp-ls: 0 solution(s) found: []
LSP[csharp_ls][Log] csharp-ls: no or multiple .sln files found on /home/zeioth/.local/share/nvim/lazy/compiler.nvim/tests/examples/cs/build-dotnet
LSP[csharp_ls][Log] csharp-ls: looking for .csproj/fsproj files on /home/zeioth/.local/share/nvim/lazy/compiler.nvim/tests/examples/cs/build-dotnet..
LSP[csharp_ls][Log] csharp-ls: loading project "/home/zeioth/.local/share/nvim/lazy/compiler.nvim/tests/examples/cs/build-dotnet/project.csproj"..
LSP[csharp_ls][Log] csharp-ls: OK, 1 project files loaded
And in this case it seems to work correcty
Maybe the only issue is the scary error when no project file has been found. Some error like "Your project needs to have a .csproj file" or something would probably be more useful. In a notification preferably, so it doesn't cut the user's flow.
If the .csproj file is found correctly, we should be showing any message probably.