Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSP rootUri is ignored in favor of cwd (regression?) #2613

Open
krobelus opened this issue May 15, 2024 · 0 comments
Open

LSP rootUri is ignored in favor of cwd (regression?) #2613

krobelus opened this issue May 15, 2024 · 0 comments

Comments

@krobelus
Copy link

Commit 30db3e0 (Updated host to use provided solution file., 2021-02-28) from #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-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.

Originally reported at kakoune-lsp/kakoune-lsp#746

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant