[LSP] Allow explicitly defining which solution or list of projects the language server should load
Main request
From standard command line usage, there appears to currently be no way to exclusively define either:
- A particular solution to load
- A list of projects to load
It would be very helpful if there was an easy way to specify these options when starting the language server from the command line. One may not always want to open all projects in a particularly large directory.
While the server does define solution/open as an RPC command, this requires a given client to support it. That effectively means the only way to open a particular solution or set of projects is to use Visual Studio or VSCode - both of which have UI that at least allow choosing what solution to scope the language server to.
Context on the matter
I often find myself opening projects containing multiple nested solutions - sometimes even ones that reference projects outside of the current solution directory.
While the feature of automatically loading any discovered projects is indeed useful when you only have a few, I regularly work in solutions containing dozens of C# projects in the same solution, with nested solutions containing multiple more. I don't want or need to load all of them, and I actually could not load all of them because some of the projects do in fact lie outside of the working directory (a layout both VS and VSCode have no complaints about loading).
What parts did load ended up loading far slower due to the language server needing to discover them rather than reference them from a solution. I was unable to use the language server for those particularly complicated projects until I made a script to wrap it and manually inject the solution/open command myself. With the ability to specify just a solution or just a set of projects, load times became much quicker, and dependent projects in other directories were loaded just as they were in VSCode.
Additional info
Before the Roslyn language server was broadly usable, I used a wrapper that contained this exact feature set I'm requesting. Unfortunately, it became deprecated once Roslyn's could function on it's own. I could have kept using it, but I feel this should be a feature in the official language server.
I also used to use Omnisharp, which also has a way to define specific solutions or projects to load from the command line. However, I also stopped using Omnisharp since it takes about five to ten minutes to load those big projects I mentioned.
This is my first time making an issue here, and I opted to write this out manually since I didn't see an "LSP feature request" template. I also made sure to dig pretty deep in the source and various issues before making my own, but all the same I hope I didn't miss something obvious!
Thanks for the work put into this language server. It's the fastest I've used, and having these requested capabilities would make it ideal for almost any editor supporting the language server protocol.
Source: dotnet/roslyn