Before that commit, initializeParams.RootUri was always used if non-null.
After that commit, application.ApplicationRoot was always used if non-null, potentially overriding a non-null initializeParams.RootUri.
Specifically, if there are two projects
someproject.sln
somesubproject/somesubproject.sln
and if OmniSharp is started with somesubproject/ as working directory,
then application.ApplicationRoot will be somesubproject/,
even if initializeParams.RootUri sent by the LSP requests to use the parent directory.
My guess is that the reason for this commit was to enable a user override with the omnisharp -s.
That's fine but I don't think the override should happen when starting OmniSharp without -s.
It is wrong in this case because OmniSharp uses only the current working directory to determine application.ApplicationRoot;
but the LSP client also uses the current file, which may be outside the working directory.
Commit 30db3e09 (Updated host to use provided solution file., 2021-02-28) from https://github.com/OmniSharp/omnisharp-roslyn/pull/2099 seems to have regressed rootUri handling (cc @david-driscoll).
Before that commit,
initializeParams.RootUri
was always used if non-null. After that commit,application.ApplicationRoot
was always used if non-null, potentially overriding a non-nullinitializeParams.RootUri
.Specifically, if there are two projects
and if OmniSharp is started with
somesubproject/
as working directory, thenapplication.ApplicationRoot
will besomesubproject/
, even ifinitializeParams.RootUri
sent by the LSP requests to use the parent directory.My guess is that the reason for this commit was to enable a user override with the
omnisharp -s
. That's fine but I don't think the override should happen when starting OmniSharp without-s
.It is wrong in this case because OmniSharp uses only the current working directory to determine
application.ApplicationRoot
; but the LSP client also uses the current file, which may be outside the working directory.Originally reported at https://github.com/kakoune-lsp/kakoune-lsp/pull/746